summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2014-11-18 15:40:04 -0800
committerJosh Haberman <jhaberman@gmail.com>2014-11-18 15:40:04 -0800
commit177212c82f62e86e67bca69d1dbcf9d39d9123c4 (patch)
tree37be526d392d64dfcae134d1bb5ec527e1db3625
parent3d0c7c45da5b72a88bfb03dc5ce3384b7f01cef6 (diff)
Fixed building of googlepbtests.
-rw-r--r--Makefile20
-rw-r--r--tests/bindings/googlepb/test_vs_proto2.cc6
2 files changed, 14 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 0d5ce56..e1c6f67 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ dep:
clean_leave_profile:
@rm -rf obj lib
- @rm -f benchmark/google_messages.proto.pb benchmark/google_messages.pb.* benchmarks/b.* benchmarks/*.pb*
+ @rm -f benchmarks/*.pb* benchmarks/google_message?.h
@rm -f $(TESTS) tests/testmain.o tests/t.*
@rm -f upb/descriptor.pb
@rm -rf tools/upbc deps
@@ -319,13 +319,13 @@ benchmarks/google_messages.proto.pb: benchmarks/google_messages.proto
benchmarks/google_messages.pb.cc: benchmarks/google_messages.proto
protoc benchmarks/google_messages.proto --cpp_out=.
-benchmarks/googlemessage1.h:
+benchmarks/google_message1.h:
$(E) XXD benchmarks/google_message1.dat
- $(Q) xxd -i < benchmarks/google_message1.dat > benchmarks/googlemessage1.h
+ $(Q) xxd -i < benchmarks/google_message1.dat > benchmarks/google_message1.h
-benchmarks/googlemessage2.h:
+benchmarks/google_message2.h:
$(E) XXD benchmarks/google_message2.dat
- $(Q) xxd -i < benchmarks/google_message2.dat > benchmarks/googlemessage2.h
+ $(Q) xxd -i < benchmarks/google_message2.dat > benchmarks/google_message2.h
GOOGLEPB_TEST_LIBS = \
lib/libupb.bindings.googlepb.a \
@@ -341,20 +341,22 @@ GOOGLEPB_TEST_DEPS = \
$(GOOGLEPB_TEST_LIBS)
tests/bindings/googlepb/test_vs_proto2.googlemessage1: $(GOOGLEPB_TEST_DEPS) \
- benchmarks/googlemessage1.h
+ benchmarks/google_message1.h \
+ benchmarks/google_message2.h
$(E) CXX $< '(benchmarks::SpeedMessage1)'
$(Q) $(CXX) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< \
-DMESSAGE_CIDENT="benchmarks::SpeedMessage1" \
- -DMESSAGE_DATA_HFILE=\"benchmarks/googlemessage1.h\" \
+ -DMESSAGE_DATA_IDENT=message1_data \
benchmarks/google_messages.pb.cc tests/testmain.o -lprotobuf -lpthread \
$(GOOGLEPB_TEST_LIBS)
tests/bindings/googlepb/test_vs_proto2.googlemessage2: $(GOOGLEPB_TEST_DEPS) \
- benchmarks/googlemessage2.h
+ benchmarks/google_message1.h \
+ benchmarks/google_message2.h
$(E) CXX $< '(benchmarks::SpeedMessage2)'
$(Q) $(CXX) $(OPT) $(WARNFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< \
-DMESSAGE_CIDENT="benchmarks::SpeedMessage2" \
- -DMESSAGE_DATA_HFILE=\"benchmarks/googlemessage2.h\" \
+ -DMESSAGE_DATA_IDENT=message2_data \
benchmarks/google_messages.pb.cc tests/testmain.o -lprotobuf -lpthread \
$(GOOGLEPB_TEST_LIBS)
diff --git a/tests/bindings/googlepb/test_vs_proto2.cc b/tests/bindings/googlepb/test_vs_proto2.cc
index 15a5388..6787deb 100644
--- a/tests/bindings/googlepb/test_vs_proto2.cc
+++ b/tests/bindings/googlepb/test_vs_proto2.cc
@@ -29,11 +29,11 @@
// Pull in string data from benchmarks/google_message{1,2}.dat
// (the .h files are generated with xxd).
-const char message1_data[] = {
+const unsigned char message1_data[] = {
#include "benchmarks/google_message1.h"
};
-const char message2_data[] = {
+const unsigned char message2_data[] = {
#include "benchmarks/google_message2.h"
};
@@ -124,7 +124,7 @@ int run_tests(int argc, char *argv[]) {
UPB_UNUSED(argc);
UPB_UNUSED(argv);
size_t len = sizeof(MESSAGE_DATA_IDENT);
- const char *str = MESSAGE_DATA_IDENT;
+ const char *str = (const char*)MESSAGE_DATA_IDENT;
MESSAGE_CIDENT msg1;
MESSAGE_CIDENT msg2;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback