Skip to content

Commit 50783ab

Browse files
committed
reorganized test.cpp into test cases.
1 parent d0c6f5c commit 50783ab

1 file changed

Lines changed: 31 additions & 13 deletions

File tree

test.cpp

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,17 @@
99
#include "DSStack/dsstack.h"
1010
#include "DSDoublyLL/dsdoublyll.h"
1111

12-
TEST_CASE("Data_Structures_Test", "[Data_Structures_Test]"){
13-
1412
/*
15-
* Set Variables
13+
* DSString
1614
*/
17-
15+
TEST_CASE("Data_Structures_String", "[String][Data_Structures_Test]"){
1816
const int intArray1[3] = {0, 1, 2};
1917
int arr1StartSize = 3;
2018
const int intArray2[3] = {3, 4, 5};
2119
int arr2StartSize = 3;
2220
const int intArray3[6] = {0, 1, 2, 3, 4, 5};
2321
int arr3StartSize = 6;
2422

25-
/*
26-
* DSString
27-
*/
28-
2923
DSString* testStringArray[3];
3024

3125
testStringArray[0] = new DSString("test1");
@@ -157,10 +151,18 @@ TEST_CASE("Data_Structures_Test", "[Data_Structures_Test]"){
157151
clearFile.open(filePath.c_str());
158152
clearFile.close();
159153
}
154+
}
160155

161-
/*
156+
/*
162157
* DSVector
163158
*/
159+
TEST_CASE("Data_Structures_Vector", "[Vector][Data_Structures_Test]"){
160+
const int intArray1[3] = {0, 1, 2};
161+
int arr1StartSize = 3;
162+
const int intArray2[3] = {3, 4, 5};
163+
int arr2StartSize = 3;
164+
const int intArray3[6] = {0, 1, 2, 3, 4, 5};
165+
int arr3StartSize = 6;
164166

165167
DSVector<int> numVect1(8);
166168
DSVector<int> numVect1Copy;
@@ -249,10 +251,18 @@ TEST_CASE("Data_Structures_Test", "[Data_Structures_Test]"){
249251

250252
numVect1 = numVect1Copy;
251253
}
254+
}
252255

253256
/*
254-
* DSStack
257+
* DSStack
255258
*/
259+
TEST_CASE("Data_Structures_Stack", "[Stack][Data_Structures_Test]"){
260+
const int intArray1[3] = {0, 1, 2};
261+
int arr1StartSize = 3;
262+
const int intArray2[3] = {3, 4, 5};
263+
int arr2StartSize = 3;
264+
const int intArray3[6] = {0, 1, 2, 3, 4, 5};
265+
int arr3StartSize = 6;
256266

257267
DSStack<int> numStack1(4);
258268
DSStack<int> numStack1Copy;
@@ -334,9 +344,19 @@ TEST_CASE("Data_Structures_Test", "[Data_Structures_Test]"){
334344
numStack1 = numStack1Copy;
335345
}
336346

347+
348+
}
349+
337350
/*
338-
* DSDoublyLL
351+
* DSDoublyLL
339352
*/
353+
TEST_CASE("Data_Structures_Doubly_Linked_List", "[Doubly_Linked_List][Data_Structures_Test]"){
354+
const int intArray1[3] = {0, 1, 2};
355+
int arr1StartSize = 3;
356+
const int intArray2[3] = {3, 4, 5};
357+
int arr2StartSize = 3;
358+
const int intArray3[6] = {0, 1, 2, 3, 4, 5};
359+
int arr3StartSize = 6;
340360

341361
DSDoublyLL<int> numList1;
342362
DSDoublyLL<int> numList1Copy;
@@ -412,7 +432,5 @@ TEST_CASE("Data_Structures_Test", "[Data_Structures_Test]"){
412432
REQUIRE(numList3 == numList2);
413433

414434
numList3 = numList1 + numList2;
415-
416435
}
417-
418436
}

0 commit comments

Comments
 (0)