From 6f15c0805e1e050aa5af5b02b94bd05684e11e05 Mon Sep 17 00:00:00 2001 From: Dmitrii Tikhonov Date: Thu, 20 Sep 2018 11:01:11 +0300 Subject: [PATCH 1/9] Support compiling without floating point operations --- cmp.c | 42 +++++++++++++++++++++++++++++++++++++----- cmp.h | 18 ++++++++++++++---- 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/cmp.c b/cmp.c index 89230b4..43b53e6 100644 --- a/cmp.c +++ b/cmp.c @@ -180,7 +180,8 @@ static uint64_t be64(uint64_t x) { return x; } - + +#ifndef NO_FPU static float decode_befloat(char *b) { float f = 0.; char *fb = (char *)&f; @@ -193,7 +194,7 @@ static float decode_befloat(char *b) { } return f; -} +} static double decode_bedouble(char *b) { double d = 0.; @@ -212,6 +213,7 @@ static double decode_bedouble(char *b) { return d; } +#endif // NO_FPU static bool read_byte(cmp_ctx_t *ctx, uint8_t *x) { return ctx->read(ctx, x, sizeof(uint8_t)); @@ -641,6 +643,7 @@ static bool read_obj_data(cmp_ctx_t *ctx, uint8_t type_marker, return true; case CMP_TYPE_FLOAT: { +#ifndef NO_FPU char bytes[4]; if (!ctx->read(ctx, bytes, 4)) { @@ -649,9 +652,13 @@ static bool read_obj_data(cmp_ctx_t *ctx, uint8_t type_marker, } obj->as.flt = decode_befloat(bytes); return true; +#else // NO_FPU + return false; +#endif // NO_FPU } case CMP_TYPE_DOUBLE: { +#ifndef NO_FPU char bytes[8]; if (!ctx->read(ctx, bytes, 8)) { @@ -660,6 +667,9 @@ static bool read_obj_data(cmp_ctx_t *ctx, uint8_t type_marker, } obj->as.dbl = decode_bedouble(bytes); return true; +#else // NO_FPU + return false; +#endif // NO_FPU } case CMP_TYPE_BIN8: case CMP_TYPE_BIN16: @@ -900,7 +910,8 @@ bool cmp_write_uinteger(cmp_ctx_t *ctx, uint64_t u) { return cmp_write_u64(ctx, u); } - + +#ifndef NO_FPU bool cmp_write_float(cmp_ctx_t *ctx, float f) { if (!write_type_marker(ctx, FLOAT_MARKER)) return false; @@ -952,6 +963,7 @@ bool cmp_write_decimal(cmp_ctx_t *ctx, double d) { else return cmp_write_double(ctx, d); } +#endif // NO_FPU bool cmp_write_nil(cmp_ctx_t *ctx) { return write_type_marker(ctx, NIL_MARKER); @@ -1569,9 +1581,17 @@ bool cmp_write_object(cmp_ctx_t *ctx, cmp_object_t *obj) { case CMP_TYPE_EXT32: return cmp_write_ext32_marker(ctx, obj->as.ext.type, obj->as.ext.size); case CMP_TYPE_FLOAT: +#ifndef NO_FPU return cmp_write_float(ctx, obj->as.flt); +#else // NO_FPU + return false; +#endif // NO_FPU case CMP_TYPE_DOUBLE: +#ifndef NO_FPU return cmp_write_double(ctx, obj->as.dbl); +#else // NO_FPU + return false; +#endif case CMP_TYPE_UINT8: return cmp_write_u8(ctx, obj->as.u8); case CMP_TYPE_UINT16: @@ -1645,9 +1665,17 @@ bool cmp_write_object_v4(cmp_ctx_t *ctx, cmp_object_t *obj) { case CMP_TYPE_EXT32: return cmp_write_ext32_marker(ctx, obj->as.ext.type, obj->as.ext.size); case CMP_TYPE_FLOAT: +#ifndef NO_FPU return cmp_write_float(ctx, obj->as.flt); +#else // NO_FPU + return false; +#endif case CMP_TYPE_DOUBLE: +#ifndef NO_FPU return cmp_write_double(ctx, obj->as.dbl); +#else + return false; +#endif case CMP_TYPE_UINT8: return cmp_write_u8(ctx, obj->as.u8); case CMP_TYPE_UINT16: @@ -2170,7 +2198,8 @@ bool cmp_read_ulong(cmp_ctx_t *ctx, uint64_t *u) { bool cmp_read_uinteger(cmp_ctx_t *ctx, uint64_t *d) { return cmp_read_ulong(ctx, d); } - + +#ifndef NO_FPU bool cmp_read_float(cmp_ctx_t *ctx, float *f) { cmp_object_t obj; @@ -2221,6 +2250,7 @@ bool cmp_read_decimal(cmp_ctx_t *ctx, double *d) { return false; } } +#endif // NO_FPU bool cmp_read_nil(cmp_ctx_t *ctx) { cmp_object_t obj; @@ -3198,7 +3228,8 @@ bool cmp_object_as_ulong(cmp_object_t *obj, uint64_t *u) { bool cmp_object_as_uinteger(cmp_object_t *obj, uint64_t *d) { return cmp_object_as_ulong(obj, d); } - + +#ifndef NO_FPU bool cmp_object_as_float(cmp_object_t *obj, float *f) { if (obj->type == CMP_TYPE_FLOAT) { *f = obj->as.flt; @@ -3216,6 +3247,7 @@ bool cmp_object_as_double(cmp_object_t *obj, double *d) { return false; } +#endif // NO_FPU bool cmp_object_as_bool(cmp_object_t *obj, bool *b) { if (obj->type == CMP_TYPE_BOOLEAN) { diff --git a/cmp.h b/cmp.h index c78b37b..f9750c8 100644 --- a/cmp.h +++ b/cmp.h @@ -85,8 +85,10 @@ union cmp_object_data_u { int16_t s16; int32_t s32; int64_t s64; +#ifndef NO_FPU float flt; double dbl; +#endif // NO_FPU uint32_t array_size; uint32_t map_size; uint32_t str_size; @@ -146,12 +148,14 @@ bool cmp_write_integer(cmp_ctx_t *ctx, int64_t d); /* Writes an unsigned integer to the backend */ bool cmp_write_uinteger(cmp_ctx_t *ctx, uint64_t u); - + +#ifndef NO_FPU /* * Writes a floating-point value (either single or double-precision) to the * backend */ bool cmp_write_decimal(cmp_ctx_t *ctx, double d); +#endif // NO_FPU /* Writes NULL to the backend */ bool cmp_write_nil(cmp_ctx_t *ctx); @@ -264,12 +268,14 @@ bool cmp_read_ulong(cmp_ctx_t *ctx, uint64_t *u); /* Reads an unsigned integer */ bool cmp_read_uinteger(cmp_ctx_t *ctx, uint64_t *u); - + +#ifndef NO_FPU /* * Reads a floating point value (either single or double-precision) from the * backend */ bool cmp_read_decimal(cmp_ctx_t *ctx, double *d); +#endif // NO_FPU /* "Reads" (more like "skips") a NULL value from the backend */ bool cmp_read_nil(cmp_ctx_t *ctx); @@ -371,9 +377,11 @@ bool cmp_write_u8(cmp_ctx_t *ctx, uint8_t c); bool cmp_write_u16(cmp_ctx_t *ctx, uint16_t s); bool cmp_write_u32(cmp_ctx_t *ctx, uint32_t i); bool cmp_write_u64(cmp_ctx_t *ctx, uint64_t l); - + +#ifndef NO_FPU bool cmp_write_float(cmp_ctx_t *ctx, float f); bool cmp_write_double(cmp_ctx_t *ctx, double d); +#endif // NO_FPU bool cmp_write_fixstr_marker(cmp_ctx_t *ctx, uint8_t size); bool cmp_write_fixstr(cmp_ctx_t *ctx, const char *data, uint8_t size); @@ -434,9 +442,11 @@ bool cmp_read_u8(cmp_ctx_t *ctx, uint8_t *c); bool cmp_read_u16(cmp_ctx_t *ctx, uint16_t *s); bool cmp_read_u32(cmp_ctx_t *ctx, uint32_t *i); bool cmp_read_u64(cmp_ctx_t *ctx, uint64_t *l); - + +#ifndef NO_FPU bool cmp_read_float(cmp_ctx_t *ctx, float *f); bool cmp_read_double(cmp_ctx_t *ctx, double *d); +#endif // NO_FPU bool cmp_read_fixext1_marker(cmp_ctx_t *ctx, int8_t *type); bool cmp_read_fixext1(cmp_ctx_t *ctx, int8_t *type, void *data); From bf5bc1ad215a38906d7e371695bbce4cf789ea58 Mon Sep 17 00:00:00 2001 From: sc07sap <55979405+sc07sap@users.noreply.github.com> Date: Mon, 30 Sep 2019 13:29:06 +0300 Subject: [PATCH 2/9] CMake support added --- CMakeLIsts.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 CMakeLIsts.txt diff --git a/CMakeLIsts.txt b/CMakeLIsts.txt new file mode 100644 index 0000000..b5896eb --- /dev/null +++ b/CMakeLIsts.txt @@ -0,0 +1,9 @@ +# Edit following two lines to set component requirements (see docs) +set(COMPONENT_REQUIRES ) +set(COMPONENT_PRIV_REQUIRES ) + +set(COMPONENT_SRCS "cmp.c" ) +set(COMPONENT_ADD_INCLUDEDIRS ".") + + +register_component() From 1f1cd7791bf6ffc2bbe4608734cf6d69498ef8ef Mon Sep 17 00:00:00 2001 From: sc07sap <55979405+sc07sap@users.noreply.github.com> Date: Mon, 30 Sep 2019 13:32:09 +0300 Subject: [PATCH 3/9] Removed unused lines --- CMakeLIsts.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CMakeLIsts.txt b/CMakeLIsts.txt index b5896eb..d758bac 100644 --- a/CMakeLIsts.txt +++ b/CMakeLIsts.txt @@ -1,9 +1,4 @@ # Edit following two lines to set component requirements (see docs) -set(COMPONENT_REQUIRES ) -set(COMPONENT_PRIV_REQUIRES ) - set(COMPONENT_SRCS "cmp.c" ) set(COMPONENT_ADD_INCLUDEDIRS ".") - - register_component() From 3d67b3a448312a9329cc23c51e4fb27ae8db5115 Mon Sep 17 00:00:00 2001 From: Charlie Gunyon Date: Sun, 6 Sep 2020 21:44:22 -0400 Subject: [PATCH 4/9] Extend floating point omissions and update tests --- Makefile | 27 +++++++++--- README.md | 5 +++ cmp.c | 64 +++++++++++++++------------ cmp.h | 30 ++++++------- test/buf.c | 4 ++ test/buf.h | 4 ++ test/test.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 7 files changed, 202 insertions(+), 53 deletions(-) diff --git a/Makefile b/Makefile index b108de0..d7df64c 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ CC ?= gcc CLANG ?= clang CFLAGS ?= -Werror -Wall -Wextra -funsigned-char -fwrapv -Wconversion -Wno-sign-conversion -Wmissing-format-attribute -Wpointer-arith -Wformat-nonliteral -Winit-self -Wwrite-strings -Wshadow -Wenum-compare -Wempty-body -Wparentheses -Wcast-align -Wstrict-aliasing --pedantic-errors -CMPCFLAGS ?= -std=c89 +CMPCFLAGS ?= -std=c89 -Wno-c99-extensions TESTCFLAGS ?= -std=c99 -Wno-error=deprecated-declarations -Wno-deprecated-declarations -O0 +NOFPUTESTCFLAGS ?= $(TESTCFLAGS) -DCMP_NO_FLOAT ADDRCFLAGS ?= -fsanitize=address MEMCFLAGS ?= -fsanitize=memory -fno-omit-frame-pointer -fno-optimize-sibling-calls @@ -13,7 +14,7 @@ UBCFLAGS ?= -fsanitize=undefined all: cmptest example1 example2 -test: addrtest memtest ubtest unittest +test: addrtest memtest ubtest unittest nofpucmptest unittest: cmptest @./cmptest @@ -27,23 +28,35 @@ memtest: cmpmemtest ubtest: cmpubtest @./cmpubtest +nofloattest: cmpnofloattest + @./cmpnofloattest + cmp.o: $(CC) $(CFLAGS) $(CMPCFLAGS) -fprofile-arcs -ftest-coverage -g -I. -c cmp.c cmptest: cmp.o - $(CC) $(CFLAGS) $(TESTCFLAGS) -fprofile-arcs -ftest-coverage -g -I. -o cmptest cmp.o test/test.c test/buf.c test/utils.c -lcmocka + $(CC) $(CFLAGS) $(TESTCFLAGS) -fprofile-arcs -ftest-coverage -g -I. \ + -o cmptest cmp.o test/test.c test/buf.c test/utils.c -lcmocka + +cmpnofloattest: cmp.o + $(CC) $(CFLAGS) $(NOFPUTESTCFLAGS) -fprofile-arcs -ftest-coverage -g -I. \ + -o cmpnofloattest cmp.o test/test.c test/buf.c test/utils.c -lcmocka clangcmp.o: - $(CLANG) $(CFLAGS) $(CMPCFLAGS) -fprofile-arcs -ftest-coverage -g -I. -c cmp.c -o clangcmp.o + $(CLANG) $(CFLAGS) $(CMPCFLAGS) -fprofile-arcs -ftest-coverage -g -I. \ + -c cmp.c -o clangcmp.o cmpaddrtest: clangcmp.o clean - $(CLANG) $(CFLAGS) $(TESTCFLAGS) $(ADDRCFLAGS) -I. -o cmpaddrtest cmp.c test/test.c test/buf.c test/utils.c -lcmocka + $(CLANG) $(CFLAGS) $(TESTCFLAGS) $(ADDRCFLAGS) -I. -o cmpaddrtest cmp.c \ + test/test.c test/buf.c test/utils.c -lcmocka cmpmemtest: clangcmp.o clean - $(CLANG) $(CFLAGS) $(TESTCFLAGS) $(MEMCFLAGS) -I. -o cmpmemtest cmp.c test/test.c test/buf.c test/utils.c -lcmocka + $(CLANG) $(CFLAGS) $(TESTCFLAGS) $(MEMCFLAGS) -I. -o cmpmemtest cmp.c \ + test/test.c test/buf.c test/utils.c -lcmocka cmpubtest: clangcmp.o clean - $(CLANG) $(CFLAGS) $(TESTCFLAGS) $(UBCFLAGS) -I. -o cmpubtest cmp.c test/test.c test/buf.c test/utils.c -lcmocka + $(CLANG) $(CFLAGS) $(TESTCFLAGS) $(UBCFLAGS) -I. -o cmpubtest cmp.c \ + test/test.c test/buf.c test/utils.c -lcmocka example1: $(CC) $(CFLAGS) --std=c89 -O3 -I. -o example1 cmp.c examples/example1.c diff --git a/README.md b/README.md index a8858e2..b1c64d6 100644 --- a/README.md +++ b/README.md @@ -204,3 +204,8 @@ Use these functions in lieu of their v5 counterparts: - `cmp_write_str_v4` instead of `cmp_write_str` - `cmp_write_object_v4` instead of `cmp_write_object` +## Disabling Floating Point Operations + +Thanks to [tdragon](https://github.com/tdragon) it's possible to disable +floating point operations in CMP by defining `CMP_NO_FLOAT`. No floating point +functionality will be included. Fair warning: this changes the ABI. diff --git a/cmp.c b/cmp.c index ccf2e7e..9ffe7bb 100644 --- a/cmp.c +++ b/cmp.c @@ -95,6 +95,7 @@ enum { LENGTH_WRITING_ERROR, SKIP_DEPTH_LIMIT_EXCEEDED_ERROR, INTERNAL_ERROR, + DISABLED_FLOATING_POINT_ERROR, ERROR_MAX }; @@ -117,6 +118,7 @@ const char *cmp_error_messages[ERROR_MAX + 1] = { "Error writing size", "Depth limit exceeded while skipping", "Internal error", + "Floating point operations disabled", "Max Error" }; @@ -180,8 +182,8 @@ static uint64_t be64(uint64_t x) { return x; } - -#ifndef NO_FPU + +#ifndef CMP_NO_FLOAT static float decode_befloat(char *b) { float f = 0.; char *fb = (char *)&f; @@ -194,7 +196,7 @@ static float decode_befloat(char *b) { } return f; -} +} static double decode_bedouble(char *b) { double d = 0.; @@ -213,7 +215,7 @@ static double decode_bedouble(char *b) { return d; } -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ static bool read_byte(cmp_ctx_t *ctx, uint8_t *x) { return ctx->read(ctx, x, sizeof(uint8_t)); @@ -643,7 +645,7 @@ static bool read_obj_data(cmp_ctx_t *ctx, uint8_t type_marker, return true; case CMP_TYPE_FLOAT: { -#ifndef NO_FPU +#ifndef CMP_NO_FLOAT char bytes[4]; if (!ctx->read(ctx, bytes, 4)) { @@ -652,13 +654,14 @@ static bool read_obj_data(cmp_ctx_t *ctx, uint8_t type_marker, } obj->as.flt = decode_befloat(bytes); return true; -#else // NO_FPU +#else /* CMP_NO_FLOAT */ + ctx->error = DISABLED_FLOATING_POINT_ERROR; return false; -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ } case CMP_TYPE_DOUBLE: { -#ifndef NO_FPU +#ifndef CMP_NO_FLOAT char bytes[8]; if (!ctx->read(ctx, bytes, 8)) { @@ -667,9 +670,10 @@ static bool read_obj_data(cmp_ctx_t *ctx, uint8_t type_marker, } obj->as.dbl = decode_bedouble(bytes); return true; -#else // NO_FPU +#else /* CMP_NO_FLOAT */ + ctx->error = DISABLED_FLOATING_POINT_ERROR; return false; -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ } case CMP_TYPE_BIN8: case CMP_TYPE_BIN16: @@ -910,8 +914,8 @@ bool cmp_write_uinteger(cmp_ctx_t *ctx, uint64_t u) { return cmp_write_u64(ctx, u); } - -#ifndef NO_FPU + +#ifndef CMP_NO_FLOAT bool cmp_write_float(cmp_ctx_t *ctx, float f) { if (!write_type_marker(ctx, FLOAT_MARKER)) return false; @@ -963,7 +967,7 @@ bool cmp_write_decimal(cmp_ctx_t *ctx, double d) { else return cmp_write_double(ctx, d); } -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ bool cmp_write_nil(cmp_ctx_t *ctx) { return write_type_marker(ctx, NIL_MARKER); @@ -1581,15 +1585,17 @@ bool cmp_write_object(cmp_ctx_t *ctx, cmp_object_t *obj) { case CMP_TYPE_EXT32: return cmp_write_ext32_marker(ctx, obj->as.ext.type, obj->as.ext.size); case CMP_TYPE_FLOAT: -#ifndef NO_FPU +#ifndef CMP_NO_FLOAT return cmp_write_float(ctx, obj->as.flt); -#else // NO_FPU +#else /* CMP_NO_FLOAT */ + ctx->error = DISABLED_FLOATING_POINT_ERROR; return false; -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ case CMP_TYPE_DOUBLE: -#ifndef NO_FPU +#ifndef CMP_NO_FLOAT return cmp_write_double(ctx, obj->as.dbl); -#else // NO_FPU +#else /* CMP_NO_FLOAT */ + ctx->error = DISABLED_FLOATING_POINT_ERROR; return false; #endif case CMP_TYPE_UINT8: @@ -1665,15 +1671,17 @@ bool cmp_write_object_v4(cmp_ctx_t *ctx, cmp_object_t *obj) { case CMP_TYPE_EXT32: return cmp_write_ext32_marker(ctx, obj->as.ext.type, obj->as.ext.size); case CMP_TYPE_FLOAT: -#ifndef NO_FPU +#ifndef CMP_NO_FLOAT return cmp_write_float(ctx, obj->as.flt); -#else // NO_FPU - return false; +#else /* CMP_NO_FLOAT */ + ctx->error = DISABLED_FLOATING_POINT_ERROR; + return false; #endif case CMP_TYPE_DOUBLE: -#ifndef NO_FPU +#ifndef CMP_NO_FLOAT return cmp_write_double(ctx, obj->as.dbl); #else + ctx->error = DISABLED_FLOATING_POINT_ERROR; return false; #endif case CMP_TYPE_UINT8: @@ -2198,8 +2206,8 @@ bool cmp_read_ulong(cmp_ctx_t *ctx, uint64_t *u) { bool cmp_read_uinteger(cmp_ctx_t *ctx, uint64_t *d) { return cmp_read_ulong(ctx, d); } - -#ifndef NO_FPU + +#ifndef CMP_NO_FLOAT bool cmp_read_float(cmp_ctx_t *ctx, float *f) { cmp_object_t obj; @@ -2250,7 +2258,7 @@ bool cmp_read_decimal(cmp_ctx_t *ctx, double *d) { return false; } } -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ bool cmp_read_nil(cmp_ctx_t *ctx) { cmp_object_t obj; @@ -3371,8 +3379,8 @@ bool cmp_object_as_ulong(cmp_object_t *obj, uint64_t *u) { bool cmp_object_as_uinteger(cmp_object_t *obj, uint64_t *d) { return cmp_object_as_ulong(obj, d); } - -#ifndef NO_FPU + +#ifndef CMP_NO_FLOAT bool cmp_object_as_float(cmp_object_t *obj, float *f) { if (obj->type == CMP_TYPE_FLOAT) { *f = obj->as.flt; @@ -3390,7 +3398,7 @@ bool cmp_object_as_double(cmp_object_t *obj, double *d) { return false; } -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ bool cmp_object_as_bool(cmp_object_t *obj, bool *b) { if (obj->type == CMP_TYPE_BOOLEAN) { diff --git a/cmp.h b/cmp.h index 0332f4f..9c253c5 100644 --- a/cmp.h +++ b/cmp.h @@ -85,10 +85,10 @@ union cmp_object_data_u { int16_t s16; int32_t s32; int64_t s64; -#ifndef NO_FPU +#ifndef CMP_NO_FLOAT float flt; double dbl; -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ uint32_t array_size; uint32_t map_size; uint32_t str_size; @@ -148,14 +148,14 @@ bool cmp_write_integer(cmp_ctx_t *ctx, int64_t d); /* Writes an unsigned integer to the backend */ bool cmp_write_uinteger(cmp_ctx_t *ctx, uint64_t u); - -#ifndef NO_FPU + /* * Writes a floating-point value (either single or double-precision) to the * backend */ +#ifndef CMP_NO_FLOAT bool cmp_write_decimal(cmp_ctx_t *ctx, double d); -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ /* Writes NULL to the backend */ bool cmp_write_nil(cmp_ctx_t *ctx); @@ -268,14 +268,14 @@ bool cmp_read_ulong(cmp_ctx_t *ctx, uint64_t *u); /* Reads an unsigned integer */ bool cmp_read_uinteger(cmp_ctx_t *ctx, uint64_t *u); - -#ifndef NO_FPU + /* * Reads a floating point value (either single or double-precision) from the * backend */ +#ifndef CMP_NO_FLOAT bool cmp_read_decimal(cmp_ctx_t *ctx, double *d); -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ /* "Reads" (more like "skips") a NULL value from the backend */ bool cmp_read_nil(cmp_ctx_t *ctx); @@ -333,7 +333,7 @@ bool cmp_skip_object(cmp_ctx_t *ctx, cmp_object_t *obj); /* * This is similar to `cmp_skip_object_flat`, except it tolerates flat arrays - * and maps. If when skipping such an array or map this function encounteres + * and maps. If when skipping such an array or map this function encounters * another array/map, it will: * - If `obj` is not `NULL`, fill in `obj` with that (nested) object * - Set `ctx->error` to `SKIP_DEPTH_LIMIT_EXCEEDED_ERROR` @@ -406,11 +406,11 @@ bool cmp_write_u8(cmp_ctx_t *ctx, uint8_t c); bool cmp_write_u16(cmp_ctx_t *ctx, uint16_t s); bool cmp_write_u32(cmp_ctx_t *ctx, uint32_t i); bool cmp_write_u64(cmp_ctx_t *ctx, uint64_t l); - -#ifndef NO_FPU + +#ifndef CMP_NO_FLOAT bool cmp_write_float(cmp_ctx_t *ctx, float f); bool cmp_write_double(cmp_ctx_t *ctx, double d); -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ bool cmp_write_fixstr_marker(cmp_ctx_t *ctx, uint8_t size); bool cmp_write_fixstr(cmp_ctx_t *ctx, const char *data, uint8_t size); @@ -471,11 +471,11 @@ bool cmp_read_u8(cmp_ctx_t *ctx, uint8_t *c); bool cmp_read_u16(cmp_ctx_t *ctx, uint16_t *s); bool cmp_read_u32(cmp_ctx_t *ctx, uint32_t *i); bool cmp_read_u64(cmp_ctx_t *ctx, uint64_t *l); - -#ifndef NO_FPU + +#ifndef CMP_NO_FLOAT bool cmp_read_float(cmp_ctx_t *ctx, float *f); bool cmp_read_double(cmp_ctx_t *ctx, double *d); -#endif // NO_FPU +#endif /* CMP_NO_FLOAT */ bool cmp_read_fixext1_marker(cmp_ctx_t *ctx, int8_t *type); bool cmp_read_fixext1(cmp_ctx_t *ctx, int8_t *type, void *data); diff --git a/test/buf.c b/test/buf.c index b0d1611..580c186 100644 --- a/test/buf.c +++ b/test/buf.c @@ -303,6 +303,7 @@ void M_BufferWriteULongs(buf_t *buf, const uint64_t *ulongs, size_t count) { M_BufferWriteChars(buf, (char *)ulongs, count * sizeof(uint64_t)); } +#ifndef CMP_NO_FLOAT void M_BufferWriteFloat(buf_t *buf, float f) { M_BufferWriteFloats(buf, &f, 1); } @@ -320,6 +321,7 @@ void M_BufferWriteDoubles(buf_t *buf, const double *doubles, size_t count) { M_BufferEnsureCapacity(buf, count * sizeof(double)); M_BufferWriteChars(buf, (char *)doubles, count * sizeof(doubles)); } +#endif void M_BufferWriteString(buf_t *buf, const char *string, size_t length) { M_BufferEnsureCapacity(buf, length + 1); @@ -441,6 +443,7 @@ bool M_BufferReadULongs(buf_t *buf, uint64_t *l, size_t count) { return M_BufferRead(buf, l, count * sizeof(uint64_t)); } +#ifndef CMP_NO_FLOAT bool M_BufferReadFloat(buf_t *buf, float *f) { return M_BufferReadFloats(buf, f, 1); } @@ -456,6 +459,7 @@ bool M_BufferReadDouble(buf_t *buf, double *d) { bool M_BufferReadDoubles(buf_t *buf, double *d, size_t count) { return M_BufferRead(buf, d, count * sizeof(double)); } +#endif bool M_BufferReadString(buf_t *buf, char *s, size_t length) { return M_BufferRead(buf, s, length); diff --git a/test/buf.h b/test/buf.h index a2c6d1a..cec9197 100644 --- a/test/buf.h +++ b/test/buf.h @@ -82,10 +82,12 @@ void M_BufferWriteLong(buf_t *buf, int64_t l); void M_BufferWriteLongs(buf_t *buf, const int64_t *longs, size_t count); void M_BufferWriteULong(buf_t *buf, uint64_t l); void M_BufferWriteULongs(buf_t *buf, const uint64_t *longs, size_t count); +#ifndef CMP_NO_FLOAT void M_BufferWriteFloat(buf_t *buf, float f); void M_BufferWriteFloats(buf_t *buf, const float *floats, size_t count); void M_BufferWriteDouble(buf_t *buf, double d); void M_BufferWriteDoubles(buf_t *buf, const double *doubles, size_t count); +#endif void M_BufferWriteString(buf_t *buf, const char *string, size_t length); void M_BufferWriteZeros(buf_t *buf, size_t count); @@ -111,10 +113,12 @@ bool M_BufferReadLong(buf_t *buf, int64_t *l); bool M_BufferReadLongs(buf_t *buf, int64_t *l, size_t count); bool M_BufferReadULong(buf_t *buf, uint64_t *l); bool M_BufferReadULongs(buf_t *buf, uint64_t *l, size_t count); +#ifndef CMP_NO_FLOAT bool M_BufferReadFloat(buf_t *buf, float *f); bool M_BufferReadFloats(buf_t *buf, float *f, size_t count); bool M_BufferReadDouble(buf_t *buf, double *d); bool M_BufferReadDoubles(buf_t *buf, double *d, size_t count); +#endif bool M_BufferReadString(buf_t *buf, char *s, size_t length); bool M_BufferReadStringDup(buf_t *buf, char **s); bool M_BufferCopyString(buf_t *dst, buf_t *src); diff --git a/test/test.c b/test/test.c index 7d56155..74fe864 100644 --- a/test/test.c +++ b/test/test.c @@ -40,11 +40,19 @@ static int reader_successes = -1; static int writer_successes = -1; static int skipper_successes = -1; +#ifndef CMP_NO_FLOAT + +#ifndef assert_float_equal #define assert_float_equal(f1, f2) \ assert_memory_equal(&(f1), &(f2), sizeof(float)) +#endif +#ifndef assert_double_equal #define assert_double_equal(d1, d2) \ assert_memory_equal(&(d1), &(d2), sizeof(double)) +#endif + +#endif #define test_format(wfunc, rfunc, otype, ctype, in, fmt, dlen) do { \ M_BufferClear(&buf); \ @@ -93,6 +101,7 @@ static int skipper_successes = -1; assert_int_equal(in, value); \ } while (0) +#ifndef CMP_NO_FLOAT #define test_float_format(wfunc, rfunc, otype, ctype, in, fmt, len) do { \ ctype value; \ M_BufferSeek(&buf, 0); \ @@ -118,6 +127,7 @@ static int skipper_successes = -1; assert_true(rfunc(&cmp, &value)); \ assert_true(in == value); \ } while (0) +#endif #define test_format_no_input(wfunc, otype, fmt, dlen, out) do { \ M_BufferClear(&buf); \ @@ -467,8 +477,11 @@ static void test_numbers(void **state) { int16_t s16; int32_t s32; int64_t s64; + +#ifndef CMP_NO_FLOAT float f; double d; +#endif (void)state; @@ -1738,6 +1751,7 @@ static void test_numbers(void **state) { 9 ); +#ifndef CMP_NO_FLOAT test_float_format( cmp_write_float, cmp_read_float, @@ -1903,6 +1917,7 @@ static void test_numbers(void **state) { "\xcb\x43\x0f\x94\x65\xb8\xab\x8e\x39", 9 ); +#endif M_BufferSeek(&buf, 0); assert_true(cmp_write_sfix(&cmp, 1)); @@ -1966,6 +1981,7 @@ static void test_numbers(void **state) { M_BufferSeek(&buf, 0); assert_true(cmp_read_s64(&cmp, &s64)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_true(cmp_write_float(&cmp, 1.1f)); M_BufferSeek(&buf, 0); @@ -1975,6 +1991,7 @@ static void test_numbers(void **state) { assert_true(cmp_write_double(&cmp, 1.1)); M_BufferSeek(&buf, 0); assert_true(cmp_read_double(&cmp, &d)); +#endif M_BufferClear(&buf); assert_true(cmp_write_s8(&cmp, -1)); @@ -2002,8 +2019,10 @@ static void test_numbers(void **state) { assert_true(cmp_write_u64(&cmp, 0x7FFFFFFFFFFFFFFC)); assert_true(cmp_write_u64(&cmp, 0x800000000000000C)); +#ifndef CMP_NO_FLOAT assert_true(cmp_write_decimal(&cmp, 1.1f)); assert_true(cmp_write_decimal(&cmp, 1.1)); +#endif M_BufferSeek(&buf, 0); assert_true(cmp_read_char(&cmp, &s8)); @@ -2141,8 +2160,10 @@ static void test_numbers(void **state) { assert_true(cmp_read_ulong(&cmp, &u64)); assert_true(cmp_read_ulong(&cmp, &u64)); +#ifndef CMP_NO_FLOAT assert_true(cmp_read_decimal(&cmp, &d)); assert_true(cmp_read_decimal(&cmp, &d)); +#endif reader_successes = 0; M_BufferSeek(&buf, 0); @@ -2161,10 +2182,13 @@ static void test_numbers(void **state) { assert_false(cmp_read_long(&cmp, &s64)); M_BufferSeek(&buf, 0); assert_false(cmp_read_ulong(&cmp, &u64)); + +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_false(cmp_read_decimal(&cmp, &d)); M_BufferSeek(&buf, 0); assert_false(cmp_read_decimal(&cmp, &d)); +#endif reader_successes = -1; @@ -2198,8 +2222,10 @@ static void test_numbers(void **state) { M_BufferSeek(&buf, 0); assert_false(cmp_read_long(&cmp, &s64)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_false(cmp_read_decimal(&cmp, &d)); +#endif M_BufferSeek(&buf, 0); assert_true(cmp_read_ulong(&cmp, &u64)); @@ -2363,8 +2389,10 @@ static void test_conversions(void **state) { uint32_t u32; uint64_t u64; bool b; +#ifndef CMP_NO_FLOAT float f; double d; +#endif (void)state; @@ -2379,8 +2407,10 @@ static void test_conversions(void **state) { assert_false(cmp_object_as_ushort(&obj, &u16)); assert_false(cmp_object_as_uint(&obj, &u32)); assert_false(cmp_object_as_ulong(&obj, &u64)); +#ifndef CMP_NO_FLOAT assert_false(cmp_object_as_float(&obj, &f)); assert_false(cmp_object_as_double(&obj, &d)); +#endif assert_false(cmp_object_as_bool(&obj, &b)); assert_false(cmp_object_as_str(&obj, &u32)); assert_false(cmp_object_as_bin(&obj, &u32)); @@ -3424,8 +3454,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3447,8 +3479,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3470,8 +3504,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3498,8 +3534,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3521,8 +3559,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_int, "int"); obj_test_not(cmp_object_is_long, "long"); obj_test_not(cmp_object_is_sinteger, "sinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3546,8 +3586,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_int, "int"); obj_test_not(cmp_object_is_long, "long"); obj_test_not(cmp_object_is_sinteger, "sinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3571,8 +3613,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_long, "long"); obj_test_not(cmp_object_is_sinteger, "sinteger"); obj_test_not(cmp_object_is_uchar, "uchar"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3599,8 +3643,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_long, "long"); obj_test_not(cmp_object_is_sinteger, "sinteger"); obj_test_not(cmp_object_is_uchar, "uchar"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3626,8 +3672,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_sinteger, "sinteger"); obj_test_not(cmp_object_is_uchar, "uchar"); obj_test_not(cmp_object_is_ushort, "ushort"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3657,8 +3705,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_sinteger, "sinteger"); obj_test_not(cmp_object_is_uchar, "uchar"); obj_test_not(cmp_object_is_ushort, "ushort"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3686,8 +3736,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uchar, "uchar"); obj_test_not(cmp_object_is_ushort, "ushort"); obj_test_not(cmp_object_is_uint, "uint"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); @@ -3696,6 +3748,7 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_map, "map"); obj_test_not(cmp_object_is_ext, "ext"); +#ifndef CMP_NO_FLOAT obj_write(cmp_write_float, 1.f); obj_test(cmp_object_is_float, cmp_object_as_float, "float", float, 1.f); obj_test_not(cmp_object_is_char, "char"); @@ -3737,6 +3790,7 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_array, "array"); obj_test_not(cmp_object_is_map, "map"); obj_test_not(cmp_object_is_ext, "ext"); +#endif obj_write_no_val(cmp_write_nil); obj_test_no_read(cmp_object_is_nil, "nil"); @@ -3750,8 +3804,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "str"); obj_test_not(cmp_object_is_bin, "bin"); @@ -3771,8 +3827,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_str, "str"); obj_test_not(cmp_object_is_bin, "bin"); @@ -3792,8 +3850,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_str, "str"); obj_test_not(cmp_object_is_bin, "bin"); @@ -3813,8 +3873,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_str, "str"); obj_test_not(cmp_object_is_bin, "bin"); @@ -3834,8 +3896,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_str, "str"); obj_test_not(cmp_object_is_bin, "bin"); @@ -3855,8 +3919,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_bin, "bin"); @@ -3877,8 +3943,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_bin, "bin"); @@ -3899,8 +3967,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "string"); @@ -3920,8 +3990,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "string"); @@ -3929,9 +4001,6 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_map, "map"); obj_test_not(cmp_object_is_ext, "ext"); - - - M_BufferSeek(&buf, 0); cmp_write_array(&cmp, 2); cmp_write_uint(&cmp, 1); @@ -3949,8 +4018,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "string"); @@ -3975,8 +4046,10 @@ static void test_obj(void **state) { obj_test_not(cmp_object_is_uint, "uint"); obj_test_not(cmp_object_is_ulong, "ulong"); obj_test_not(cmp_object_is_uinteger, "uinteger"); +#ifndef CMP_NO_FLOAT obj_test_not(cmp_object_is_float, "float"); obj_test_not(cmp_object_is_double, "double"); +#endif obj_test_not(cmp_object_is_nil, "nil"); obj_test_not(cmp_object_is_bool, "bool"); obj_test_not(cmp_object_is_str, "string"); @@ -4043,6 +4116,8 @@ static void test_obj(void **state) { obj.as.s64 = 0x100000002; assert_true(cmp_write_object(&cmp, &obj)); assert_true(cmp_write_object_v4(&cmp, &obj)); + +#ifndef CMP_NO_FLOAT obj.type = CMP_TYPE_FLOAT; obj.as.flt = 1.1f; assert_true(cmp_write_object(&cmp, &obj)); @@ -4051,6 +4126,7 @@ static void test_obj(void **state) { obj.as.dbl = 1.1; assert_true(cmp_write_object(&cmp, &obj)); assert_true(cmp_write_object_v4(&cmp, &obj)); +#endif obj.type = CMP_TYPE_BIN8; obj.as.bin_size = 1; @@ -4149,6 +4225,7 @@ static void test_obj(void **state) { } /* Thanks to andreyvps for this test */ +#ifndef CMP_NO_FLOAT void test_float_flip(void **state) { buf_t buf; cmp_ctx_t cmp; @@ -4215,6 +4292,7 @@ void test_float_flip(void **state) { teardown_cmp_and_buf(&cmp, &buf); } +#endif void test_skipping(void **state) { buf_t buf; @@ -4445,8 +4523,10 @@ void test_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_MAP32); M_BufferClear(&buf); +#ifndef CMP_NO_FLOAT assert_true(cmp_write_float(&cmp, 1.1f)); assert_true(cmp_write_double(&cmp, 1.1)); +#endif assert_true(cmp_write_fixext1(&cmp, 1, "C")); assert_true(cmp_write_fixext2(&cmp, 2, "CC")); assert_true(cmp_write_fixext4(&cmp, 3, "CCCC")); @@ -4458,6 +4538,7 @@ void test_skipping(void **state) { assert_true(cmp_write_nil(&cmp)); assert_true(cmp_write_array32(&cmp, 4)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_FLOAT); @@ -4466,6 +4547,7 @@ void test_skipping(void **state) { assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_DOUBLE); +#endif M_BufferSeek(&buf, 0); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4747,8 +4829,10 @@ void test_deprecated_limited_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_MAP32); M_BufferClear(&buf); +#ifndef CMP_NO_FLOAT assert_true(cmp_write_float(&cmp, 1.1f)); assert_true(cmp_write_double(&cmp, 1.1)); +#endif assert_true(cmp_write_fixext1(&cmp, 1, "C")); assert_true(cmp_write_fixext2(&cmp, 2, "CC")); assert_true(cmp_write_fixext4(&cmp, 3, "CCCC")); @@ -4760,6 +4844,7 @@ void test_deprecated_limited_skipping(void **state) { assert_true(cmp_write_nil(&cmp)); assert_true(cmp_write_array32(&cmp, 4)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_FLOAT); @@ -4768,6 +4853,7 @@ void test_deprecated_limited_skipping(void **state) { assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_DOUBLE); +#endif M_BufferSeek(&buf, 0); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4899,8 +4985,10 @@ void test_errors(void **state) { int16_t s16; int32_t s32; int64_t s64; +#ifndef CMP_NO_FLOAT float f; double d; +#endif uint32_t size; int8_t type; @@ -4935,8 +5023,10 @@ void test_errors(void **state) { assert_true(cmp_write_integer(&cmp, -200)); assert_true(cmp_write_integer(&cmp, -33000)); assert_true(cmp_write_integer(&cmp, 0x80000002)); +#ifndef CMP_NO_FLOAT assert_true(cmp_write_float(&cmp, 1.1f)); assert_true(cmp_write_double(&cmp, 1.1)); +#endif assert_true(cmp_write_map(&cmp, 1)); assert_true(cmp_write_str(&cmp, "a", 1)); assert_true(cmp_write_str(&cmp, "apple", 5)); @@ -4992,8 +5082,10 @@ void test_errors(void **state) { assert_false(cmp_write_integer(&cmp, -200)); assert_false(cmp_write_integer(&cmp, -33000)); assert_false(cmp_write_integer(&cmp, 0x80000002)); +#ifndef CMP_NO_FLOAT assert_false(cmp_write_float(&cmp, 1.1f)); assert_false(cmp_write_double(&cmp, 1.1)); +#endif assert_false(cmp_write_map(&cmp, 1)); assert_false(cmp_write_str(&cmp, "a", 1)); assert_false(cmp_write_str(&cmp, "apple", 5)); @@ -5051,10 +5143,12 @@ void test_errors(void **state) { assert_false(cmp_write_integer(&cmp, -33000)); writer_successes = 1; assert_false(cmp_write_integer(&cmp, 0xFFFFFFFF2)); +#ifndef CMP_NO_FLOAT writer_successes = 1; assert_false(cmp_write_float(&cmp, 1.1f)); writer_successes = 1; assert_false(cmp_write_double(&cmp, 1.1)); +#endif writer_successes = 1; assert_false(cmp_write_str(&cmp, "a", 1)); writer_successes = 1; @@ -5199,6 +5293,7 @@ void test_errors(void **state) { M_BufferSeek(&buf, 0); assert_false(cmp_read_object(&cmp, &obj)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_true(cmp_write_float(&cmp, 1.1f)); M_BufferSeek(&buf, 0); @@ -5208,6 +5303,7 @@ void test_errors(void **state) { assert_true(cmp_write_double(&cmp, 1.1)); M_BufferSeek(&buf, 0); assert_false(cmp_read_object(&cmp, &obj)); +#endif M_BufferSeek(&buf, 0); assert_true(cmp_write_map(&cmp, 1)); @@ -5372,6 +5468,7 @@ void test_errors(void **state) { reader_successes = 1; assert_false(cmp_read_object(&cmp, &obj)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_true(cmp_write_float(&cmp, 1.1f)); M_BufferSeek(&buf, 0); @@ -5383,6 +5480,7 @@ void test_errors(void **state) { M_BufferSeek(&buf, 0); reader_successes = 1; assert_false(cmp_read_object(&cmp, &obj)); +#endif M_BufferSeek(&buf, 0); assert_true(cmp_write_map(&cmp, 0x100)); @@ -5567,6 +5665,7 @@ void test_errors(void **state) { M_BufferSeek(&buf, 0); assert_false(cmp_read_s64(&cmp, &s64)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_true(cmp_write_float(&cmp, 1.1f)); M_BufferSeek(&buf, 0); @@ -5576,6 +5675,7 @@ void test_errors(void **state) { assert_true(cmp_write_double(&cmp, 1.1)); M_BufferSeek(&buf, 0); assert_false(cmp_read_double(&cmp, &d)); +#endif writer_successes = 1; @@ -5606,11 +5706,13 @@ void test_errors(void **state) { M_BufferSeek(&buf, 0); assert_false(cmp_write_s64(&cmp, 0x80000002)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_false(cmp_write_float(&cmp, 1.1f)); M_BufferSeek(&buf, 0); assert_false(cmp_write_double(&cmp, 1.1)); +#endif reader_successes = -1; @@ -5662,6 +5764,7 @@ void test_errors(void **state) { M_BufferSeek(&buf, 0); assert_false(cmp_read_s64(&cmp, &s64)); +#ifndef CMP_NO_FLOAT M_BufferClear(&buf); writer_successes = 1; assert_false(cmp_write_float(&cmp, 1.1f)); @@ -5673,6 +5776,7 @@ void test_errors(void **state) { assert_false(cmp_write_double(&cmp, 1.1)); M_BufferSeek(&buf, 0); assert_false(cmp_read_double(&cmp, &d)); +#endif writer_successes = -1; reader_successes = -1; @@ -5706,10 +5810,12 @@ void test_errors(void **state) { assert_false(cmp_read_s32(&cmp, &s32)); M_BufferSeek(&buf, 0); assert_false(cmp_read_s64(&cmp, &s64)); +#ifndef CMP_NO_FLOAT M_BufferSeek(&buf, 0); assert_false(cmp_read_float(&cmp, &f)); M_BufferSeek(&buf, 0); assert_false(cmp_read_double(&cmp, &d)); +#endif M_BufferSeek(&buf, 0); assert_false(cmp_read_str_size(&cmp, &size)); M_BufferSeek(&buf, 0); @@ -5739,8 +5845,10 @@ void test_errors(void **state) { assert_true(cmp_write_u16(&cmp, 300)); assert_true(cmp_write_u32(&cmp, 70000)); assert_true(cmp_write_u64(&cmp, 0xFFFFFFFFF)); +#ifndef CMP_NO_FLOAT assert_true(cmp_write_decimal(&cmp, 1.1f)); assert_true(cmp_write_decimal(&cmp, 1.1)); +#endif M_BufferSeek(&buf, 0); assert_true(cmp_read_char(&cmp, &s8)); @@ -5754,8 +5862,11 @@ void test_errors(void **state) { assert_true(cmp_read_ushort(&cmp, &u16)); assert_true(cmp_read_uint(&cmp, &u32)); assert_true(cmp_read_ulong(&cmp, &u64)); + +#ifndef CMP_NO_FLOAT assert_true(cmp_read_decimal(&cmp, &d)); assert_true(cmp_read_decimal(&cmp, &d)); +#endif M_BufferClear(&buf); assert_true(cmp_write_nfix(&cmp, -1)); @@ -5800,7 +5911,11 @@ int main(void) { unit_test(test_map), unit_test(test_ext), unit_test(test_obj), + +#ifndef CMP_NO_FLOAT unit_test(test_float_flip), +#endif + unit_test(test_skipping), unit_test(test_deprecated_limited_skipping), unit_test(test_errors), From a325eba3a458ded697f6f50b0c2828dd5be5109a Mon Sep 17 00:00:00 2001 From: Charlie Gunyon Date: Sun, 6 Sep 2020 23:19:56 -0400 Subject: [PATCH 5/9] Ignore new test file and coverage folder --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f3b250d..3b4e8bd 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ # Coverage files *.gcda *.gcno +coverage/ # Testing executable test/test-cmp @@ -36,6 +37,7 @@ cmptest cmptest2 cmpaddrtest cmpmemtest +cmpnofloattest cmpubtest # Example executables From e768c6821d55653ab429ba12086ac3af2f748ea2 Mon Sep 17 00:00:00 2001 From: Charlie Gunyon Date: Sun, 6 Sep 2020 23:20:38 -0400 Subject: [PATCH 6/9] Fix skipping tests in no float mode --- test/test.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/test/test.c b/test/test.c index 74fe864..28849d6 100644 --- a/test/test.c +++ b/test/test.c @@ -4550,29 +4550,37 @@ void test_skipping(void **state) { #endif M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_FIXEXT1); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_FIXEXT2); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_FIXEXT4); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4580,8 +4588,10 @@ void test_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_FIXEXT8); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4590,8 +4600,10 @@ void test_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_FIXEXT16); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4600,8 +4612,10 @@ void test_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_FIXEXT16); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4611,8 +4625,10 @@ void test_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_EXT8); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4623,8 +4639,10 @@ void test_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_EXT16); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4636,8 +4654,10 @@ void test_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_EXT32); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4650,8 +4670,10 @@ void test_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_NIL); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4856,29 +4878,37 @@ void test_deprecated_limited_skipping(void **state) { #endif M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_FIXEXT1); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_FIXEXT2); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_read_object(&cmp, &obj)); assert_int_equal(obj.type, CMP_TYPE_FIXEXT4); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4886,8 +4916,10 @@ void test_deprecated_limited_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_FIXEXT8); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4896,8 +4928,10 @@ void test_deprecated_limited_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_FIXEXT16); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4906,8 +4940,10 @@ void test_deprecated_limited_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_FIXEXT16); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4917,8 +4953,10 @@ void test_deprecated_limited_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_EXT8); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4929,8 +4967,10 @@ void test_deprecated_limited_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_EXT16); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4942,8 +4982,10 @@ void test_deprecated_limited_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_EXT32); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); @@ -4956,8 +4998,10 @@ void test_deprecated_limited_skipping(void **state) { assert_int_equal(obj.type, CMP_TYPE_NIL); M_BufferSeek(&buf, 0); +#ifndef CMP_NO_FLOAT assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); +#endif assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); assert_true(cmp_skip_object_no_limit(&cmp)); From 7cee2df3b6beaed57507ccd3a17f3cf5a921930e Mon Sep 17 00:00:00 2001 From: Charlie Gunyon Date: Sun, 6 Sep 2020 23:20:59 -0400 Subject: [PATCH 7/9] Add no float tests to Makefile, but exempt them from coverage stats --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d7df64c..7aad04e 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,7 @@ UBCFLAGS ?= -fsanitize=undefined all: cmptest example1 example2 -test: addrtest memtest ubtest unittest nofpucmptest - -unittest: cmptest - @./cmptest +test: addrtest memtest nofloattest ubtest unittest addrtest: cmpaddrtest @./cmpaddrtest @@ -25,11 +22,15 @@ addrtest: cmpaddrtest memtest: cmpmemtest @./cmpmemtest +nofloattest: cmpnofloattest + @./cmpnofloattest + @rm -f *.gcno *.gcda *.info + ubtest: cmpubtest @./cmpubtest -nofloattest: cmpnofloattest - @./cmpnofloattest +unittest: cmptest + @./cmptest cmp.o: $(CC) $(CFLAGS) $(CMPCFLAGS) -fprofile-arcs -ftest-coverage -g -I. -c cmp.c @@ -79,6 +80,7 @@ clean: @rm -f cmpaddrtest @rm -f cmpmemtest @rm -f cmpubtest + @rm -f cmpnofloattest @rm -f example1 @rm -f example2 @rm -f *.o From f94b7e32b8a3f59fa7bd794ca8ac6de31f1dcc80 Mon Sep 17 00:00:00 2001 From: Charlie Gunyon Date: Mon, 7 Sep 2020 00:16:05 -0400 Subject: [PATCH 8/9] Make comment accurate --- cmp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmp.h b/cmp.h index 9c253c5..0efa859 100644 --- a/cmp.h +++ b/cmp.h @@ -332,8 +332,8 @@ bool cmp_read_object(cmp_ctx_t *ctx, cmp_object_t *obj); bool cmp_skip_object(cmp_ctx_t *ctx, cmp_object_t *obj); /* - * This is similar to `cmp_skip_object_flat`, except it tolerates flat arrays - * and maps. If when skipping such an array or map this function encounters + * This is similar to `cmp_skip_object`, except it tolerates flat arrays and + * maps. If when skipping such an array or map this function encounters * another array/map, it will: * - If `obj` is not `NULL`, fill in `obj` with that (nested) object * - Set `ctx->error` to `SKIP_DEPTH_LIMIT_EXCEEDED_ERROR` From 775f7bb3e54f4d070586d7837b496cdddb995cb9 Mon Sep 17 00:00:00 2001 From: Charlie Gunyon Date: Mon, 7 Sep 2020 00:20:33 -0400 Subject: [PATCH 9/9] Fix little typo of CMakeLists.txt filename --- CMakeLIsts.txt => CMakeLists.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CMakeLIsts.txt => CMakeLists.txt (100%) diff --git a/CMakeLIsts.txt b/CMakeLists.txt similarity index 100% rename from CMakeLIsts.txt rename to CMakeLists.txt