-
Notifications
You must be signed in to change notification settings - Fork 0
/
hw2test.c
57 lines (42 loc) · 1.4 KB
/
hw2test.c
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
#include <stdio.h>
#include "my_functions.h"
#include "functions.h"
void testTask1();
int main()
{
testTask1();
return 0;
}
void testTask1()
{
char buffer[256];
assertInt("Line 1 int", 0, read_line(0, buffer));
assertString("Line 1 str", "Son son", buffer);
clearStr(buffer);
assertInt("Line 2 int", -2, read_line(0, buffer));
assertInt("Line 3 int", 2, read_line(0, buffer));
assertString("Line 3 str", "Father", buffer);
clearStr(buffer);
assertInt("Line 4 int", 1, read_line(0, buffer));
assertString("Line 1 str", "Mother", buffer);
clearStr(buffer);
assertInt("Line 5 int", 0, read_line(0, buffer));
assertString("Line 5 str", "Father", buffer);
clearStr(buffer);
assertInt("Line 6 int", -2, read_line(0, buffer));
assertInt("Line 7 int", 1, read_line(0, buffer));
assertString("Line 7 str", "Granny", buffer);
clearStr(buffer);
assertInt("Line 8 int", -2, read_line(0, buffer));
assertInt("Line 9 int", 0, read_line(0, buffer));
assertString("Line 9 str", "OtherSon", buffer);
clearStr(buffer);
assertInt("Line 10 int", 1, read_line(0, buffer));
assertString("Line 10 str", "OtherMother", buffer);
clearStr(buffer);
assertInt("Line 11 int", 2, read_line(0, buffer));
assertString("Line 11 str", "OtherFather", buffer);
clearStr(buffer);
assertInt("Empty/no line", -1, read_line(0, buffer));
assertInt("Empty/no line", -1, read_line(0, buffer));
}