tests/test_map.cpp

changeset 677
b09aae58bba4
parent 669
dce9b8450656
child 685
2dd841e364af
equal deleted inserted replaced
676:d0680a23d850 677:b09aae58bba4
119 auto hmap = reinterpret_cast<struct cx_hash_map_s *>(map); 119 auto hmap = reinterpret_cast<struct cx_hash_map_s *>(map);
120 EXPECT_GT(hmap->bucket_count, 0); 120 EXPECT_GT(hmap->bucket_count, 0);
121 cx_for_n(i, hmap->bucket_count) { 121 cx_for_n(i, hmap->bucket_count) {
122 EXPECT_EQ(hmap->buckets[i], nullptr); 122 EXPECT_EQ(hmap->buckets[i], nullptr);
123 } 123 }
124 EXPECT_EQ(map->itemsize, 1); 124 EXPECT_EQ(map->item_size, 1);
125 EXPECT_EQ(map->size, 0); 125 EXPECT_EQ(map->size, 0);
126 EXPECT_EQ(map->allocator, &allocator); 126 EXPECT_EQ(map->allocator, &allocator);
127 EXPECT_FALSE(map->store_pointers); 127 EXPECT_FALSE(map->store_pointers);
128 cxMapStorePointers(map); 128 cxMapStorePointers(map);
129 EXPECT_TRUE(map->store_pointers); 129 EXPECT_TRUE(map->store_pointers);
130 EXPECT_EQ(map->itemsize, sizeof(void *)); 130 EXPECT_EQ(map->item_size, sizeof(void *));
131 cxMapStoreObjects(map); 131 cxMapStoreObjects(map);
132 EXPECT_FALSE(map->store_pointers); 132 EXPECT_FALSE(map->store_pointers);
133 133
134 cxMapDestroy(map); 134 cxMapDestroy(map);
135 EXPECT_TRUE(allocator.verify()); 135 EXPECT_TRUE(allocator.verify());
144 EXPECT_EQ(hmap->buckets[i], nullptr); 144 EXPECT_EQ(hmap->buckets[i], nullptr);
145 } 145 }
146 EXPECT_EQ(map->size, 0); 146 EXPECT_EQ(map->size, 0);
147 EXPECT_EQ(map->allocator, &allocator); 147 EXPECT_EQ(map->allocator, &allocator);
148 EXPECT_TRUE(map->store_pointers); 148 EXPECT_TRUE(map->store_pointers);
149 EXPECT_EQ(map->itemsize, sizeof(void *)); 149 EXPECT_EQ(map->item_size, sizeof(void *));
150 150
151 cxMapDestroy(map); 151 cxMapDestroy(map);
152 EXPECT_TRUE(allocator.verify()); 152 EXPECT_TRUE(allocator.verify());
153 } 153 }
154 154

mercurial