29 #include <gtest/gtest.h> 40 static inline uint32_t *ptr(uintptr_t
val)
42 return (uint32_t *)
val;
57 trie.
dump(
"test trie", ss);
118 node1 =
trie.
insert(0x0123456700000000, 40, ptr(2));
119 node2 =
trie.
insert(0x0123456700000000, 32, ptr(10));
Handle insert(Key key, unsigned width, Value *val)
Method which inserts a key/value pair into the trie.
TEST_F(TrieTestData, Empty)
Value * lookup(Key key)
Method which looks up the Value corresponding to a particular key.
void dump(const char *title, std::ostream &os=std::cout)
A debugging method which prints the contents of this trie.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
Value * remove(Handle handle)
Method to delete a value from the trie.
#define EXPECT_EQ(lhs, rhs)
A macro which verifies that lhs and rhs are equal to each other.
Trie< Addr, uint32_t > TrieType