Changeset View
Changeset View
Standalone View
Standalone View
autotests/ElementsTest.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 106 | { | |||
---|---|---|---|---|---|
137 | QCOMPARE(lbl3.text(), "text2"); | 137 | QCOMPARE(lbl3.text(), "text2"); | ||
138 | QCOMPARE(lbl1.text(), ""); // lbl1 unaffected | 138 | QCOMPARE(lbl1.text(), ""); // lbl1 unaffected | ||
139 | } | 139 | } | ||
140 | 140 | | |||
141 | void ElementsTest::testSections() | 141 | void ElementsTest::testSections() | ||
142 | { | 142 | { | ||
143 | // types | 143 | // types | ||
144 | KReportSection sec1; | 144 | KReportSection sec1; | ||
145 | QCOMPARE(sec1.type(), KReportSection::InvalidType); | 145 | QCOMPARE(sec1.type(), KReportSection::Type::Invalid); | ||
146 | QCOMPARE(KReportSection(sec1).type(), KReportSection::InvalidType); | 146 | QCOMPARE(KReportSection(sec1).type(), KReportSection::Type::Invalid); | ||
147 | sec1.setType(KReportSection::PageFooterFirst); | 147 | sec1.setType(KReportSection::Type::PageFooterFirst); | ||
148 | KReportSection sec2(sec1); | 148 | KReportSection sec2(sec1); | ||
149 | QCOMPARE(sec1.type(), sec2.type()); | 149 | QCOMPARE(sec1.type(), sec2.type()); | ||
150 | QCOMPARE(sec1, sec2); | 150 | QCOMPARE(sec1, sec2); | ||
151 | sec1.setType(KReportSection::PageFooterEven); | 151 | sec1.setType(KReportSection::Type::PageFooterEven); | ||
152 | QCOMPARE(sec1.type(), sec2.type()); // shared | 152 | QCOMPARE(sec1.type(), sec2.type()); // shared | ||
153 | QCOMPARE(sec1, sec2); // shared | 153 | QCOMPARE(sec1, sec2); // shared | ||
154 | 154 | | |||
155 | // height | 155 | // height | ||
156 | KReportSection::setDefaultHeight(-1); // sanity: reset | 156 | KReportSection::setDefaultHeight(-1); // sanity: reset | ||
157 | QCOMPARE(sec1.height(), KReportSection::defaultHeight()); // initially: default height | 157 | QCOMPARE(sec1.height(), KReportSection::defaultHeight()); // initially: default height | ||
158 | KReportSection::setDefaultHeight(CM_TO_POINT(10.0)); // sanity: reset | 158 | KReportSection::setDefaultHeight(CM_TO_POINT(10.0)); // sanity: reset | ||
159 | QCOMPARE(KReportSection::defaultHeight(), CM_TO_POINT(10.0)); | 159 | QCOMPARE(KReportSection::defaultHeight(), CM_TO_POINT(10.0)); | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |