summaryrefslogtreecommitdiff
path: root/tests/test_cpp.cc
diff options
context:
space:
mode:
authorJosh Haberman <haberman@google.com>2013-02-15 16:27:18 -0800
committerJosh Haberman <haberman@google.com>2013-02-15 16:27:18 -0800
commit7d3e2bd2c4cfd1296d1d6f996d7548de26540d41 (patch)
treeb4b35967b3322c65cfb1a32220e8718de09d85fc /tests/test_cpp.cc
parentea198bdcf947ba4bd51474bdd4f7b82b5e4cf41d (diff)
Sync with 8 months of Google-internal development.
Many things have changed and been simplified. The memory-management story for upb_def and upb_handlers is much more robust; upb_def and upb_handlers should be fairly stable interfaces now. There is still much work to do for the runtime component (upb_sink).
Diffstat (limited to 'tests/test_cpp.cc')
-rw-r--r--tests/test_cpp.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/test_cpp.cc b/tests/test_cpp.cc
index fb0916d..59603d9 100644
--- a/tests/test_cpp.cc
+++ b/tests/test_cpp.cc
@@ -8,20 +8,20 @@
*/
#include <stdio.h>
+#include <string.h>
#include <iostream>
-#include "upb/bytestream.hpp"
-#include "upb/def.hpp"
-#include "upb/handlers.hpp"
-#include "upb/upb.hpp"
-#include "upb/pb/decoder.hpp"
-#include "upb/pb/glue.hpp"
+#include "upb/bytestream.h"
+#include "upb/def.h"
+#include "upb/handlers.h"
+#include "upb/pb/glue.h"
#include "upb_test.h"
+#include "upb/upb.h"
static void TestSymbolTable(const char *descriptor_file) {
upb::SymbolTable *s = upb::SymbolTable::New(&s);
upb::Status status;
if (!upb::LoadDescriptorFileIntoSymtab(s, descriptor_file, &status)) {
- std::cerr << "Couldn't load descriptor: " << status;
+ std::cerr << "Couldn't load descriptor: " << status.GetString();
exit(1);
}
const upb::MessageDef *md = s->LookupMessage("A", &md);
@@ -41,7 +41,9 @@ static void TestByteStream() {
free(str);
}
-int main(int argc, char *argv[]) {
+extern "C" {
+
+int run_tests(int argc, char *argv[]) {
if (argc < 2) {
fprintf(stderr, "Usage: test_cpp <descriptor file>\n");
return 1;
@@ -50,3 +52,5 @@ int main(int argc, char *argv[]) {
TestByteStream();
return 0;
}
+
+}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback