53 trie1.
insert(0x0123456789abcdef, 40, (uint32_t *)(uintptr_t)(1));
54 trie1.
dump(
"One entry");
57 setCase(
"Two entries, one on the way to the other.");
59 trie2.
insert(0x0123456789abcdef, 40, (uint32_t *)(uintptr_t)(1));
60 trie2.
insert(0x0123456789abcdef, 36, (uint32_t *)(uintptr_t)(2));
61 trie2.
dump(
"Two entries inline v1");
65 trie3.
insert(0x0123456789abcdef, 36, (uint32_t *)(uintptr_t)(2));
66 trie3.
insert(0x0123456789abcdef, 40, (uint32_t *)(uintptr_t)(1));
67 trie3.
dump(
"Two entries inline v2");
70 setCase(
"Two entries on different paths.");
72 trie4.
insert(0x0123456789abcdef, 40, (uint32_t *)(uintptr_t)(2));
73 trie4.
insert(0x0123456776543210, 40, (uint32_t *)(uintptr_t)(1));
74 trie4.
dump(
"Two split entries");
77 setCase(
"Skipping past an entry but not two.");
79 trie5.
insert(0x0123456789000000, 40, (uint32_t *)(uintptr_t)(4));
80 trie5.
insert(0x0123000000000000, 40, (uint32_t *)(uintptr_t)(1));
81 trie5.
insert(0x0123456780000000, 40, (uint32_t *)(uintptr_t)(3));
82 trie5.
insert(0x0123456700000000, 40, (uint32_t *)(uintptr_t)(2));
83 trie5.
dump(
"Complex insertion");
95 trie6.
insert(0x0123456789000000, 40, (uint32_t *)(uintptr_t)(4));
96 trie6.
insert(0x0123000000000000, 40, (uint32_t *)(uintptr_t)(1));
97 trie6.
insert(0x0123456780000000, 40, (uint32_t *)(uintptr_t)(3));
98 node1 = trie6.
insert(0x0123456700000000, 40, (uint32_t *)(uintptr_t)(2));
99 node2 = trie6.
insert(0x0123456700000000, 32, (uint32_t *)(uintptr_t)(10));
100 trie6.
dump(
"Fill before removal");
109 trie6.
dump(
"One node removed");
118 trie6.
dump(
"Two nodes removed");
Handle insert(Key key, unsigned width, Value *val)
Method which inserts a key/value pair into the trie.
Trie< Addr, uint32_t > TestTrie
Value * lookup(Key key)
Method which looks up the Value corresponding to a particular key.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
void dump(const char *title)
A debugging method which prints the contents of this trie.
Value * remove(Handle handle)
Method to delete a value from the trie.
void setCase(const char *newCase)
Sets the current test case.
unsigned printResults()
Function to call at the end of a test that prints an overall result and a summary of how many checks ...
#define EXPECT_EQ(lhs, rhs)
A macro which verifies that lhs and rhs are equal to each other.
void cprintf(const char *format, const Args &...args)