-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv_TelephoneTest.ino
86 lines (85 loc) · 2.06 KB
/
v_TelephoneTest.ino
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
79
80
81
82
83
84
85
86
/**
* Test-file for Telephone.
*/
/*
* Only compile this file
* if the telephone-functions are being tested.
*/
#if (TEST == TEST_TELEPHONE)
/*
* Generate a file specific warning during compilation,
* so that it is possible to identify
* which files are being compiled.
*/
#warning TestTelephone
/**
* Setup the serial-connection
* and run all the telephone-tests.
*/
void setup()
{
setupSerial();
testGetCallerIdFromCall();
}
/**
* Test-function for the function "getCallerIdFromCall".
* This test is split in sub-tests for memory allocation reasons.
*/
void testGetCallerIdFromCall()
{
testGetCallerIdFromCall1();
testGetCallerIdFromCall2();
testGetCallerIdFromCall3();
testGetCallerIdFromCall4();
testGetCallerIdFromCall5();
testGetCallerIdFromCall6();
}
/**
* Test-function #1 for the function "getCallerIdFromCall".
*/
void testGetCallerIdFromCall1()
{
char call[] = "*ECAV: 1,6,1,,,\"31457112345\",145;";
compareUnsignedNumbers(31457112345ULL, getCallerIdFromCall(call));
}
/**
* Test-function #2 for the function "getCallerIdFromCall".
*/
void testGetCallerIdFromCall2()
{
char call[] = "*ECAV: 1,6,1,,,\"31457112345,145;";
compareUnsignedNumbers(0, getCallerIdFromCall(call));
}
/**
* Test-function #3 for the function "getCallerIdFromCall".
*/
void testGetCallerIdFromCall3()
{
char call[] = "*ECAV: 1,6,1,,,31457112345,145\";";
compareUnsignedNumbers(0, getCallerIdFromCall(call));
}
/**
* Test-function #4 for the function "getCallerIdFromCall".
*/
void testGetCallerIdFromCall4()
{
char call[] = "*ECAV: 1,6,1,,,\"314571123a5\",145;";
compareUnsignedNumbers(0, getCallerIdFromCall(call));
}
/**
* Test-function #5 for the function "getCallerIdFromCall".
*/
void testGetCallerIdFromCall5()
{
char call[] = "*ECAV: 1,6,1,,,\"3145711234531457112345\",145;";
compareUnsignedNumbers(0, getCallerIdFromCall(call));
}
/**
* Test-function #6 for the function "getCallerIdFromCall".
*/
void testGetCallerIdFromCall6()
{
char call[] = "*ECAV: 1,6,1,,,\"314571123453145711234531457112345\",145;";
compareUnsignedNumbers(0, getCallerIdFromCall(call));
}
#endif