aboutsummaryrefslogtreecommitdiff
path: root/src/test/ResourceManagerTest.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-11 16:28:37 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-11 16:28:37 +0100
commita108f7360e03cc7826ad4ed0cee464b1196fa456 (patch)
tree2de89843620b8ec65b99a56bd3c2428bef733852 /src/test/ResourceManagerTest.cpp
parentd80c98ee03e59e0c38e025a7fe83ab4c39115fb8 (diff)
parent78c4a8772526f40c531b5402b56932b0a41e22e8 (diff)
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/text-component
Diffstat (limited to 'src/test/ResourceManagerTest.cpp')
-rw-r--r--src/test/ResourceManagerTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ResourceManagerTest.cpp b/src/test/ResourceManagerTest.cpp
index b6be3c0..44a5921 100644
--- a/src/test/ResourceManagerTest.cpp
+++ b/src/test/ResourceManagerTest.cpp
@@ -17,6 +17,10 @@ class ResourceManagerTest : public Test {
public:
ResourceManager resource_manager{mediator};
+ class Unrelated : public Resource {
+ using Resource::Resource;
+ };
+
Asset asset_a{"asset/texture/img.png"};
Asset asset_b{"asset/texture/ERROR.png"};
@@ -69,3 +73,9 @@ TEST_F(ResourceManagerTest, Persistent) {
resource_manager.clear_all();
EXPECT_EQ(TestResource::instances, 0);
}
+
+TEST_F(ResourceManagerTest, UnmatchedType) {
+ EXPECT_NO_THROW({ resource_manager.get<TestResource>(asset_a); });
+
+ EXPECT_THROW({ resource_manager.get<Unrelated>(asset_a); }, runtime_error);
+}