2 Copyright 2020 Google LLC
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file or at
6 https://developers.google.com/open-source/licenses/bsd
9 #ifndef TEST_FRAMEWORK_H
10 #define TEST_FRAMEWORK_H
13 #include "reftable-error.h"
15 #define EXPECT_ERR(c) \
19 fprintf(stderr, "%s: %d: error == %d (%s), want 0\n", \
20 __FILE__, __LINE__, c, reftable_error_str(c)); \
24 #define EXPECT_STREQ(a, b) \
28 fprintf(stderr, "%s:%d: %s (%s) != %s (%s)\n", __FILE__, \
29 __LINE__, #a, a, #b, b); \
37 fprintf(stderr, "%s: %d: failed assertion %s\n", __FILE__, \
43 fprintf(stderr, "running %s\n", #f); \
47 void set_test_hash(uint8_t *p
, int i
);
49 /* Like strbuf_add, but suitable for passing to reftable_new_writer
51 ssize_t
strbuf_add_void(void *b
, const void *data
, size_t sz
);