diff options
Diffstat (limited to 'tests/test_cpp.cc')
-rw-r--r-- | tests/test_cpp.cc | 20 |
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; } + +} |