summaryrefslogtreecommitdiff
path: root/tests/test_cpp.cc
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2012-03-24 11:24:16 -0700
committerJoshua Haberman <jhaberman@gmail.com>2012-03-24 11:24:16 -0700
commit86bad61b76a260ffc442acffbe58feee67df45e5 (patch)
treee375e62ff6d7fea9fb810830e66118e67b4ec2c8 /tests/test_cpp.cc
parentdb59a5198f890ecdcac1227b0bb998160acac5c6 (diff)
Sync from internal Google development.
Many improvements, too many to mention. One significant perf regression warrants investigation: omitfp.parsetoproto2_googlemessage1.upb_jit: 343 -> 252 (-26.53) plain.parsetoproto2_googlemessage1.upb_jit: 334 -> 251 (-24.85) 25% regression for this benchmark is bad, but since I don't think there's any fundamental design issue that caused it I'm going to go ahead with the commit anyway. Can investigate and fix later. Other benchmarks were neutral or showed slight improvement.
Diffstat (limited to 'tests/test_cpp.cc')
-rw-r--r--tests/test_cpp.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc
index 5182217..4d70e85 100644
--- a/tests/test_cpp.cc
+++ b/tests/test_cpp.cc
@@ -15,6 +15,7 @@
#include "upb/upb.hpp"
#include "upb/pb/decoder.hpp"
#include "upb/pb/glue.hpp"
+#include "upb_test.h"
static void TestSymbolTable(const char *descriptor_file) {
upb::SymbolTable *s = upb::SymbolTable::New();
@@ -23,20 +24,20 @@ static void TestSymbolTable(const char *descriptor_file) {
std::cerr << "Couldn't load descriptor: " << status;
exit(1);
}
- const upb::MessageDef *md = s->LookupMessage("A");
- assert(md);
+ const upb::MessageDef *md = s->LookupMessage("A", &md);
+ ASSERT(md);
s->Unref();
- md->Unref();
+ md->Unref(&md);
}
static void TestByteStream() {
upb::StringSource stringsrc;
stringsrc.Reset("testing", 7);
upb::ByteRegion* byteregion = stringsrc.AllBytes();
- assert(byteregion->FetchAll() == UPB_BYTE_OK);
+ ASSERT(byteregion->FetchAll() == UPB_BYTE_OK);
char* str = byteregion->StrDup();
- assert(strcmp(str, "testing") == 0);
+ ASSERT(strcmp(str, "testing") == 0);
free(str);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback