-
Notifications
You must be signed in to change notification settings - Fork 0
/
newCxxTest.h
44 lines (37 loc) · 1.19 KB
/
newCxxTest.h
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: newCxxTest.h
* Author: hloi
*
* Created on January 26, 2018, 3:52 PM
*/
#ifndef NEWCXXTEST_H
#define NEWCXXTEST_H
#include <cxxtest/TestSuite.h>
//Include your classes header file(s) below and uncomment.
//#include "myClass.h"
#include "LinkedListNode.h"
class newCxxTest : public CxxTest::TestSuite {
public:
//All tests should start with the word 'test' followed by
//the name of the function being tested.
void testLinkedListNode() {
//Use TS_ASSERT_EQUALS(Result, ExpResult) to test your functions.
LinkedListNode* node1 = new LinkedListNode(10);
TS_ASSERT_EQUALS(10, node1->getData());
LinkedListNode* node2 = new LinkedListNode(20);
TS_ASSERT_EQUALS(20, node2->getData());
node1->setNext(node2);
LinkedListNode* tmp = node1->getNext();
TS_ASSERT_EQUALS(20, tmp->getData());
tmp->setData(30);
TS_ASSERT_EQUALS(30, tmp->getData());
delete node1;
delete node2;
}
};
#endif /* NEWCXXTEST_H */