3 #include "../../src/hashtable.h"
4 #include "gtest/gtest.h"
6 TEST(MaterialTableTest
, Size
)
8 HashTable
<Material
> ht(MT_SIZE
);
10 int entry_size
= sizeof(Hash
) + sizeof(Material
);
11 EXPECT_EQ(16, entry_size
);
13 int size
= MT_SIZE
/ entry_size
;
15 // 'size' must be a power of two for HashTable<Material>::lookup()
16 EXPECT_EQ(0, size
& (size
- 1));
18 EXPECT_EQ(size
, ht
.size());