From 8469c09161a83ffe767026c7c697d15530597929 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Sun, 4 Feb 2018 14:18:42 -0600 Subject: [PATCH] Add test for enc_nib --- tests/apple2.enc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/apple2.enc.c b/tests/apple2.enc.c index f293768..8f07c61 100644 --- a/tests/apple2.enc.c +++ b/tests/apple2.enc.c @@ -155,3 +155,23 @@ Test(apple2_enc, sector) cr_assert_eq(vm_segment_get(dest, i), f_enc_sector[i]); } } + +Test(apple2_enc, nib) +{ + vm_segment *seg = vm_segment_create(1000); + vm_segment *nib; + int i; + + for (i = 0; i < 1000; i++) { + vm_segment_set(seg, i, 0xff); + } + + nib = apple2_enc_nib(seg); + + for (i = 0; i < 1000; i++) { + cr_assert_eq(vm_segment_get(nib, i), 0xff); + } + + vm_segment_free(nib); + vm_segment_free(seg); +}