Few small changes.
[qshowdiff.git] / tests / text.cpp
blob9db13ec5e529380acc82ad979d318b23595a47c1
1 #include <cppu.h>
2 #include <iostream>
3 using namespace std;
5 #include "text.h"
7 TEST_CASE(TestCaseText);
9 Text t;
10 void setUp()
12 t.addLine(new QString("Line1"));
13 t.addLine(new QString("Line2"));
14 t.addLine(new QString("Line3"));
15 t.addLine(new QString("Line4"));
18 void testAdd()
20 Text t2;
21 t2.addLine(new QString("Line1"));
22 t2.addLine(new QString("Line2"));
24 assertEquals(t2.numLines(), 2);
27 void testConstruct()
29 Text t2(t);
30 Text *t3 = new Text(t2);
31 Text *t4 = new Text(*t3);
32 delete t3;
33 delete t4;
36 void testOperators()
38 Text t2;
39 t2 = t;
40 assertTrue(t.numLines() == t2.numLines());
41 assertTrue(t == t2);
42 Text t3;
43 assertTrue(t != t3);
47 TESTS{
48 REG_TEST(testAdd);
49 REG_TEST(testConstruct);
50 REG_TEST(testOperators);
52 TEST_CASE_END;