summaryrefslogtreecommitdiff
path: root/tests/test_def.c
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2016-04-06 14:28:45 -0700
committerJosh Haberman <jhaberman@gmail.com>2016-04-06 14:28:45 -0700
commitf8c26358f0b87a9c90be3f038cdea5bdcae185a0 (patch)
treea51e3b278d368ebd4fc01b0fff68c8f3f0701299 /tests/test_def.c
parente9d79d2441732264e2b990a5b2dc76d13724db07 (diff)
Changes for PR comments.
Diffstat (limited to 'tests/test_def.c')
-rw-r--r--tests/test_def.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/tests/test_def.c b/tests/test_def.c
index 6f3fb8f..cc766e0 100644
--- a/tests/test_def.c
+++ b/tests/test_def.c
@@ -3,6 +3,7 @@
** (like attempts to link defs that don't have required properties set).
*/
+#include "tests/test_util.h"
#include "upb/def.h"
#include "upb/pb/glue.h"
#include "upb_test.h"
@@ -38,26 +39,6 @@ static void test_noreftracking() {
upb_msgdef_unref(md, &md);
}
-static char *upb_readfile(const char *filename, size_t *len) {
- long size;
- char *buf;
- FILE *f = fopen(filename, "rb");
- if(!f) return NULL;
- if(fseek(f, 0, SEEK_END) != 0) goto error;
- size = ftell(f);
- if(size < 0) goto error;
- if(fseek(f, 0, SEEK_SET) != 0) goto error;
- buf = malloc(size + 1);
- if(size && fread(buf, size, 1, f) != 1) goto error;
- fclose(f);
- if (len) *len = size;
- return buf;
-
-error:
- fclose(f);
- return NULL;
-}
-
static upb_symtab *load_test_proto(void *owner) {
upb_symtab *s = upb_symtab_new(owner);
upb_status status = UPB_STATUS_INIT;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback