Skip to content

Commit

Permalink
Fix occurences of getValue in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Jun 4, 2024
1 parent 335b515 commit 31643d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unittests/interface_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ TEST_CASE("InterfaceType from immutable", "[interface-types][basics]") {
WrapperT wrapper{hit};
REQUIRE(wrapper.isA<ExampleHit>());
REQUIRE_FALSE(wrapper.isA<ExampleCluster>());
REQUIRE(wrapper.getValue<ExampleHit>() == hit);
REQUIRE(wrapper.as<ExampleHit>() == hit);
REQUIRE(wrapper == hit);

ExampleCluster cluster{};
wrapper = cluster;
REQUIRE(wrapper.isA<ExampleCluster>());
REQUIRE(wrapper.getValue<ExampleCluster>() == cluster);
REQUIRE_THROWS_AS(wrapper.getValue<ExampleHit>(), std::runtime_error);
REQUIRE(wrapper.as<ExampleCluster>() == cluster);
REQUIRE_THROWS_AS(wrapper.as<ExampleHit>(), std::runtime_error);
REQUIRE(wrapper != hit);
}

Expand All @@ -91,7 +91,7 @@ TEST_CASE("InterfaceType from mutable", "[interface-types][basics]") {
WrapperT wrapper{hit};
REQUIRE(wrapper.isA<ExampleHit>());
REQUIRE_FALSE(wrapper.isA<ExampleCluster>());
REQUIRE(wrapper.getValue<ExampleHit>() == hit);
REQUIRE(wrapper.as<ExampleHit>() == hit);
REQUIRE(wrapper == hit);
// Comparison also work against the immutable classes
ExampleHit immutableHit = hit;
Expand All @@ -100,8 +100,8 @@ TEST_CASE("InterfaceType from mutable", "[interface-types][basics]") {
MutableExampleCluster cluster{};
wrapper = cluster;
REQUIRE(wrapper.isA<ExampleCluster>());
REQUIRE(wrapper.getValue<ExampleCluster>() == cluster);
REQUIRE_THROWS_AS(wrapper.getValue<ExampleHit>(), std::runtime_error);
REQUIRE(wrapper.as<ExampleCluster>() == cluster);
REQUIRE_THROWS_AS(wrapper.as<ExampleHit>(), std::runtime_error);
REQUIRE(wrapper != hit);
}

Expand Down

0 comments on commit 31643d0

Please sign in to comment.