mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[unit-test] remove (unnecessary) ENABLE_TEST_MAIN definition (#4367)
This commit is contained in:
committed by
Jonathan Hui
parent
ab27fcd9e6
commit
f10c6c36fd
@@ -30,7 +30,6 @@
|
||||
|
||||
#include "test_util.h"
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
(void)argv;
|
||||
@@ -46,4 +45,3 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -134,7 +134,6 @@ void TestMacCommandFrame()
|
||||
VerifyOrQuit(memcmp(test, decrypted, sizeof(decrypted)) == 0, "TestMacCommandFrame decrypt failed\n");
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestMacBeaconFrame();
|
||||
@@ -142,4 +141,3 @@ int main(void)
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -258,11 +258,9 @@ void TestChildIp6Address(void)
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::TestChildIp6Address();
|
||||
printf("\nAll tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -402,11 +402,9 @@ void TestChildTable(void)
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::TestChildTable();
|
||||
printf("\nAll tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -571,7 +571,6 @@ void TestFuzzEncoderDecoder(void)
|
||||
} // namespace Ncp
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::Ncp::TestHdlcFrameBuffer();
|
||||
@@ -581,4 +580,3 @@ int main(void)
|
||||
printf("\nAll tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -172,11 +172,9 @@ void RunTimerTests(void)
|
||||
TestAllocateMultiple();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
RunTimerTests();
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -80,11 +80,9 @@ void TestHmacSha256(void)
|
||||
testFreeInstance(instance);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestHmacSha256();
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -204,11 +204,9 @@ void TestIp6AddressFromString(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestIp6AddressFromString();
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -486,7 +486,6 @@ void TestSuccessRateTracker(void)
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::TestRssAveraging();
|
||||
@@ -495,4 +494,3 @@ int main(void)
|
||||
printf("\nAll tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -142,11 +142,9 @@ void TestLinkedList(void)
|
||||
VerifyLinkedListContent(list, NULL);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestLinkedList();
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1841,7 +1841,6 @@ void TestLowpanIphc(void)
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestLowpanIphc();
|
||||
@@ -1849,4 +1848,3 @@ int main(void)
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -408,7 +408,6 @@ void TestMacChannelMask(void)
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::TestMacAddress();
|
||||
@@ -418,4 +417,3 @@ int main(void)
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -63,11 +63,9 @@ void TestMessage(void)
|
||||
testFreeInstance(instance);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestMessage();
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -294,7 +294,6 @@ void TestMessageQueueOtApis(void)
|
||||
testFreeInstance(sInstance);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestMessageQueue();
|
||||
@@ -302,4 +301,3 @@ int main(void)
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1098,7 +1098,6 @@ void TestFuzzNcpFrameBuffer(void)
|
||||
} // namespace Ncp
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::Ncp::TestNcpFrameBuffer();
|
||||
@@ -1106,4 +1105,3 @@ int main(void)
|
||||
printf("\nAll tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -175,7 +175,6 @@ void TestNetworkDataIterator(void)
|
||||
} // namespace NetworkData
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::NetworkData::TestNetworkDataIterator();
|
||||
@@ -183,4 +182,3 @@ int main(void)
|
||||
printf("\nAll tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -323,11 +323,9 @@ void TestPriorityQueue(void)
|
||||
testFreeInstance(instance);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestPriorityQueue();
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -82,7 +82,6 @@ void TestMaximumPassphrase(void)
|
||||
testFreeInstance(instance);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestMinimumPassphrase();
|
||||
@@ -90,16 +89,13 @@ int main(void)
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else // #if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
printf("Commissioenr role disabled\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // #if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
|
||||
|
||||
@@ -684,11 +684,9 @@ void TestSpinelDecoder(void)
|
||||
} // namespace Ncp
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::Ncp::TestSpinelDecoder();
|
||||
printf("\nAll tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -403,11 +403,9 @@ void TestSpinelEncoder(void)
|
||||
} // namespace Ncp
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::Ncp::TestSpinelEncoder();
|
||||
printf("\nAll tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -119,11 +119,9 @@ void TestString(void)
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
ot::TestString();
|
||||
printf("\nAll tests passed.\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -657,7 +657,6 @@ void RunTimerTests(void)
|
||||
TestTenTimers();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
RunTimerTests();
|
||||
@@ -665,4 +664,3 @@ int main(void)
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -124,11 +124,9 @@ void TestToolchain(void)
|
||||
test_addr_bitfield();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEST_MAIN
|
||||
int main(void)
|
||||
{
|
||||
TestToolchain();
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -36,9 +36,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Enable main functions
|
||||
#define ENABLE_TEST_MAIN
|
||||
|
||||
/**
|
||||
* This macro verifies a given error status to be successful (compared against value zero (0)), otherwise, it emits a
|
||||
* given error messages and exits the program.
|
||||
|
||||
Reference in New Issue
Block a user