packetTest.c
760 Bytes
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
#include "runtest.h"
#include "token/cclass.h"
#include "token/packet.h"
#include "token/dyntype.h"
const char testname[] = "packetTest";
struct PACKET * packet = NULL;
static
int
__setUp()
{
packet = new(PACKET, NULL);
ASSERT_INSTANCE_OF(PACKET, packet);
return TEST_OK;
}
int (* const setUp)() = __setUp;
static
int
__tearDown()
{
if (NULL != packet) {
ASSERT_OBJECT(packet);
delete(&packet);
}
return TEST_OK;
}
int (* const tearDown)() = __tearDown;
static
int
testDefaultInit()
{
ASSERT_NULL(packet_getHeader(packet));
ASSERT_NULL(packet_getData(packet));
return TEST_OK;
}
const testfunc tests[] = {
testDefaultInit
};
const size_t count = FUNCS_COUNT(tests);
// vim: set et ts=4 sw=4: