| commit 675: | 51e4ba115fc5 |
| parent 674: | 2fb899d2f39c |
| branch: | new-ws2 |
Fixed build without MOO_ENABLE_UNIT_TESTS
---
moo/macros.h | 2 +
moo/mwarning.h | 4 +
mws/CMakeLists.txt | 22 ++--
mws/testdata/worksheet-3.xml | 316 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 334 insertions(+), 10 deletions(-)
create mode 100644 mws/testdata/worksheet-3.xml
14 months ago
Changed (Δ12.7 KB):
raw changeset »
moo/macros.h (2 lines added, 0 lines removed)
moo/mwarning.h (4 lines added, 0 lines removed)
mws/CMakeLists.txt (12 lines added, 10 lines removed)
mws/testdata/worksheet-3.xml (316 lines added, 0 lines removed)
14 |
14 |
|
15 |
15 |
#ifdef MOO_ENABLE_UNIT_TESTS |
16 |
16 |
|
17 |
#include <QString> |
|
18 |
||
17 |
19 |
namespace moo { |
18 |
20 |
namespace test { |
19 |
21 |
Up to file-list moo/mwarning.h:
1 |
#ifdef MOO_ENABLE_UNIT_TESTS |
|
2 |
||
1 |
3 |
#include <moo/macros.h> |
2 |
4 |
#include <QDebug> |
3 |
5 |
#include <QStringList> |
| … | … | @@ -72,3 +74,5 @@ void warning(const char *format, ...) |
72 |
74 |
|
73 |
75 |
} |
74 |
76 |
} |
77 |
||
78 |
#endif // MOO_ENABLE_UNIT_TESTS |
Up to file-list mws/CMakeLists.txt:
| … | … | @@ -68,13 +68,15 @@ ENDFOREACH(f) |
68 |
68 |
ADD_EXECUTABLE(mws-test EXCLUDE_FROM_ALL mws-test.cpp) |
69 |
69 |
TARGET_LINK_LIBRARIES(mws-test mws ${QT_LIBRARIES}) |
70 |
70 |
|
71 |
MOO_QT4_WRAP_QRC(mws_tests MWS_QRC_SOURCES mws-tests.qrc) |
|
72 |
ADD_EXECUTABLE(mws-tests |
|
73 |
mws-tests.cpp |
|
74 |
mws-tests.cpp.moc |
|
75 |
testdata/mws-tests-markup.h |
|
76 |
${MWS_QRC_SOURCES} |
|
77 |
) |
|
78 |
TARGET_LINK_LIBRARIES(mws-tests mws moo ${QT_LIBRARIES}) |
|
79 |
MOO_ADD_UNIT_TEST(worksheet mws-tests) |
|
80 |
MOO_WRAP_MOC_SOURCES(mws-tests.cpp) |
|
71 |
IF(MOO_ENABLE_UNIT_TESTS) |
|
72 |
MOO_QT4_WRAP_QRC(mws_tests MWS_QRC_SOURCES mws-tests.qrc) |
|
73 |
ADD_EXECUTABLE(mws-tests |
|
74 |
mws-tests.cpp |
|
75 |
mws-tests.cpp.moc |
|
76 |
testdata/mws-tests-markup.h |
|
77 |
${MWS_QRC_SOURCES} |
|
78 |
) |
|
79 |
TARGET_LINK_LIBRARIES(mws-tests mws moo ${QT_LIBRARIES}) |
|
80 |
MOO_ADD_UNIT_TEST(worksheet mws-tests) |
|
81 |
MOO_WRAP_MOC_SOURCES(mws-tests.cpp) |
|
82 |
ENDIF(MOO_ENABLE_UNIT_TESTS) |
Up to file-list mws/testdata/worksheet-3.xml:
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<ggap-worksheet version="2.1"> |
|
3 |
<content content-type="richtext"> |
|
4 |
<input id="1"> |
|
5 |
<p>MRead("lib/class.g");</p> |
|
6 |
<p>list := AdbGetList(4,2);;</p> |
|
7 |
</input> |
|
8 |
<input id="2" stdout="3"> |
|
9 |
<p>Length(list);</p> |
|
10 |
</input> |
|
11 |
<output id="3" type="out"> |
|
12 |
<p>14960</p> |
|
13 |
</output> |
|
14 |
<input id="4"> |
|
15 |
<p>list := Filtered(list, e -> not IsBound(e.equiv) and not IsBound(e.mineq));;</p> |
|
16 |
</input> |
|
17 |
<input id="5"> |
|
18 |
<p>list := Filtered(list, e -> e.fractal <> true);;</p> |
|
19 |
</input> |
|
20 |
<input id="6"> |
|
21 |
<p>list := Filtered(list, e -> e.finite <> true);;</p> |
|
22 |
</input> |
|
23 |
<input id="7" stdout="8"> |
|
24 |
<p>Length(list);</p> |
|
25 |
</input> |
|
26 |
<output id="8" type="out"> |
|
27 |
<p>2098</p> |
|
28 |
</output> |
|
29 |
<input id="9" stdout="10"> |
|
30 |
<p>e := list[1];</p> |
|
31 |
</input> |
|
32 |
<output id="10" type="out"> |
|
33 |
<p>rec( id := 65842, 2id := [ 749, 3 ], abelian := false, </p> |
|
34 |
<p> bunch := [ 65842, 71856, 72011, 80107, 202427, 211372, 212656, 471958 ], </p> |
|
35 |
<p> finite := false, fractal := false, </p> |
|
36 |
<p> rels := [ [ 3, -1, 3, -1 ], [ 3, 4, -1, 3, -4, -1 ] ], relsd := 3, </p> |
|
37 |
<p> table := [ [ 2, 1, (1,2) ], [ 4, 1, () ], [ 2, 1, () ], [ 1, 1, () ] ], </p> |
|
38 |
<p> torsionfree := false, done := false, size := infinity, contracting := fail, </p> |
|
39 |
<p> torsion := fail, sphtr := fail )</p> |
|
40 |
</output> |
|
41 |
<input id="11" stdout="12"> |
|
42 |
<p>g := AdbGroup(e);</p> |
|
43 |
</input> |
|
44 |
<output id="12" type="out"> |
|
45 |
<p>< a, b, c, d ></p> |
|
46 |
</output> |
|
47 |
<input id="13" stdout="14"> |
|
48 |
<p>s := ProjStab(g,1);</p> |
|
49 |
</input> |
|
50 |
<output id="14" type="out"> |
|
51 |
<p>< a, b, d ></p> |
|
52 |
</output> |
|
53 |
<input id="15" stdout="16"> |
|
54 |
<p>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</p> |
|
55 |
</input> |
|
56 |
<output id="16" type="out"> |
|
57 |
<p>infinity</p> |
|
58 |
</output> |
|
59 |
<input id="17" stdout="18"> |
|
60 |
<p>Index(g, s);</p> |
|
61 |
</input> |
|
62 |
<output id="18" type="out"> |
|
63 |
<p>user interrupt</p> |
|
64 |
</output> |
|
65 |
<input id="19"> |
|
66 |
<p>indices1 := List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),1))));;</p> |
|
67 |
</input> |
|
68 |
<input id="20"> |
|
69 |
<p>indices2 := List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),2))));;</p> |
|
70 |
</input> |
|
71 |
<input id="21"> |
|
72 |
<p></p> |
|
73 |
</input> |
|
74 |
<input id="22" stdout="23"> |
|
75 |
<p>DuplicateFreeList(indices1);</p> |
|
76 |
</input> |
|
77 |
<output id="23" type="out"> |
|
78 |
<p>[ infinity, 2 ]</p> |
|
79 |
</output> |
|
80 |
<input id="24" stdout="25"> |
|
81 |
<p>DuplicateFreeList(indices2);</p> |
|
82 |
</input> |
|
83 |
<output id="25" type="out"> |
|
84 |
<p>[ infinity, 2 ]</p> |
|
85 |
</output> |
|
86 |
<input id="26"> |
|
87 |
<p></p> |
|
88 |
</input> |
|
89 |
</content> |
|
90 |
<history> |
|
91 |
<item>DuplicateFreeList(indices2);</item> |
|
92 |
<item>DuplicateFreeList(indices1);</item> |
|
93 |
<item>? List</item> |
|
94 |
<item>indices2 := List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),2))));;</item> |
|
95 |
<item>indices2 := List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),2))));</item> |
|
96 |
<item>indices1 := List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),1))));;</item> |
|
97 |
<item>List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),1))));</item> |
|
98 |
<item>Index(g, s);</item> |
|
99 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
100 |
<item>s := ProjStab(g,1);</item> |
|
101 |
<item>g := AdbGroup(e);</item> |
|
102 |
<item>e := list[1];</item> |
|
103 |
<item>Length(list);</item> |
|
104 |
<item>list := Filtered(list, e -> e.finite <> true);;</item> |
|
105 |
<item>list := Filtered(list, e -> e.fractal <> true);;</item> |
|
106 |
<item>list := Filtered(list, e -> not IsBound(e.equiv) and not IsBound(e.mineq));;</item> |
|
107 |
<item>Length(list);</item> |
|
108 |
<item>MRead("lib/class.g"); |
|
109 |
list := AdbGetList(4,2);;</item> |
|
110 |
<item>e := list[1];</item> |
|
111 |
<item>Length(list);</item> |
|
112 |
<item>list := Filtered(list, e -> e.finite <> true);;</item> |
|
113 |
<item>list := Filtered(list, e -> e.fractal <> true);;</item> |
|
114 |
<item>list := Filtered(list, e -> not IsBound(e.equiv));;</item> |
|
115 |
<item>Length(list);</item> |
|
116 |
<item>AdbTrivialChecks(AdbGetList(4,2));</item> |
|
117 |
<item>MRead("lib/class.g"); |
|
118 |
list := AdbGetList(4,2);;</item> |
|
119 |
<item>e.finite;</item> |
|
120 |
<item>e.size;</item> |
|
121 |
<item>Length(list);</item> |
|
122 |
<item>list := Filtered(list, e -> e.finite <> true);;</item> |
|
123 |
<item>list := Filtered(list, e -> e.fractal <> true);;</item> |
|
124 |
<item>list := Filtered(list, e -> not IsBound(e.equiv));;</item> |
|
125 |
<item>Length(list);</item> |
|
126 |
<item>MRead("lib/class.g"); |
|
127 |
list := AdbGetList(4,2);;</item> |
|
128 |
<item>e.size := Size(g);</item> |
|
129 |
<item>AdbTrivialChecks(AdbGetList(4,2));</item> |
|
130 |
<item>e := list[1];</item> |
|
131 |
<item>Length(list);</item> |
|
132 |
<item>list := Filtered(list, e -> e.finite <> true);;</item> |
|
133 |
<item>list := Filtered(list, e -> e.fractal <> true);;</item> |
|
134 |
<item>list := Filtered(list, e -> not IsBound(e.equiv));;</item> |
|
135 |
<item>Length(list);</item> |
|
136 |
<item>MRead("lib/class.g"); |
|
137 |
list := AdbGetList(4,2);;</item> |
|
138 |
<item>e.size := Size(g);</item> |
|
139 |
<item>IsFinite(g);</item> |
|
140 |
<item>IsFractalByWords(g);</item> |
|
141 |
<item>Index(g, s);</item> |
|
142 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
143 |
<item>s := ProjStab(g,1);</item> |
|
144 |
<item>g := AdbGroup(e);</item> |
|
145 |
<item>e := list[1];</item> |
|
146 |
<item>Length(list);</item> |
|
147 |
<item>list := Filtered(list, e -> e.finite <> true);;</item> |
|
148 |
<item>list := Filtered(list, e -> e.fractal <> true);;</item> |
|
149 |
<item>list := Filtered(list, e -> not IsBound(e.equiv));;</item> |
|
150 |
<item>Length(list);</item> |
|
151 |
<item>MRead("lib/class.g"); |
|
152 |
list := AdbGetList(4,2);;</item> |
|
153 |
<item>List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),2))));</item> |
|
154 |
<item>List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),1))));</item> |
|
155 |
<item>Index(g, s);</item> |
|
156 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
157 |
<item>s := ProjStab(g,1);</item> |
|
158 |
<item>g := AdbGroup(e);</item> |
|
159 |
<item>e := list[1];</item> |
|
160 |
<item>Length(list);</item> |
|
161 |
<item>list := Filtered(list, e -> e.finite <> true);;</item> |
|
162 |
<item>list := Filtered(list, e -> e.fractal <> true);;</item> |
|
163 |
<item>list := Filtered(list, e -> not IsBound(e.equiv));;</item> |
|
164 |
<item>Length(list);</item> |
|
165 |
<item>MRead("lib/class.g"); |
|
166 |
list := AdbGetList(3,2);;</item> |
|
167 |
<item>List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),2))));</item> |
|
168 |
<item>List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),1))));</item> |
|
169 |
<item>Index(g, s);</item> |
|
170 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
171 |
<item>s := ProjStab(g,1);</item> |
|
172 |
<item>g := AdbGroup(e);</item> |
|
173 |
<item>e := list[1];</item> |
|
174 |
<item>Length(list);</item> |
|
175 |
<item>list := Filtered(list, e -> e.finite <> true);;</item> |
|
176 |
<item>list := Filtered(list, e -> e.fractal <> true);;</item> |
|
177 |
<item>list := Filtered(list, e -> not IsBound(e.equiv));;</item> |
|
178 |
<item>Length(list);</item> |
|
179 |
<item>MRead("lib/class.g"); |
|
180 |
list := AdbGetList(3,2);;</item> |
|
181 |
<item>AdbSave();</item> |
|
182 |
<item>AdbTrivialChecks(AdbGetList(3,2));</item> |
|
183 |
<item>AdbTrivialChecks();</item> |
|
184 |
<item>AdbSave();</item> |
|
185 |
<item>for e in AdbGetList(3,2) do |
|
186 |
g := AdbGroup(e); |
|
187 |
if not IsBound(e.equiv) and e.fractal <> true and IsFractalByWords(g) then |
|
188 |
e.fractal := true; |
|
189 |
fi; |
|
190 |
od;</item> |
|
191 |
<item>Position(list, e);</item> |
|
192 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
193 |
<item>s := ProjStab(g,1);</item> |
|
194 |
<item>g := AdbGroup(e);</item> |
|
195 |
<item>e := AdbEntry(783,3,2);</item> |
|
196 |
<item>for e in AdbGetList(3,2) do |
|
197 |
g := AdbGroup(e); |
|
198 |
if not IsBound(e.equiv) and e.fractal <> true and IsFractalByWords(g) then |
|
199 |
Display(e.id); |
|
200 |
fi; |
|
201 |
od;</item> |
|
202 |
<item>for e in AdbGetList(3,2) do |
|
203 |
g := AdbGroup(e); |
|
204 |
if e.fractal <> true and IsFractalByWords(g) then |
|
205 |
Display(e.id); |
|
206 |
fi; |
|
207 |
od;</item> |
|
208 |
<item>for e in AdbGetList(3,2) do |
|
209 |
g := AdbGroup(e); |
|
210 |
if IsFractalByWords(g) then |
|
211 |
Display(e.id); |
|
212 |
fi; |
|
213 |
od;</item> |
|
214 |
<item>IsFractalByWords(AdbGroup(e));</item> |
|
215 |
<item>e := list[56];</item> |
|
216 |
<item>Length(list);</item> |
|
217 |
<item>List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),2))));</item> |
|
218 |
<item>List(list, e -> Index(UnderlyingFreeSubgroup(AdbGroup(e)), UnderlyingFreeSubgroup(ProjStab(AdbGroup(e),1))));</item> |
|
219 |
<item>Index(g, s);</item> |
|
220 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
221 |
<item>s := ProjStab(g,1);</item> |
|
222 |
<item>g := AdbGroup(e);</item> |
|
223 |
<item>e := list[6];</item> |
|
224 |
<item>Index(g, s);</item> |
|
225 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
226 |
<item>s := ProjStab(g,1);</item> |
|
227 |
<item>g := AdbGroup(e);</item> |
|
228 |
<item>e := list[5];</item> |
|
229 |
<item>Length(list);</item> |
|
230 |
<item>list := Filtered(list, e -> e.finite <> true);;</item> |
|
231 |
<item>Index(g, s);</item> |
|
232 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
233 |
<item>s := ProjStab(g,1);</item> |
|
234 |
<item>g := AdbGroup(e);</item> |
|
235 |
<item>e := list[5];</item> |
|
236 |
<item>Index(g, s);</item> |
|
237 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
238 |
<item>s := ProjStab(g,1);</item> |
|
239 |
<item>g := AdbGroup(e);</item> |
|
240 |
<item>e := list[4];</item> |
|
241 |
<item>Index(g, s);</item> |
|
242 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
243 |
<item>s := ProjStab(g,1);</item> |
|
244 |
<item>g := AdbGroup(e);</item> |
|
245 |
<item>e := list[3];</item> |
|
246 |
<item>Index(g, s);</item> |
|
247 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
248 |
<item>s := ProjStab(g,1);</item> |
|
249 |
<item>g := AdbGroup(e);</item> |
|
250 |
<item>e := list[2];</item> |
|
251 |
<item>Index(g, s);</item> |
|
252 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
253 |
<item>s := ProjStab(g,1);</item> |
|
254 |
<item>g := AdbGroup(e);</item> |
|
255 |
<item>e := list[1];</item> |
|
256 |
<item>Index(g, s);</item> |
|
257 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
258 |
<item>s := ProjStab(g,1);</item> |
|
259 |
<item>g := AdbGroup(e);</item> |
|
260 |
<item>Index(g, last);</item> |
|
261 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
262 |
<item>ProjStab(g,1);</item> |
|
263 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
264 |
<item>g := AdbGroup(e);</item> |
|
265 |
<item>e := list[8];</item> |
|
266 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
267 |
<item>ProjStab(g,1);</item> |
|
268 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
269 |
<item>g := AdbGroup(e);</item> |
|
270 |
<item>e := list[7];</item> |
|
271 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
272 |
<item>ProjStab(g,1);</item> |
|
273 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
274 |
<item>g := AdbGroup(e);</item> |
|
275 |
<item>e := list[6];</item> |
|
276 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
277 |
<item>ProjStab(g,1);</item> |
|
278 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
279 |
<item>g := AdbGroup(e);</item> |
|
280 |
<item>e := list[5];</item> |
|
281 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
282 |
<item>ProjStab(g,1);</item> |
|
283 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
284 |
<item>g := AdbGroup(e);</item> |
|
285 |
<item>e := list[4];</item> |
|
286 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
287 |
<item>ProjStab(g,1);</item> |
|
288 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
289 |
<item>g := AdbGroup(e);</item> |
|
290 |
<item>e := list[3];</item> |
|
291 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
292 |
<item>ProjStab(g,1);</item> |
|
293 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
294 |
<item>g := AdbGroup(e);</item> |
|
295 |
<item>e := list[2];</item> |
|
296 |
<item>Index(UnderlyingFreeSubgroup(g), UnderlyingFreeSubgroup(last));</item> |
|
297 |
<item>Index(g, last);</item> |
|
298 |
<item>ProjStab(g,1);</item> |
|
299 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
300 |
<item>g := AdbGroup(list[1]);</item> |
|
301 |
<item>Index(g, last);</item> |
|
302 |
<item>IndexInParent(last);</item> |
|
303 |
<item>ProjStab(g,1);</item> |
|
304 |
<item>s := StabilizerOfFirstLevel(g);</item> |
|
305 |
<item>g := AdbGroup(list[1]);</item> |
|
306 |
<item>list[1];</item> |
|
307 |
<item>Length(list);</item> |
|
308 |
<item>list := Filtered(list, e -> e.fractal <> true);;</item> |
|
309 |
<item>list[1];</item> |
|
310 |
<item>Length(list);</item> |
|
311 |
<item>list := Filtered(list, e -> not IsBound(e.equiv));;</item> |
|
312 |
<item>Length(list);</item> |
|
313 |
<item>MRead("lib/class.g"); |
|
314 |
list := AdbGetList(3,2);;</item> |
|
315 |
</history> |
|
316 |
</ggap-worksheet> |
