[test] define all unit tests in ot namespace (#9617)

This commit updates unit test modules to be defined under the `ot`
namespace. This aligns all the unit tests to follow the same
model, eliminating the need to use `ot::` prefix in unit test
code.
This commit is contained in:
Abtin Keshavarzian
2023-11-19 18:40:20 -08:00
committed by GitHub
parent b77573586c
commit 23c0fc4d4b
28 changed files with 436 additions and 389 deletions
+11 -9
View File
@@ -49,9 +49,9 @@
#define ENABLE_SRP_TEST 0
#endif
#if ENABLE_SRP_TEST
namespace ot {
using namespace ot;
#if ENABLE_SRP_TEST
// Logs a message and adds current time (sNow) as "<hours>:<min>:<secs>.<msec>"
#define Log(...) \
@@ -60,7 +60,7 @@ using namespace ot;
static constexpr uint16_t kMaxRaSize = 800;
static ot::Instance *sInstance;
static Instance *sInstance;
static uint32_t sNow = 0;
static uint32_t sAlarmTime;
@@ -1028,16 +1028,18 @@ void TestUpdateLeaseShortVariant(void)
#endif // ENABLE_SRP_TEST
} // namespace ot
int main(void)
{
#if ENABLE_SRP_TEST
TestSrpServerBase();
TestSrpServerReject();
TestSrpServerIgnore();
TestSrpServerClientRemove(/* aShouldRemoveKeyLease */ true);
TestSrpServerClientRemove(/* aShouldRemoveKeyLease */ false);
ot::TestSrpServerBase();
ot::TestSrpServerReject();
ot::TestSrpServerIgnore();
ot::TestSrpServerClientRemove(/* aShouldRemoveKeyLease */ true);
ot::TestSrpServerClientRemove(/* aShouldRemoveKeyLease */ false);
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
TestUpdateLeaseShortVariant();
ot::TestUpdateLeaseShortVariant();
#endif
printf("All tests passed\n");
#else