Big simplification of floating point API. Now does preferred encoding of floats like preferred encoding of ints per upcoming update to CBOR RFC
diff --git a/test/qcbor_encode_tests.c b/test/qcbor_encode_tests.c
index 485f47e..28bb817 100644
--- a/test/qcbor_encode_tests.c
+++ b/test/qcbor_encode_tests.c
@@ -49,7 +49,7 @@
//#define PRINT_FUNCTIONS_FOR_DEBUGGINGXX
-#if PRINT_FUNCTIONS_FOR_DEBUGGINGXX
+#if PRINT_FUNCTIONS_FOR_DEBUGGINGXX
#include <stdio.h>
// ifdef these out to not have compiler warnings
@@ -235,7 +235,7 @@
static const uint8_t spExpectedEncodedAll[] = {
- 0x98, 0x29, 0x66, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x32, 0xd8,
+ 0x98, 0x22, 0x66, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x32, 0xd8,
0x64, 0x1a, 0x05, 0x5d, 0x23, 0x15, 0x65, 0x49, 0x4e, 0x54,
0x36, 0x34, 0xd8, 0x4c, 0x1b, 0x00, 0x00, 0x00, 0x12, 0x16,
0xaf, 0x2b, 0x15, 0x00, 0x38, 0x2b, 0xa4, 0x63, 0x4c, 0x42,
@@ -244,16 +244,7 @@
0x53, 0x20, 0x4b, 0x49, 0x4e, 0x44, 0x20, 0x4f, 0x46, 0x20,
0x4c, 0x4f, 0x4e, 0x47, 0x3b, 0x00, 0x00, 0x02, 0x2d, 0x9a,
0xc6, 0x94, 0x55, 0x3a, 0x05, 0xf5, 0xe0, 0xff, 0x3a, 0x2f,
- 0xaf, 0x07, 0xff, 0x65, 0x4a, 0x61, 0x69, 0x6d, 0x65, 0xd8,
- 0x58, 0xfa, 0x40, 0x49, 0x0f, 0xd0, 0x66, 0x53, 0x74, 0x72,
- 0x65, 0x65, 0x74, 0xd8, 0x63, 0xfb, 0x40, 0x21, 0x4f, 0x01,
- 0x96, 0xd8, 0xf4, 0xf9, 0xfa, 0x3f, 0x80, 0x00, 0x00, 0xfb,
- 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x63,
- 0x66, 0x6f, 0x6f, 0xfa, 0x45, 0x98, 0xb8, 0x00, 0x39, 0x03,
- 0xe6, 0xfa, 0x44, 0x79, 0xc0, 0x00, 0x66, 0x66, 0x6f, 0x6f,
- 0x66, 0x6f, 0x6f, 0xfb, 0x41, 0x58, 0xf7, 0x7d, 0xc0, 0x00,
- 0x00, 0x00, 0x39, 0xaf, 0xc6, 0xfb, 0x40, 0xf5, 0xba, 0x70,
- 0x00, 0x00, 0x00, 0x00, 0xc1, 0x1a, 0x8e, 0x15, 0x1c, 0x8a,
+ 0xaf, 0x07, 0xff, 0xc1, 0x1a, 0x8e, 0x15, 0x1c, 0x8a,
0xa3, 0x74, 0x4c, 0x6f, 0x6e, 0x67, 0x4c, 0x69, 0x76, 0x65,
0x44, 0x65, 0x6e, 0x69, 0x73, 0x52, 0x69, 0x74, 0x63, 0x68,
0x69, 0x65, 0xc1, 0x1a, 0x53, 0x72, 0x4e, 0x00, 0x66, 0x74,
@@ -499,22 +490,6 @@
QCBOREncode_AddInt64ToMap(&ECtx, "NEGLBLTHAT IS KIND OF LONG", -2394893489238);
QCBOREncode_AddInt64ToMapN(&ECtx, -100000000, -800000000);
QCBOREncode_CloseMap(&ECtx);
-
- // floats and doubles
- QCBOREncode_AddTag(&ECtx, 88);
- QCBOREncode_AddFloat_2(&ECtx, "Jaime", QCBOR_NO_INT_LABEL, 3.14159);
- QCBOREncode_AddTag(&ECtx, 99);
- QCBOREncode_AddDouble_2(&ECtx, "Street", QCBOR_NO_INT_LABEL, 8.654309);
- QCBOREncode_AddFloat(&ECtx, 1);
- QCBOREncode_AddDouble(&ECtx, 1);
-
- // floats and doubles that go in map
- QCBOREncode_OpenMap(&ECtx);
- QCBOREncode_AddFloatToMap(&ECtx, "foo", 4887);
- QCBOREncode_AddFloatToMapN(&ECtx, -999, 999);
- QCBOREncode_AddDoubleToMap(&ECtx, "foofoo", 6544887);
- QCBOREncode_AddDoubleToMapN(&ECtx, -44999, 88999);
- QCBOREncode_CloseMap(&ECtx);
// Epoch Date
QCBOREncode_AddDateEpoch(&ECtx, 2383748234);