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

Mock platform #949

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions tests/unit/api/api_common_h_unit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ TEST_F(api_common_h_unit, test_libmraa_common_methods)
/* No versioning for the mock platform */
ASSERT_STREQ(NULL, mraa_get_platform_version(0));

/* Currently 10 pins in the mock platform */
ASSERT_EQ(10, mraa_get_pin_count());
/* Currently 11 pins in the mock platform */
ASSERT_EQ(11, mraa_get_pin_count());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please combine all those test changes into the same commit that introduces the PWM pin - so that the pin addition goes in as an atomic change and we have both functionality and tests for it right away.


/* Test the other pin/bus counts for the mock platform */
EXPECT_EQ(1, mraa_get_aio_count());
EXPECT_EQ(1, mraa_get_gpio_count());
EXPECT_EQ(1, mraa_get_i2c_bus_count());
EXPECT_EQ(0, mraa_get_i2c_bus_id(0));
EXPECT_EQ(0, mraa_get_pwm_count());
EXPECT_EQ(1, mraa_get_pwm_count());
EXPECT_EQ(1, mraa_get_spi_bus_count());
EXPECT_EQ(1, mraa_get_uart_count());

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/api/api_common_hpp_unit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ TEST_F(api_common_hpp_unit, test_libmraa_common_methods)
/* No versioning for the mock platform */
ASSERT_EQ("", mraa::getPlatformVersion(0));

/* Currently 10 pins in the mock platform */
ASSERT_EQ(10, mraa::getPinCount());
/* Currently 11 pins in the mock platform */
ASSERT_EQ(11, mraa::getPinCount());

/* Test the other pin/bus counts for the mock platform */
/* Missing equivalent C++ methods */
Expand Down