-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.c
More file actions
52 lines (42 loc) · 868 Bytes
/
test.c
File metadata and controls
52 lines (42 loc) · 868 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
51
52
#include <stdio.h>
#include <string.h>
#include "db.h"
int main()
{
attend_rec a;
clear_db();
printf("************* Database Test ******************\n");
printf("Testing find(sno):\n");
a = find(11);
if (-1 == a.present) {
printf("Student 11 not found\n");
} else {
printf ("Found student 11!!!\n");
}
printf("\n");
printf("Testing add(rec):\n");
a.sno = 11;
strcpy(a.name, "Alice");
a.present = TRUE;
add(a);
a = find(11);
printf_attend(a);
printf("Testing list():\n");
list();
printf("Testing initialize_db():\n");
initialize_db();
list();
printf("Testing modify(rec):\n");
strcpy(a.name, "Alice TestUser");
a.present = FALSE;
modify(a);
a = find(11);
printf_attend(a);
list();
printf("Testing delete(sno):\n");
delete(11);
a = find(11);
printf_attend(a);
list();
return 0;
}