Skip to content

Commit

Permalink
Refactor test_registry.cpp to use nested namespace Kratos::Testing an…
Browse files Browse the repository at this point in the history
…d add exception expectation for missing sub-item retrieval
  • Loading branch information
loumalouomega committed Dec 17, 2024
1 parent 392eff9 commit 44ad0a2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions kratos/tests/cpp_tests/sources/test_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
#include "includes/expect.h"
#include "includes/registry.h"

namespace Kratos {

namespace Testing {
namespace Kratos::Testing {

namespace
{
Expand Down Expand Up @@ -141,6 +139,7 @@ KRATOS_TEST_CASE_IN_SUITE(RegistrySubValue, KratosCoreFastSuite)

registry_item.AddItem<double>("sub_value_item", value);
auto& sub_item = registry_item.GetItem("sub_value_item");
KRATOS_EXPECT_EXCEPTION_IS_THROWN(registry_item.GetItem("sub_value_item_2"), "");

KRATOS_EXPECT_EQ(sub_item.Name(),"sub_value_item");
KRATOS_EXPECT_TRUE(sub_item.HasValue());
Expand Down Expand Up @@ -315,5 +314,4 @@ KRATOS_TEST_CASE_IN_SUITE(RegistryIsSameType, KratosCoreFastSuite) {
KRATOS_EXPECT_FALSE(Registry::GetItem("variables.all.VELOCITY").IsSameType(test_double));
}

}
} // namespace Kratos.
} // namespace Kratos::Testing.

0 comments on commit 44ad0a2

Please sign in to comment.