diff options
Diffstat (limited to 'source/test/unittests/array_ref.test.c')
-rw-r--r-- | source/test/unittests/array_ref.test.c | 23 |
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 }; |