aboutsummaryrefslogtreecommitdiff
path: root/test/src/util/test_bits.c
diff options
context:
space:
mode:
authorJ08nY2017-12-13 14:06:54 +0100
committerJ08nY2017-12-13 14:06:54 +0100
commit629ba8254039945dbf1fe7126611ac8b72010429 (patch)
treef6598c3977910c81337b43c02bac443a1d0e8696 /test/src/util/test_bits.c
parent61b04bd5ce59c2419c19b52031e04cf3aeb51ba0 (diff)
downloadecgen-629ba8254039945dbf1fe7126611ac8b72010429.tar.gz
ecgen-629ba8254039945dbf1fe7126611ac8b72010429.tar.zst
ecgen-629ba8254039945dbf1fe7126611ac8b72010429.zip
Diffstat (limited to 'test/src/util/test_bits.c')
-rw-r--r--test/src/util/test_bits.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/src/util/test_bits.c b/test/src/util/test_bits.c
index 27da58b..8a356b0 100644
--- a/test/src/util/test_bits.c
+++ b/test/src/util/test_bits.c
@@ -40,6 +40,19 @@ Test(bits, test_bits_new_rand) {
bits_free(&bits);
}
+Test(bits, test_bits_cpy) {
+ bits_t *bits = bits_new(10);
+ bits->bits[0] = 0b10101010;
+ bits->bits[1] = 0b11000000;
+
+ bits_t *other = bits_new(5);
+ bits_cpy(other, bits);
+ cr_assert_eq(other->bitlen, bits->bitlen, );
+ cr_assert_eq(other->allocated, bits->allocated, );
+ cr_assert_eq(other->bits[0], bits->bits[0], );
+ cr_assert_eq(other->bits[1], bits->bits[1], );
+}
+
Test(bits, test_bits_copy) {
bits_t *bits = bits_new(10);
bits->bits[0] = 0b10101010;