/* Cesar project {{{ * * Copyright (C) 2008 Spidcom * * <<>> * * }}} */ /** * \file mac/sar/test/unit_test/ecos/src/beacon.c * \brief Send beacon. * \ingroup sar * * Coverage use only, the function tested is only a path to the mac layer, the * sar only provide the beacon to the pbproc and does nothing with it. */ #include #include #include "common/std.h" #include "lib/test.h" #include "mac/sar/sar.h" #include "mac/sar/inc/sar_context.h" int main (void) { test_t test; sar_t *sar; pb_beacon_t *beacon; mfs_tx_t *mfs; test_init (test, 0, NULL); sar = blk_alloc (); sar->pbproc_ctx = blk_alloc (); beacon = blk_alloc (); mfs = blk_alloc (); mfs->beacon = true; mfs->head = NULL; mfs->tail = NULL; sar_beacon_send (sar, beacon, mfs, sar); blk_release (sar->pbproc_ctx); blk_release (sar); blk_release (beacon); blk_release (mfs); test_begin (test, "Memory test") { test_fail_if (blk_check_memory() == false, "Memory not freed"); } test_end; test_result (test); HAL_PLATFORM_EXIT (test_nb_failed (test) == 0 ? 0 : 1); return test_nb_failed (test) == 0 ? 0 : 1; } void pbproc_mfs_provide (mfs_tx_t *mfs, uint nb) {return;} pb_t * pbproc_mfs_extract_tail (mfs_tx_t *mfs) {return NULL;} void pbproc_mfs_insert (mfs_tx_t *mfs, pb_t *first, pb_t *last, uint nb, uint cap) {return;} void pbproc_mfs_beacon_prepare (pbproc_t *ctx, mfs_tx_t *mfs, pb_beacon_t *pb, const pbproc_tx_beacon_params_t *params) { return; }