From 483d074217be34f9563ec603f9af67566634e8e0 Mon Sep 17 00:00:00 2001 From: msieben <4319079+msieben@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:17:22 +0200 Subject: [PATCH] Development/namespaces (#1695) * [Tests/init/core] : Separate 'tests' from 'core' namespaces. Initial changes by mostly search and replace. * [Tests/unit/core] : partially revert '8a3fe02b8a9f3ff7c3672942d2ee906115420956' to include 'test_messageException' * [Tests/unit / Tests/unit/core] : Do not depend on 'IPTestAdministrator' if it not used * [Tests/unit/core] : Make explicit global namespace lookup * [DOC] Singletons section (#1540) * singleton section added * singletons documentation section added * singletons.md added to mkdocs.yml * warning fixed * formating fix * singletons description addded * [doc] description of singletons added * Update singletons.md --------- Co-authored-by: MFransen69 <39826971+MFransen69@users.noreply.github.com> * [Actions] Adding process containers with runC backend to be built in the Linux workflow (#1655) * Fixing warnings in RunC process containers * Adding containers to Actions * Removing PROCESSCONTAINERS_CLIB option as it was the same as RunC * Temporarily using a template from development to test the changes * Using sizeof to get the size of a buffer instead of a fixed value which did not match the buffer size on top of that * Changing back to use template from master * [Tests/unit/core] : more use of full nested namespaces * [Tests/unit/core] : remove 'using' in 'test_hash' * Revert "[Tests/unit / Tests/unit/core] : Do not depend on 'IPTestAdministrator' if it not used" This reverts commit 7ac03350fc14b77f7ab4596d56893551b8d86797. * [Tests/unit/tests] : align namespace usage for 'test_iptestadministrator' --------- Co-authored-by: Piotr Czekaj Co-authored-by: MFransen69 <39826971+MFransen69@users.noreply.github.com> Co-authored-by: Mateusz Daniluk <121170681+VeithMetro@users.noreply.github.com> --- Tests/unit/core/test_hex2strserialization.cpp | 2 +- Tests/unit/core/test_library.cpp | 2 +- Tests/unit/core/test_message_dispatcher.cpp | 3 +- Tests/unit/core/test_message_unit.cpp | 2 +- Tests/unit/core/test_synchronous.cpp | 2 +- Tests/unit/core/test_threadpool.cpp | 3 -- Tests/unit/core/test_tracing.cpp | 2 +- Tests/unit/tests/test_iptestmanager.cpp | 39 ++++++++++++------- 8 files changed, 32 insertions(+), 23 deletions(-) diff --git a/Tests/unit/core/test_hex2strserialization.cpp b/Tests/unit/core/test_hex2strserialization.cpp index 6e666744c..1f0f79a4f 100644 --- a/Tests/unit/core/test_hex2strserialization.cpp +++ b/Tests/unit/core/test_hex2strserialization.cpp @@ -92,4 +92,4 @@ namespace Core { } // Core } // Tests -} // Thunder \ No newline at end of file +} // Thunder diff --git a/Tests/unit/core/test_library.cpp b/Tests/unit/core/test_library.cpp index 04302debc..57630a630 100644 --- a/Tests/unit/core/test_library.cpp +++ b/Tests/unit/core/test_library.cpp @@ -27,7 +27,7 @@ namespace Thunder { namespace Tests { -namespace Core { +namespace Core { TEST(Core_Library, simpleSet) { diff --git a/Tests/unit/core/test_message_dispatcher.cpp b/Tests/unit/core/test_message_dispatcher.cpp index afa213115..53f6ef996 100644 --- a/Tests/unit/core/test_message_dispatcher.cpp +++ b/Tests/unit/core/test_message_dispatcher.cpp @@ -213,8 +213,6 @@ namespace Core { { uint8_t testData[2] = { 13, 37 }; ASSERT_EQ(_dispatcher->PushData(sizeof(testData), testData), ::Thunder::Core::ERROR_NONE); - // The 'ring' is implicit -// _dispatcher->Ring(); } } @@ -313,6 +311,7 @@ namespace Core { EXPECT_EQ(readData[0], testData2[0]); EXPECT_EQ(readData[3], testData2[3]); } + } // Core } // Tests } // Thunder diff --git a/Tests/unit/core/test_message_unit.cpp b/Tests/unit/core/test_message_unit.cpp index b2c180c92..a4966c0a3 100644 --- a/Tests/unit/core/test_message_unit.cpp +++ b/Tests/unit/core/test_message_unit.cpp @@ -581,4 +581,4 @@ namespace Core { } // Core } // Tests -} // Thunder \ No newline at end of file +} // Thunder diff --git a/Tests/unit/core/test_synchronous.cpp b/Tests/unit/core/test_synchronous.cpp index 608afd198..abd8623e5 100644 --- a/Tests/unit/core/test_synchronous.cpp +++ b/Tests/unit/core/test_synchronous.cpp @@ -195,4 +195,4 @@ namespace Core { } // Core } // Tests -} // Thunder \ No newline at end of file +} // Thunder diff --git a/Tests/unit/core/test_threadpool.cpp b/Tests/unit/core/test_threadpool.cpp index ea9211fa9..31d022ca3 100644 --- a/Tests/unit/core/test_threadpool.cpp +++ b/Tests/unit/core/test_threadpool.cpp @@ -31,9 +31,6 @@ namespace Thunder { namespace Tests { namespace Core { - - - static constexpr uint32_t MaxJobWaitTime = 1000; // In milliseconds static constexpr uint8_t MaxAdditionalWorker = 5; diff --git a/Tests/unit/core/test_tracing.cpp b/Tests/unit/core/test_tracing.cpp index 9fe06aea0..c0b67e3c9 100644 --- a/Tests/unit/core/test_tracing.cpp +++ b/Tests/unit/core/test_tracing.cpp @@ -356,4 +356,4 @@ namespace Core { } // Core } // Tests -} // Thunder \ No newline at end of file +} // Thunder diff --git a/Tests/unit/tests/test_iptestmanager.cpp b/Tests/unit/tests/test_iptestmanager.cpp index 557d16cd4..894448c5b 100644 --- a/Tests/unit/tests/test_iptestmanager.cpp +++ b/Tests/unit/tests/test_iptestmanager.cpp @@ -17,24 +17,37 @@ * limitations under the License. */ +#include + +#ifndef MODULE_NAME +#include "../Module.h" +#endif + +#include + #include "../IPTestAdministrator.h" -#include +namespace Thunder { +namespace Tests { +namespace Core { -TEST(Test_IPTestAdministrator, sync) -{ - IPTestAdministrator::OtherSideMain otherSide = [](IPTestAdministrator & testAdmin) { - testAdmin.Sync("str01"); + TEST(Test_IPTestAdministrator, sync) + { + IPTestAdministrator::OtherSideMain otherSide = [](IPTestAdministrator & testAdmin) { + testAdmin.Sync("str01"); - testAdmin.Sync("str02_a"); - }; + testAdmin.Sync("str02_a"); + }; - IPTestAdministrator testAdmin(otherSide); + IPTestAdministrator testAdmin(otherSide); - bool result = testAdmin.Sync("str01"); - ASSERT_TRUE(result); + bool result = testAdmin.Sync("str01"); + ASSERT_TRUE(result); - result = testAdmin.Sync("str02_b"); - ASSERT_FALSE(result); -} + result = testAdmin.Sync("str02_b"); + ASSERT_FALSE(result); + } +} // Core +} // Tests +} // Thunder