Skip to content

Commit

Permalink
Add tests for analogReadResolution
Browse files Browse the repository at this point in the history
  • Loading branch information
mlainez committed Feb 16, 2024
1 parent 169266b commit e1ea1ed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ namespace FunctionTest
Verify(Method(ArduinoFake(), analogRead).Using(4)).Once();
}

void test_analog_read_resolution(void)
{
When(Method(ArduinoFake(), analogReadResolution)).AlwaysReturn();

analogReadResolution(12);

Verify(Method(ArduinoFake(), analogReadResolution).Using(12)).Once();
}

void test_yield(void)
{
When(Method(ArduinoFake(), yield)).AlwaysReturn();
Expand Down Expand Up @@ -188,6 +197,7 @@ namespace FunctionTest
RUN_TEST(FunctionTest::test_pin_mode);
RUN_TEST(FunctionTest::test_digital_pin);
RUN_TEST(FunctionTest::test_analog_pin);
RUN_TEST(FunctionTest::test_analog_read_resolution);
RUN_TEST(FunctionTest::test_delay);
RUN_TEST(FunctionTest::test_detach);
RUN_TEST(FunctionTest::test_attach);
Expand Down

0 comments on commit e1ea1ed

Please sign in to comment.