diff options
Diffstat (limited to 'tests/upb_test.h')
-rw-r--r-- | tests/upb_test.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/upb_test.h b/tests/upb_test.h new file mode 100644 index 0000000..0e307c5 --- /dev/null +++ b/tests/upb_test.h @@ -0,0 +1,27 @@ +/* + * upb - a minimalist implementation of protocol buffers. + * + * Copyright (c) 2011 Joshua Haberman. See LICENSE for details. + */ + +#ifndef UPB_TEST_H_ +#define UPB_TEST_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +int num_assertions = 0; +#define ASSERT(expr) do { \ + ++num_assertions; \ + if (!(expr)) { \ + fprintf(stderr, "Assertion failed: %s:%d\n", __FILE__, __LINE__); \ + abort(); \ + } \ +} while(0) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* UPB_DECODER_H_ */ |