Permalink
Browse files
Add optional property-based tests, using theft (if available).
- Loading branch information...
Showing
with
539 additions
and
3 deletions.
-
+11
−3
Makefile
-
+7
−0
test_heatshrink_dynamic.c
-
+521
−0
test_heatshrink_dynamic_theft.c
|
|
@@ -8,16 +8,24 @@ CFLAGS += -Wmissing-prototypes |
|
|
CFLAGS += -Wstrict-prototypes
|
|
|
CFLAGS += -Wmissing-declarations
|
|
|
|
|
|
# If libtheft is available, build additional property-based tests.
|
|
|
# Uncomment these to use it in test_heatshrink_dynamic.
|
|
|
#CFLAGS += -DHEATSHRINK_HAS_THEFT
|
|
|
#LDFLAGS += -ltheft
|
|
|
|
|
|
all:
|
|
|
@echo "For tests, make test_heatshrink_dynamic (default) or change the"
|
|
|
@echo "config.h to disable static memory and build test_heatshrink_static."
|
|
|
@echo "For the standalone command-line tool, make heatshrink."
|
|
|
|
|
|
${PROJECT}: heatshrink.c
|
|
|
|
|
|
heatshrink: heatshrink_encoder.o heatshrink_decoder.o
|
|
|
test_heatshrink_dynamic: heatshrink_encoder.o heatshrink_decoder.o
|
|
|
test_heatshrink_static: heatshrink_encoder.o heatshrink_decoder.o
|
|
|
OBJS= heatshrink_encoder.o \
|
|
|
heatshrink_decoder.o \
|
|
|
|
|
|
heatshrink: ${OBJS}
|
|
|
test_heatshrink_dynamic: ${OBJS} test_heatshrink_dynamic_theft.o
|
|
|
test_heatshrink_static: ${OBJS}
|
|
|
|
|
|
*.o: Makefile heatshrink_config.h
|
|
|
|
|
|
|
|
|
@@ -14,6 +14,10 @@ SUITE(encoding); |
|
|
SUITE(decoding);
|
|
|
SUITE(integration);
|
|
|
|
|
|
#ifdef HEATSHRINK_HAS_THEFT
|
|
|
SUITE(properties);
|
|
|
#endif
|
|
|
|
|
|
static void dump_buf(char *name, uint8_t *buf, uint16_t count) {
|
|
|
for (int i=0; i<count; i++) {
|
|
|
uint8_t c = (uint8_t)buf[i];
|
|
|
@@ -988,5 +992,8 @@ int main(int argc, char **argv) { |
|
|
RUN_SUITE(encoding);
|
|
|
RUN_SUITE(decoding);
|
|
|
RUN_SUITE(integration);
|
|
|
#ifdef HEATSHRINK_HAS_THEFT
|
|
|
RUN_SUITE(properties);
|
|
|
#endif
|
|
|
GREATEST_MAIN_END(); /* display results */
|
|
|
}
|
Oops, something went wrong.
0 comments on commit
555f7cf