summaryrefslogtreecommitdiff
path: root/source/test/unittests/array_ref.test.c
diff options
context:
space:
mode:
authorMitya Selivanov <0x7fffff@guattari.ru>2022-08-07 08:55:32 +0400
committerMitya Selivanov <0x7fffff@guattari.ru>2022-08-07 08:55:32 +0400
commit05630cf10cc01a237131989248261149f03fc8ab (patch)
treeafc81a3f916b7b47021515f93fe426f3e45bc670 /source/test/unittests/array_ref.test.c
parent4429ed09b548518dbffce7ec77ddf5a8b09484b2 (diff)
downloadkit-05630cf10cc01a237131989248261149f03fc8ab.zip
static array wrap, static string wrap
Diffstat (limited to 'source/test/unittests/array_ref.test.c')
-rw-r--r--source/test/unittests/array_ref.test.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/test/unittests/array_ref.test.c b/source/test/unittests/array_ref.test.c
index d8cbcec..27b754b 100644
--- a/source/test/unittests/array_ref.test.c
+++ b/source/test/unittests/array_ref.test.c
@@ -3,6 +3,29 @@
#define KIT_TEST_FILE array_ref
#include "../../kit_test/test.h"
+TEST("array ref const wrap") {
+ int foo[] = { 1, 2, 3 };
+ AR_CONST_WRAP(ref, foo);
+
+ REQUIRE(ref.size == 3);
+ REQUIRE(ref.values[0] == 1);
+ REQUIRE(ref.values[1] == 2);
+ REQUIRE(ref.values[2] == 3);
+}
+
+TEST("array ref wrap") {
+ int foo[] = { 1, 2, 3 };
+ AR_WRAP(ref, foo);
+
+ REQUIRE(ref.size == 3);
+ REQUIRE(ref.values[0] == 1);
+ REQUIRE(ref.values[1] == 2);
+ REQUIRE(ref.values[2] == 3);
+
+ ref.values[1] = 42;
+ REQUIRE(ref.values[1] == 42);
+}
+
TEST("array ref equal") {
int foo[] = { 1, 2, 3, 4, 5, 6, 7 };
int bar[] = { 3, 4, 5 };