summaryrefslogtreecommitdiff
path: root/cesar/mac/common/test/sta/src/test_sta.c
blob: 509f05d773c15c639c095f765e302eeaa713d5ff (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
/* Cesar project {{{
 *
 * Copyright (C) 2011 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    src/test_sta.c
 * \brief   Test for mac/common/sta
 * \ingroup test
 *
 */
#include "common/std.h"
#include "lib/blk.h"
#include "lib/test.h"
#include "mac/common/store.h"

void
sta_test_suite (test_t t)
{
    test_suite_begin (t, "Sta");
    test_begin (t, "sta_t structure size test")
    {
        mac_store_t *ctx = mac_store_init ();
        mac_store_sta_add (ctx, 42);
        test_fail_unless (mac_store_sta_remove (ctx, 42));
        mac_store_uninit (ctx);
    } test_end;
}

int
main (int argc, char **argv)
{
    test_t t;
    test_init (t, argc, argv);
    sta_test_suite (t);
    test_result (t);
    test_begin (t, "Memory check")
    {
        test_fail_unless (blk_check_memory ());
    } test_end;
    return test_nb_failed (t) == 0 ? 0 : 1;
}