FIX tests namespaces
This commit is contained in:
		| @@ -32,7 +32,8 @@ | ||||
| #include "unity/unity.h" | ||||
| #include "utest/utest.h" | ||||
|  | ||||
| namespace utest::v1 { | ||||
| namespace utest { | ||||
| namespace v1 { | ||||
|  | ||||
| // test_bike_system handler function | ||||
| static void test_bike_system() { | ||||
| @@ -139,9 +140,9 @@ static void test_bike_system_with_event() { | ||||
|     } | ||||
| } | ||||
|  | ||||
| static utest::v1::status_t greentea_setup(const size_t number_of_cases) { | ||||
|     // Here, we specify the timeout (60s) and the host test (a built-in host test or the | ||||
|     // name of our Python file) | ||||
| static status_t greentea_setup(const size_t number_of_cases) { | ||||
|     // Here, we specify the timeout (60s) and the host test (a built-in host test | ||||
|     // or the name of our Python file) | ||||
|     GREENTEA_SETUP(180, "default_auto"); | ||||
|  | ||||
|     return greentea_test_setup_handler(number_of_cases); | ||||
| @@ -156,5 +157,7 @@ static Case cases[] = { | ||||
|  | ||||
| static Specification specification(greentea_setup, cases); | ||||
|  | ||||
| int main() { return !Harness::run(specification); } | ||||
| };  // namespace utest::v1 | ||||
| };  // namespace v1 | ||||
| };  // namespace utest | ||||
|  | ||||
| int main() { return !utest::v1::Harness::run(utest::v1::specification); } | ||||
|   | ||||
| @@ -29,7 +29,8 @@ | ||||
| #include "unity/unity.h" | ||||
| #include "utest/utest.h" | ||||
|  | ||||
| namespace utest::v1 { | ||||
| namespace utest { | ||||
| namespace v1 { | ||||
|  | ||||
| // test_hdc1000 test handler function | ||||
| static control_t test_sensor_device(const size_t call_count) { | ||||
| @@ -53,9 +54,9 @@ static control_t test_sensor_device(const size_t call_count) { | ||||
|     return CaseNext; | ||||
| } | ||||
|  | ||||
| static utest::v1::status_t greentea_setup(const size_t number_of_cases) { | ||||
|     // Here, we specify the timeout (60s) and the host test (a built-in host test or the | ||||
|     // name of our Python file) | ||||
| static status_t greentea_setup(const size_t number_of_cases) { | ||||
|     // Here, we specify the timeout (60s) and the host test (a built-in host test | ||||
|     // or the name of our Python file) | ||||
|     GREENTEA_SETUP(60, "default_auto"); | ||||
|  | ||||
|     return greentea_test_setup_handler(number_of_cases); | ||||
| @@ -65,6 +66,7 @@ static utest::v1::status_t greentea_setup(const size_t number_of_cases) { | ||||
| static Case cases[] = {Case("test sensor device", test_sensor_device)}; | ||||
|  | ||||
| static Specification specification(greentea_setup, cases); | ||||
| };  // namespace v1 | ||||
| };  // namespace utest | ||||
|  | ||||
| int main() { return !Harness::run(specification); } | ||||
| };  // namespace utest::v1 | ||||
| int main() { return !utest::v1::Harness::run(utest::v1::specification); } | ||||
|   | ||||
| @@ -31,13 +31,15 @@ | ||||
| #include "static_scheduling/gear_device.hpp" | ||||
| #include "unity/unity.h" | ||||
| #include "utest/utest.h" | ||||
| namespace utest::v1 { | ||||
|  | ||||
| // allow for 0.1 km/h difference | ||||
| static constexpr float kAllowedSpeedDelta = 0.1f; | ||||
| // allow for 1m difference | ||||
| static constexpr float kAllowedDistanceDelta = 1.0f / 1000.0; | ||||
|  | ||||
| namespace utest { | ||||
| namespace v1 { | ||||
|  | ||||
| // function called by test handler functions for verifying the current speed | ||||
| void check_current_speed(const std::chrono::milliseconds& pedalRotationTime, | ||||
|                          uint8_t traySize, | ||||
| @@ -74,7 +76,8 @@ float compute_distance(const std::chrono::milliseconds& pedalRotationTime, | ||||
|     float trayGearRatio = static_cast<float>(traySize) / static_cast<float>(gearSize); | ||||
|     float distancePerPedalTurn = trayGearRatio * wheelCircumference; | ||||
|  | ||||
|     // distancePerPedalTurn is expressed in m, divide per 1000 for a distance in km | ||||
|     // distancePerPedalTurn is expressed in m, divide per 1000 for a distance in | ||||
|     // km | ||||
|     return (distancePerPedalTurn * pedalRotations) / 1000.0; | ||||
| } | ||||
|  | ||||
| @@ -85,7 +88,8 @@ void check_distance(const std::chrono::milliseconds& pedalRotationTime, | ||||
|                     float wheelCircumference, | ||||
|                     const std::chrono::milliseconds& travelTime, | ||||
|                     float distance) { | ||||
|     // distancePerPedalTurn is expressed in m, divide per 1000 for a distance in km | ||||
|     // distancePerPedalTurn is expressed in m, divide per 1000 for a distance in | ||||
|     // km | ||||
|     float expectedDistance = compute_distance( | ||||
|         pedalRotationTime, traySize, gearSize, wheelCircumference, travelTime); | ||||
|     printf("  Expected distance is %f, current distance is %f\n", | ||||
| @@ -333,9 +337,9 @@ static control_t test_reset(const size_t call_count) { | ||||
|     return CaseNext; | ||||
| } | ||||
|  | ||||
| static utest::v1::status_t greentea_setup(const size_t number_of_cases) { | ||||
|     // Here, we specify the timeout (60s) and the host test (a built-in host test or the | ||||
|     // name of our Python file) | ||||
| static status_t greentea_setup(const size_t number_of_cases) { | ||||
|     // Here, we specify the timeout (60s) and the host test (a built-in host test | ||||
|     // or the name of our Python file) | ||||
|     GREENTEA_SETUP(180, "default_auto"); | ||||
|  | ||||
|     return greentea_test_setup_handler(number_of_cases); | ||||
| @@ -349,6 +353,7 @@ static Case cases[] = { | ||||
|     Case("test speedometer reset", test_reset)}; | ||||
|  | ||||
| static Specification specification(greentea_setup, cases); | ||||
| };  // namespace v1 | ||||
| };  // namespace utest | ||||
|  | ||||
| int main() { return !Harness::run(specification); } | ||||
| };  // namespace utest::v1 | ||||
| int main() { return !utest::v1::Harness::run(utest::v1::specification); } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user