diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-19 13:58:58 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-19 13:58:58 +0100 |
commit | b5c4879189a8ff55434c8c04c14163dfda83de65 (patch) | |
tree | 17595782d04038818f7ed4f6bb2199949ebd30a0 /src/test/SaveManagerTest.cpp | |
parent | ebe2fcfce52d9a303c5fa19d79554e20ac7f0bac (diff) | |
parent | 794efc4ef7a44b190a4d9ecc2dd84a66c62ab005 (diff) |
Merge branch 'master' into niels/UI
Diffstat (limited to 'src/test/SaveManagerTest.cpp')
-rw-r--r-- | src/test/SaveManagerTest.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/test/SaveManagerTest.cpp b/src/test/SaveManagerTest.cpp index e9b0c29..7609e69 100644 --- a/src/test/SaveManagerTest.cpp +++ b/src/test/SaveManagerTest.cpp @@ -27,8 +27,8 @@ TEST_F(SaveManagerTest, ReadWrite) { mgr.set<string>("foo", "bar"); ASSERT_TRUE(mgr.has("foo")); - ValueBroker value = mgr.get<string>("foo"); - EXPECT_EQ(value.get(), "bar"); + string value = mgr.get<string>("foo"); + EXPECT_EQ(value, "bar"); } TEST_F(SaveManagerTest, DefaultValue) { @@ -36,5 +36,16 @@ TEST_F(SaveManagerTest, DefaultValue) { ASSERT_EQ(value.get(), 3); value.set(5); - ASSERT_EQ(value.get(), 5); + EXPECT_EQ(value.get(), 5); +} + +TEST_F(SaveManagerTest, MultipleKeys) { + ValueBroker foo = mgr.get<int>("foo", 1); + ValueBroker bar = mgr.get<int>("bar", 2); + + EXPECT_EQ(foo.get(), 1); + EXPECT_EQ(bar.get(), 2); + + EXPECT_EQ(mgr.get<int>("foo"), 1); + EXPECT_EQ(mgr.get<int>("bar"), 2); } |