split qcbor.h into four separate headers (#34)
This is to make it much easier to read the header files.
Backwards compatibility with qcbor.h is retained, but use of qcbor/qcbor_encode.h and qcbor/qcbor_decode.h is preferred now.
Signed-off-by: Laurence Lundblade <lgl@securitytheory.com>
diff --git a/test/float_tests.c b/test/float_tests.c
index 20057c3..e6facae 100644
--- a/test/float_tests.c
+++ b/test/float_tests.c
@@ -11,7 +11,8 @@
=============================================================================*/
#include "float_tests.h"
-#include "qcbor.h"
+#include "qcbor/qcbor_encode.h"
+#include "qcbor/qcbor_decode.h"
#include "half_to_double_from_rfc7049.h"
#include <math.h> // For INFINITY and NAN and isnan()
diff --git a/test/qcbor_decode_tests.c b/test/qcbor_decode_tests.c
index a9e1fb2..9bcaa46 100644
--- a/test/qcbor_decode_tests.c
+++ b/test/qcbor_decode_tests.c
@@ -31,7 +31,8 @@
=============================================================================*/
#include "qcbor_decode_tests.h"
-#include "qcbor.h"
+#include "qcbor/qcbor_encode.h"
+#include "qcbor/qcbor_decode.h"
#include <string.h>
#include <math.h> // for fabs()
#include "not_well_formed_cbor.h"
@@ -1416,9 +1417,7 @@
-/*
- Public function for initialization. See header qcbor.h
- */
+
int32_t ParseMapTest()
{
// Parse a moderatly complex map structure very thoroughly
@@ -2003,9 +2002,6 @@
}
-/*
- Public function for initialization. See header qcbor.h
- */
int32_t ComprehensiveInputTest()
{
// Size 2 tests 64K inputs and runs quickly
@@ -2017,9 +2013,6 @@
}
-/*
- Public function for initialization. See header qcbor.h
- */
int32_t BigComprehensiveInputTest()
{
// size 3 tests 16 million inputs and runs OK
diff --git a/test/qcbor_decode_tests.h b/test/qcbor_decode_tests.h
index e87490e..7c8c185 100644
--- a/test/qcbor_decode_tests.h
+++ b/test/qcbor_decode_tests.h
@@ -38,7 +38,8 @@
/*
Notes:
- - All the functions in qcbor.h are called once in the aggregation of all the tests below.
+ - All the functions in qcbor_decode.h are called once in the aggregation
+ of all the tests below.
- All the types that are supported are given as input and parsed by these tests
diff --git a/test/qcbor_encode_tests.c b/test/qcbor_encode_tests.c
index 638a9b9..1e91378 100644
--- a/test/qcbor_encode_tests.c
+++ b/test/qcbor_encode_tests.c
@@ -30,7 +30,8 @@
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=============================================================================*/
-#include "qcbor.h"
+#include "qcbor/qcbor_encode.h"
+#include "qcbor/qcbor_decode.h"
#include "qcbor_encode_tests.h"
diff --git a/test/qcbor_encode_tests.h b/test/qcbor_encode_tests.h
index 204bdee..e54168a 100644
--- a/test/qcbor_encode_tests.h
+++ b/test/qcbor_encode_tests.h
@@ -38,7 +38,7 @@
/*
Notes:
- - All the functions in qcbor.h are called once in the aggregation of all
+ - All the functions in qcbor_encode.h are called once in the aggregation of all
the tests below.
- All the types that are supported are given as input and parsed by these tests
@@ -136,7 +136,7 @@
/*
- Calls all public encode methods in qcbor.h once.
+ Calls all public encode methods in qcbor_encode.h once.
*/
int32_t AllAddMethodsTest(void);
diff --git a/test/run_tests.c b/test/run_tests.c
index 8e52dae..5c0abe3 100644
--- a/test/run_tests.c
+++ b/test/run_tests.c
@@ -275,7 +275,10 @@
}
-#include "qcbor.h" // For size printing
+// For size printing
+#include "qcbor/qcbor_encode.h"
+#include "qcbor/qcbor_decode.h"
+
/*
Public function. See run_test.h.