summaryrefslogtreecommitdiff
path: root/cesar/maximus/sci/utest/scimsg/inc/TestClock.h
blob: c6efccbc6574fe6aa3164722fa409773cfc0c97c (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
#ifndef maximus_sci_utest_scimsg_inc_testclock_h
#define maximus_sci_utest_scimsg_inc_testclock_h
/* Maximus project {{{
 *
 * Copyright (C) 2012 MStar Semiconductor
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    maximus/sci/utest/scimsg/inc/TestClock.h
 * \ingroup maximus_sci_utest_scimsg
 *
 */
#include "maximus/common/types.h"
#include "maximus/interface/station/station.h"
#include "maximus/sci/sci_msg.h"
#include <sys/types.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>

class TestClock : public CPPUNIT_NS::TestFixture
{
    CPPUNIT_TEST_SUITE (TestClock);
    CPPUNIT_TEST (test_encode);
    CPPUNIT_TEST (test_decode);
    CPPUNIT_TEST_SUITE_END ();

public:

    void setUp ();
    void tearDown ();

private:

    stations_list_t fake_sta_list;
    Network_Clock_Tick time_base;
    SciServer *fake_server;

    void __build_clock_msg (
        unsigned char *expected,
        size_t msg_size,
        size_t data_size,
        Network_Clock_Type test_type,
        Network_Clock_Id test_id,
        Sci_Msg_Station_Id test_staid);

    void test_encode ();
    void test_decode ();
};

#endif /* maximus_sci_utest_scimsg_inc_testclock_h */