mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 11:04:44 +00:00
TESTS: Use getValOrDefault
This commit is contained in:
parent
35fe126e9e
commit
fd81f32d6a
@ -124,13 +124,13 @@ class HashMapTestSuite : public CxxTest::TestSuite
|
||||
container[4] = 96;
|
||||
|
||||
// We take a const ref now to ensure that the map
|
||||
// is not modified by getVal.
|
||||
// is not modified by getValOrDefault.
|
||||
const Common::HashMap<int, int> &containerRef = container;
|
||||
|
||||
TS_ASSERT_EQUALS(containerRef.getVal(0), 17);
|
||||
TS_ASSERT_EQUALS(containerRef.getVal(17), 0);
|
||||
TS_ASSERT_EQUALS(containerRef.getVal(0, -10), 17);
|
||||
TS_ASSERT_EQUALS(containerRef.getVal(17, -10), -10);
|
||||
TS_ASSERT_EQUALS(containerRef.getValOrDefault(0), 17);
|
||||
TS_ASSERT_EQUALS(containerRef.getValOrDefault(17), 0);
|
||||
TS_ASSERT_EQUALS(containerRef.getValOrDefault(0, -10), 17);
|
||||
TS_ASSERT_EQUALS(containerRef.getValOrDefault(17, -10), -10);
|
||||
}
|
||||
|
||||
void test_iterator_begin_end() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user