File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#pragma once
22#include < Allocator.h>
3- #include < Array.h>
43#include < MemoryOperations.h>
54#include < rapidhash.h>
65
Original file line number Diff line number Diff line change 11#include < Core/Containers/HashMap.h>
2+ #include < Core/Containers/Strings.h>
23#include < gtest/gtest.h>
34#include < string>
45
@@ -121,14 +122,20 @@ TEST_F(HashMapTest, Resize)
121122
122123TEST_F (HashMapTest, OverwriteValue)
123124{
124- HashMap<int , int > map;
125+ HashMap<int , String > map;
125126 map.init (&allocator, 10 , 0 );
126127
127- map. insert ( 1 , 10 ) ;
128- EXPECT_EQ (map[ 1 ], 10 );
128+ String str1 ;
129+ str1. init (&allocator, " first " );
129130
130- map.insert (1 , 20 );
131- EXPECT_EQ (map[1 ], 20 );
131+ String str2;
132+ str2.init (&allocator, " updated" );
133+
134+ map.insert (1 , str1);
135+ EXPECT_STREQ (map[1 ].c_str (), str1.c_str ());
136+
137+ map.insert (1 , str2);
138+ EXPECT_STREQ (map[1 ].c_str (), str2.c_str ());
132139}
133140
134141TEST_F (HashMapTest, CollisionHandling)
You can’t perform that action at this time.
0 commit comments