summaryrefslogtreecommitdiff
path: root/cesar/mac/common/test/ntb/src/test_ntb.c
blob: eb7e6570de4e52d50d51d574878aab3fb03f47bb (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
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    mac/common/test/ntb/src/test_ntb.c
 * \brief   test the ntb date.
 * \ingroup mac_common 
 *
 */
#include "common/std.h"

#include "lib/test.h"
#include "lib/blk.h"
#include "mac/common/ntb.h"
#include "mac/common/config.h"
#include "hal/phy/phy.h"


int main (void)
{
    test_t test;
    
    mac_config_t mac_config;
    phy_t *phy;

    test_init(test, 0, NULL);

    phy = blk_alloc();

    mac_ntb_init(phy, &mac_config);
    mac_config.ntb_offset_tck = 10;

    test_begin(test, "test ntb")
    {
        test_fail_if(mac_ntb() != 62, "Error on getting ntb date");
    }
    test_end;

    mac_ntb_uninit();
    blk_release(phy);
    test_result (test);
    return test_nb_failed (test) == 0 ? 0 : 1;
}

u32
phy_date (phy_t *phy)
{
    dbg_assert(phy);
    return 52;
}