1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests: adapt cib.h unittests for variable cib size

This commit is contained in:
Martine Lenders 2017-11-22 18:23:07 +01:00
parent a8ec624ac4
commit 56ec27cf6f
No known key found for this signature in database
GPG Key ID: 8E97A9FE55F25D62

View File

@ -12,7 +12,7 @@
#include "tests-core.h"
#define TEST_CIB_SIZE 2
#define TEST_CIB_SIZE (4)
static cib_t cib;
@ -23,8 +23,9 @@ static void set_up(void)
static void test_cib_put(void)
{
TEST_ASSERT_EQUAL_INT(0, cib_put(&cib));
TEST_ASSERT_EQUAL_INT(1, cib_put(&cib));
for (unsigned i = 0; i < TEST_CIB_SIZE; i++) {
TEST_ASSERT_EQUAL_INT(i, cib_put(&cib));
}
TEST_ASSERT_EQUAL_INT(-1, cib_put(&cib));
}
@ -59,16 +60,6 @@ static void test_cib_avail(void)
TEST_ASSERT_EQUAL_INT(2, cib_avail(&cib));
}
static void test_cib_put_and_get(void)
{
TEST_ASSERT_EQUAL_INT(0, cib_put(&cib));
TEST_ASSERT_EQUAL_INT(0, cib_get(&cib));
TEST_ASSERT_EQUAL_INT(-1, cib_get(&cib));
TEST_ASSERT_EQUAL_INT(1, cib_put(&cib));
TEST_ASSERT_EQUAL_INT(0, cib_put(&cib));
TEST_ASSERT_EQUAL_INT(-1, cib_put(&cib));
}
static void test_empty_cib(void)
{
cib_init(&cib, 0);
@ -94,7 +85,6 @@ Test *tests_core_cib_tests(void)
new_TestFixture(test_cib_put),
new_TestFixture(test_cib_get),
new_TestFixture(test_cib_avail),
new_TestFixture(test_cib_put_and_get),
new_TestFixture(test_empty_cib),
new_TestFixture(test_singleton_cib),
new_TestFixture(test_cib_peek),