6 TEST_CASE(TestCaseSnippet
);
11 text
.addLine(new QString("Line1"));
12 text
.addLine(new QString("Line2"));
13 text
.addLine(new QString("Line3"));
14 text
.addLine(new QString("Line4"));
15 text
.addLine(new QString("Line5"));
17 text2
.addLine(new QString("L1"));
18 text2
.addLine(new QString("L2"));
19 text2
.addLine(new QString("L3"));
20 text2
.addLine(new QString("L4"));
21 text2
.addLine(new QString("L5"));
24 void testConstructors()
26 Context
context(new Text(text
));
27 Context
context2(context
);
28 assertEquals(context
.original(), context
.modified());
29 assertEquals(context
.original(), context2
.original());
31 Added
added(new Text(text
));
33 assertEquals(added
.original().numLines(), 0);
34 assertEquals(added
.modified(), added2
.modified());
36 Deleted
deleted(new Text(text
));
37 Deleted
deleted2(deleted
);
38 assertEquals(deleted
.modified().numLines(), 0);
39 assertEquals(deleted
.original(), deleted2
.original());
41 Changed
changed(new Text(text
), new Text(text2
));
42 Changed
changed2(changed
);
43 assertEquals(changed
.original(), changed2
.original());
44 assertEquals(changed
.modified(), changed2
.modified());
49 Context
context(new Text(text
));
50 Context context2
= context
;
51 assertEquals(context
.original(), context2
.original());
52 assertEquals(context
.modified(), context2
.modified());
53 assertEquals(context
, context2
);
55 Added
added(new Text(text
));
57 assertEquals(added
.original(), added2
.original());
58 assertEquals(added
.modified(), added2
.modified());
59 assertNotEquals(added
, context
);
63 REG_TEST(testConstructors
);
64 REG_TEST(testOperators
);