Skip to content

Commit 88d2936

Browse files
changed test structure
1 parent 1e6b2f4 commit 88d2936

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

cpp4j/cpp4j.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ SOURCES += rationalnumber.cpp \
66
rationalnumberarray.cpp \
77
testRNA.cpp \
88
testCPP_RN.cpp \
9-
testRN.cpp
9+
testRN.cpp \
10+
testMain.cpp
1011

1112
HEADERS += \
1213
rationalnumber.h \

cpp4j/testMain.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <stdio.h>
2+
3+
4+
#include "rationalnumber.h"
5+
6+
#include "testRN.cpp"
7+
#include "testRNA.cpp"
8+
#include "testCPP_RN.cpp"
9+
10+
int main()
11+
{
12+
printf( "starting tests \n");
13+
testRN();
14+
testRNA();
15+
testCPP_RN();
16+
printf( "tests done \n");
17+
18+
return 0;
19+
}
20+

cpp4j/testRN.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
#include <assert.h>
77

88
#include "rationalnumber.h"
9-
#include "testRNA.cpp"
109

11-
#include "testCPP_RN.cpp"
1210

13-
int main()
11+
12+
void testRN()
1413
{
1514

1615
printf("Performing unit tests for RationalNumber...");
@@ -47,10 +46,5 @@ int main()
4746

4847
printf(" successful!\n");
4948

50-
testRNA();
51-
52-
testCPP_RN();
53-
54-
return 0;
5549
}
5650

0 commit comments

Comments
 (0)