summaryrefslogtreecommitdiff
path: root/tests/pb
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-03-27 15:32:05 -0700
committerGitHub <noreply@github.com>2019-03-27 15:32:05 -0700
commitcf35baa1ad70f0dca734f93bcc2b54d8d059bcdd (patch)
tree3c9881fcceaba1dbb5f04fe01ddc5f2dc5c647d1 /tests/pb
parent928ef7f2c02f18d9945dd750884dffbdebef1b98 (diff)
Moved macros from upb.h to port_def.inc to avoid leaking them to users. (#160)
* Use port_def.inc to prevent macros from leaking to users. * Added helpful comments to port_def.inc/port_undef.inc.
Diffstat (limited to 'tests/pb')
-rw-r--r--tests/pb/test_decoder.cc2
-rw-r--r--tests/pb/test_encoder.cc2
-rw-r--r--tests/pb/test_varint.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/tests/pb/test_decoder.cc b/tests/pb/test_decoder.cc
index 7450445..fb69541 100644
--- a/tests/pb/test_decoder.cc
+++ b/tests/pb/test_decoder.cc
@@ -47,6 +47,8 @@
#include "upb/upb.h"
#endif // !AMALGAMATED
+#include "upb/port_def.inc"
+
#undef PRINT_FAILURE
#define PRINT_FAILURE(expr) \
fprintf(stderr, "Assertion failed: %s:%d\n", __FILE__, __LINE__); \
diff --git a/tests/pb/test_encoder.cc b/tests/pb/test_encoder.cc
index aa33370..3039767 100644
--- a/tests/pb/test_encoder.cc
+++ b/tests/pb/test_encoder.cc
@@ -6,6 +6,8 @@
#include "upb/pb/decoder.h"
#include "upb/pb/encoder.h"
+#include "upb/port_def.inc"
+
std::string read_string(const char *filename) {
size_t len;
char *str = upb_readfile(filename, &len);
diff --git a/tests/pb/test_varint.c b/tests/pb/test_varint.c
index 7b2fe41..ebee282 100644
--- a/tests/pb/test_varint.c
+++ b/tests/pb/test_varint.c
@@ -3,6 +3,8 @@
#include "upb/pb/varint.int.h"
#include "tests/upb_test.h"
+#include "upb/port_def.inc"
+
/* Test that we can round-trip from int->varint->int. */
static void test_varint_for_num(upb_decoderet (*decoder)(const char*),
uint64_t num) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback