Skip to content

Commit b86581a

Browse files
committed
new_tests_added_old_tests_fixed
1 parent d9ee6e3 commit b86581a

File tree

5 files changed

+57
-10
lines changed

5 files changed

+57
-10
lines changed

integration-tests/c-example/lib/different_variables.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,26 @@ void swap_four_int(int *a, int *b, int *c, int *d) {
1515
*d = p;
1616
}
1717

18-
void swap_two_double(float *a, float *b) {
18+
void swap_two_float(float *a, float *b) {
1919
float t = *a;
2020
*a = *b;
2121
*b = t;
2222
}
2323

24-
void swap_four_double(float *a, float *b, float *c, float *d) {
24+
void swap_four_float(float *a, float *b, float *c, float *d) {
2525
float t = *a;
2626
*a = *b;
2727
*b = t;
2828
float f = *c;
2929
*c = *d;
3030
*d = f;
3131
}
32+
33+
void swap_two_int_two_float(int *a, int *b, float *c, float *d) {
34+
int t = *a;
35+
*a = *b;
36+
*b = t;
37+
float f = *c;
38+
*c = *d;
39+
*d = f;
40+
}

integration-tests/c-example/lib/different_variables.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ void swap_two_int(int *a, int *b);
55

66
void swap_four_int(int *a, int *b, int *c, int *d);
77

8-
void swap_two_double(float *a, float *b);
8+
void swap_two_float(float *a, float *b);
99

10-
void swap_four_double(float *a, float *b, float *c, float *d);
10+
void swap_four_float(float *a, float *b, float *c, float *d);
11+
12+
void swap_two_int_and_two_float(int *a, int *b, float *c, float *d);
1113

1214
#endif //SIMPLE_TEST_PROJECT_DIFFERENT_VARIABLES_H

server/test/framework/Server_Tests.cpp

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ namespace {
199199
true, diffVars) &&
200200
testCase.stdinValue == std::nullopt;} }),
201201
methodName);
202-
} else if (methodName == "swap_two_double") {
202+
} else if (methodName == "swap_two_float") {
203203
checkTestCasePredicates(
204204
methodDescription.testCases,
205205
std::vector<TestCasePredicate>(
@@ -216,7 +216,7 @@ namespace {
216216
testCase.stdinValue == std::nullopt;
217217
} }),
218218
methodName);
219-
} else if (methodName == "swap_four_double") {
219+
} else if (methodName == "swap_four_float") {
220220
checkTestCasePredicates(
221221
methodDescription.testCases,
222222
std::vector<TestCasePredicate>(
@@ -240,6 +240,31 @@ namespace {
240240
false, diffVars) &&
241241
testCase.stdinValue == std::nullopt;} }),
242242
methodName);
243+
} else if (methodName == "swap_two_int_two_float") {
244+
checkTestCasePredicates(
245+
methodDescription.testCases,
246+
std::vector<TestCasePredicate>(
247+
{ [diffVars](tests::Tests::MethodTestCase const &testCase) {
248+
return commonSimpleChecker({testCase.paramValues[0]
249+
.view->getEntryValue(nullptr),
250+
testCase.paramPostValues[0]
251+
.view->getEntryValue(nullptr),
252+
testCase.paramValues[1]
253+
.view->getEntryValue(nullptr),
254+
testCase.paramPostValues[1]
255+
.view->getEntryValue(nullptr)},
256+
true, diffVars) &&
257+
commonSimpleChecker({testCase.paramValues[2]
258+
.view->getEntryValue(nullptr),
259+
testCase.paramPostValues[2]
260+
.view->getEntryValue(nullptr),
261+
testCase.paramValues[3]
262+
.view->getEntryValue(nullptr),
263+
testCase.paramPostValues[3]
264+
.view->getEntryValue(nullptr)},
265+
false, diffVars) &&
266+
testCase.stdinValue == std::nullopt;} }),
267+
methodName);
243268
}
244269
}
245270
}

server/test/suites/server/different_variables.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,26 @@ void swap_four_int(int *a, int *b, int *c, int *d) {
1515
*d = p;
1616
}
1717

18-
void swap_two_double(float *a, float *b) {
18+
void swap_two_float(float *a, float *b) {
1919
float t = *a;
2020
*a = *b;
2121
*b = t;
2222
}
2323

24-
void swap_four_double(float *a, float *b, float *c, float *d) {
24+
void swap_four_float(float *a, float *b, float *c, float *d) {
2525
float t = *a;
2626
*a = *b;
2727
*b = t;
2828
float f = *c;
2929
*c = *d;
3030
*d = f;
3131
}
32+
33+
void swap_two_int_two_float(int *a, int *b, float *c, float *d) {
34+
int t = *a;
35+
*a = *b;
36+
*b = t;
37+
float f = *c;
38+
*c = *d;
39+
*d = f;
40+
}

server/test/suites/server/different_variables.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ void swap_two_int(int *a, int *b);
55

66
void swap_four_int(int *a, int *b, int *c, int *d);
77

8-
void swap_two_double(float *a, float *b);
8+
void swap_two_float(float *a, float *b);
99

10-
void swap_four_double(float *a, float *b, float *c, float *d);
10+
void swap_four_float(float *a, float *b, float *c, float *d);
11+
12+
void swap_two_int_and_two_float(int *a, int *b, float *c, float *d);
1113

1214
#endif //SIMPLE_TEST_PROJECT_DIFFERENT_VARIABLES_H

0 commit comments

Comments
 (0)