mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-19 03:30:35 +08:00
WIP posix_sitl_test
This commit is contained in:
committed by
Lorenz Meier
parent
2bc74fd5d9
commit
39d388051a
@@ -638,7 +638,7 @@ bool MavlinkFtpTest::_removedirectory_test(void)
|
||||
};
|
||||
|
||||
ut_compare("mkdir failed", ::mkdir(_unittest_microsd_dir, S_IRWXU | S_IRWXG | S_IRWXO), 0);
|
||||
ut_assert("open failed", (fd = ::open(_unittest_microsd_file, O_CREAT | O_EXCL)) != -1);
|
||||
ut_assert("open failed", (fd = ::open(_unittest_microsd_file, O_CREAT | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO)) != -1);
|
||||
::close(fd);
|
||||
|
||||
for (size_t i = 0; i < sizeof(rgTestCases) / sizeof(rgTestCases[0]); i++) {
|
||||
@@ -738,7 +738,7 @@ bool MavlinkFtpTest::_removefile_test(void)
|
||||
};
|
||||
|
||||
ut_compare("mkdir failed", ::mkdir(_unittest_microsd_dir, S_IRWXU | S_IRWXG | S_IRWXO), 0);
|
||||
ut_assert("open failed", (fd = ::open(_unittest_microsd_file, O_CREAT | O_EXCL)) != -1);
|
||||
ut_assert("open failed", (fd = ::open(_unittest_microsd_file, O_CREAT | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO)) != -1);
|
||||
::close(fd);
|
||||
|
||||
for (size_t i = 0; i < sizeof(rgTestCases) / sizeof(rgTestCases[0]); i++) {
|
||||
|
||||
@@ -50,7 +50,13 @@ UnitTest::~UnitTest()
|
||||
|
||||
void UnitTest::print_results(void)
|
||||
{
|
||||
warnx(_tests_failed ? "SOME TESTS FAILED" : "ALL TESTS PASSED");
|
||||
if (_tests_failed) {
|
||||
warnx("SOME TESTS FAILED");
|
||||
|
||||
} else {
|
||||
warnx("ALL TESTS PASSED");
|
||||
}
|
||||
|
||||
warnx(" Tests passed : %d", _tests_passed);
|
||||
warnx(" Tests failed : %d", _tests_failed);
|
||||
warnx(" Assertions : %d", _assertions);
|
||||
|
||||
Reference in New Issue
Block a user