summaryrefslogtreecommitdiff
path: root/tests/test_table.cc
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-07-09 19:25:39 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-07-09 19:25:39 -0700
commitbe5ddd8a645eaa949a8d500718257fb7cb71cf44 (patch)
tree5858669f1f0d2324dc779f60c01b01f015bb2d74 /tests/test_table.cc
parent209dce5eb08709bfb5b21e19289b3814619ca6cc (diff)
Tweaks to upb_src/upb_sink interfaces.
Diffstat (limited to 'tests/test_table.cc')
-rw-r--r--tests/test_table.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_table.cc b/tests/test_table.cc
index 47d806c..37e14a8 100644
--- a/tests/test_table.cc
+++ b/tests/test_table.cc
@@ -1,7 +1,7 @@
#undef NDEBUG /* ensure tests always assert. */
#include "upb_table.h"
-#include "upb_data.h"
+#include "upb_string.h"
#include "test_util.h"
#include <assert.h>
#include <map>
@@ -45,7 +45,7 @@ void test_strtable(const vector<string>& keys, uint32_t num_to_insert)
all.insert(key);
strtable_entry e;
e.value = key[0];
- upb_strptr str = upb_strduplen(key.c_str(), key.size());
+ upb_string *str = upb_strduplen(key.c_str(), key.size());
e.e.key = str;
upb_strtable_insert(&table, &e.e);
upb_string_unref(str); // The table still owns a ref.
@@ -55,7 +55,7 @@ void test_strtable(const vector<string>& keys, uint32_t num_to_insert)
/* Test correctness. */
for(uint32_t i = 0; i < keys.size(); i++) {
const string& key = keys[i];
- upb_strptr str = upb_strduplen(key.c_str(), key.size());
+ upb_string *str = upb_strduplen(key.c_str(), key.size());
strtable_entry *e = (strtable_entry*)upb_strtable_lookup(&table, str);
if(m.find(key) != m.end()) { /* Assume map implementation is correct. */
assert(e);
@@ -71,7 +71,7 @@ void test_strtable(const vector<string>& keys, uint32_t num_to_insert)
strtable_entry *e;
for(e = (strtable_entry*)upb_strtable_begin(&table); e;
e = (strtable_entry*)upb_strtable_next(&table, &e->e)) {
- string tmp(upb_string_getrobuf(e->e.key), upb_strlen(e->e.key));
+ string tmp(upb_string_getrobuf(e->e.key), upb_string_len(e->e.key));
std::set<string>::iterator i = all.find(tmp);
assert(i != all.end());
all.erase(i);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback