/* Cesar project {{{ * * Copyright (C) 2010 Spidcom * * <<>> * * }}} */ /** * \file bsu/aclf/test/utest/src/misc.c * \brief Miscellaneous tests. * \ingroup bsu_aclf * */ #include "common/std.h" #include "lib/test.h" #include "bsu/aclf/aclf.h" #include "bsu/aclf/test/utest/common.h" void test_case_aclf__beacon_period (test_t test) { test_case_begin (test, "ACLF beacon period"); test_begin (test, "Get the beacon period") { u32 bpsd [4] = { 0, 30, 70, 150 }; uint i; bsu_aclf_test_t t; bsu_aclf_test_init (&t); for (i = 0; i < COUNT(bpsd); i++) t.aclf->bpsd[i] = bpsd[i]; for (i = 0; i < COUNT(bpsd) - 1; i++) { test_fail_unless (bpsd[i+1] - bpsd[i] == bsu_aclf_beacon_period_tck (t.aclf)); bsu_aclf_shift_beacon_period_start_date (t.aclf); } bsu_aclf_test_uninit (&t); } test_end; } void test_suite_aclf__misc (test_t test) { test_suite_begin (test, "Miscellaneous tests"); test_case_aclf__beacon_period (test); }