MCPcopy Create free account
hub / github.com/YatSenOS/YatSenOS-Tutorial-Volume-1 / main

Function main

lab2/assignment/test.cpp:71–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70
71int main() {
72
73 student_setting();
74
75
76
77 // init
78
79 std::cout << ">>> begin test" << std::endl;
80
81 if_flag = 0;
82
83
84
85 if(a2 >= 12) {
86
87 while_flag = new char[a2 - 12 + 1];
88
89 random_buffer = new char[a2 - 12 + 1];
90
91 if(!while_flag || !random_buffer) {
92
93 std::cout << "test can not run" << std::endl;
94
95 exit(-1);
96
97 }
98
99 memset(while_flag, 0, a2 - 12 + 1);
100
101 memset(random_buffer, 0, a2 - 12 + 1);
102
103 }
104
105
106
107 student_function();
108
109
110
111 if(a1 < 12) {
112
113 if (if_flag != a1 / 2 + 1) {
114
115 test_failed();
116
117 }
118
119 } else if(a1 < 24) {
120
121 if (if_flag != (24 - a1) * a1) {
122
123 test_failed();
124
125 }
126
127 } else {
128

Callers

nothing calls this directly

Calls 4

student_settingFunction · 0.85
test_failedFunction · 0.85
exitFunction · 0.50
memsetFunction · 0.50

Tested by

no test coverage detected