aboutsummaryrefslogtreecommitdiff
path: root/tests/test.c
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-09-06 21:46:35 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-09-06 21:46:35 -0400
commit13bcaa274e0276bc5fe1e50008826352ffb5c87f (patch)
tree2d48136fe10d670221b5667b63cae902fce0f35c /tests/test.c
parentea15299006cc2486c44fea72381e0c9e555c0d75 (diff)
Squashed commit of the following:v0.1.5
commit d5235f583cc984bf0a36f01aac80ca21ee712e3a Author: vnugent <public@vaughnnugent.com> Date: Fri Sep 6 21:44:09 2024 -0400 update changelog for v0.1.5 commit b4a5a50098eba9ef1633715a8a74c5ac0c32b2e2 Author: vnugent <public@vaughnnugent.com> Date: Fri Sep 6 21:37:01 2024 -0400 configure autobuild for master branch commit de9741b417ee04a54512af106b71cf388c93ea9d Author: vnugent <public@vaughnnugent.com> Date: Wed Aug 28 19:54:45 2024 -0400 feat: add library context alloc util functions
Diffstat (limited to 'tests/test.c')
-rw-r--r--tests/test.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/test.c b/tests/test.c
index e8b064b..20a0e5d 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -66,6 +66,10 @@
#include "hex.h"
+#ifdef NC_ENABLE_UTILS
+ #include <noscryptutil.h>
+#endif
+
/*Pre-computed constants for argument errors */
#define ARG_ERROR_POS_0 E_NULL_PTR
#define ARG_ERROR(pos) NCResultWithArgPosition(E_NULL_PTR, pos)
@@ -365,7 +369,13 @@ static int TestPublicApiArgumentValidation()
* Alloc context structure on the heap before use.
* THIS WILL LEAK IN THE CURRENT CONFIG ALWAYS FREE UNDER NORMAL CONDITIONS
*/
+
+#ifdef NOSCRYPTUTIL_H
+ ctx = NCUtilContextAlloc();
+#else
ctx = (NCContext*)malloc(NCGetContextStructSize());
+#endif
+
TASSERT(ctx != NULL)
/*Test null context*/
@@ -608,9 +618,7 @@ static int TestCorrectEncryption(const NCContext* context)
return 0;
}
-#ifdef NC_ENABLE_UTILS
-
-#include <noscryptutil.h>
+#ifdef NOSCRYPTUTIL_H
/* Padding tests taken from the nip44 repo vectors.json file */
static const uint32_t _padTestActual[24] = { 16, 32, 33, 37, 45, 49, 64, 65, 100, 111, 200, 250, 320, 383, 384, 400, 500, 512, 515, 700, 800, 900, 1020, 65536 };