Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚨Fix clang-tidy issues #48

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions tests/can.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,18 @@ void check_validity(hal::hertz p_operating_frequency,
<< "Frequency '" << p_operating_frequency << "' and baud rate '"
<< p_target_baud_rate << "'\n";

auto test_subject = call_result.value();
// clang-tidy for some reason doesn't accept that `.value()` as "checked"
// usage of an optional.
auto test_subject = call_result.value(); // NOLINT

auto const bit_width = hal::bit_width(test_subject);

auto calculated_baud_rate =
p_operating_frequency /
(test_subject.clock_divider *
(test_subject.sync_segment + test_subject.propagation_delay +
test_subject.phase_segment1 + test_subject.phase_segment2));
auto const calculated_bit_width =
(test_subject.sync_segment + test_subject.propagation_delay +
test_subject.phase_segment1 + test_subject.phase_segment2);
auto const denominator =
static_cast<float>(test_subject.clock_divider * calculated_bit_width);
auto const calculated_baud_rate = p_operating_frequency / denominator;

expect(that % 8 <= bit_width && bit_width <= 25)
<< "Bit width is beyond the bounds of 8 and 25";
Expand Down
2 changes: 1 addition & 1 deletion tests/enum.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ boost::ut::suite<"enum_test"> enum_test = [] {
constexpr int expected1 = 1;
constexpr int expected2 = 20;

enum class test_enum
enum class test_enum : std::uint8_t
{
enum_value1 = expected1,
enum_value2 = expected2,
Expand Down
Loading