summaryrefslogtreecommitdiff
path: root/mac/sar/test/unit_test/ecos/src/beacon.c
blob: bf4fb4895f2de14110c2b1a51c2cd836ac9b1413 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \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 <cyg/kernel/kapi.h>
#include <cyg/hal/hal_arch.h>

#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;
}