~ubuntu-branches/ubuntu/maverick/uim/maverick

« back to all changes in this revision

Viewing changes to sigscheme/doc/test-c.html

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2008-05-18 22:18:10 UTC
  • mfrom: (1.1.8 upstream)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20080518221810-4d2rd0ca18xnu8kc
Tags: 1:1.5.1-1
* New upstream release
* uim-qt3: Add uim inputcontext plugin for Qt3. And due to uim-*-qt are
  not supported in Qt4 for now officially, uim-*-qt are contained in
  this package.
* uim-qt: Depends uim-qt3 because of described above.
* libuim6: New package for syncing with upstream upgrade soversion.
* 05_qmake_bug_workaround.dpatch: patch for the workaround that qmake does
  not add link option against other libraries(e.g. -lX11) by default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2
 
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4
 
<head>
5
 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
 
<meta name="generator" content="AsciiDoc 8.2.1" />
7
 
<style type="text/css">
8
 
/* Debug borders */
9
 
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10
 
/*
11
 
  border: 1px solid red;
12
 
*/
13
 
}
14
 
 
15
 
body {
16
 
  margin: 1em 5% 1em 5%;
17
 
}
18
 
 
19
 
a {
20
 
  color: blue;
21
 
  text-decoration: underline;
22
 
}
23
 
a:visited {
24
 
  color: fuchsia;
25
 
}
26
 
 
27
 
em {
28
 
  font-style: italic;
29
 
}
30
 
 
31
 
strong {
32
 
  font-weight: bold;
33
 
}
34
 
 
35
 
tt {
36
 
  color: navy;
37
 
}
38
 
 
39
 
h1, h2, h3, h4, h5, h6 {
40
 
  color: #527bbd;
41
 
  font-family: sans-serif;
42
 
  margin-top: 1.2em;
43
 
  margin-bottom: 0.5em;
44
 
  line-height: 1.3;
45
 
}
46
 
 
47
 
h1 {
48
 
  border-bottom: 2px solid silver;
49
 
}
50
 
h2 {
51
 
  border-bottom: 2px solid silver;
52
 
  padding-top: 0.5em;
53
 
}
54
 
 
55
 
div.sectionbody {
56
 
  font-family: serif;
57
 
  margin-left: 0;
58
 
}
59
 
 
60
 
hr {
61
 
  border: 1px solid silver;
62
 
}
63
 
 
64
 
p {
65
 
  margin-top: 0.5em;
66
 
  margin-bottom: 0.5em;
67
 
}
68
 
 
69
 
pre {
70
 
  padding: 0;
71
 
  margin: 0;
72
 
}
73
 
 
74
 
span#author {
75
 
  color: #527bbd;
76
 
  font-family: sans-serif;
77
 
  font-weight: bold;
78
 
  font-size: 1.1em;
79
 
}
80
 
span#email {
81
 
}
82
 
span#revision {
83
 
  font-family: sans-serif;
84
 
}
85
 
 
86
 
div#footer {
87
 
  font-family: sans-serif;
88
 
  font-size: small;
89
 
  border-top: 2px solid silver;
90
 
  padding-top: 0.5em;
91
 
  margin-top: 4.0em;
92
 
}
93
 
div#footer-text {
94
 
  float: left;
95
 
  padding-bottom: 0.5em;
96
 
}
97
 
div#footer-badges {
98
 
  float: right;
99
 
  padding-bottom: 0.5em;
100
 
}
101
 
 
102
 
div#preamble,
103
 
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
104
 
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
105
 
div.admonitionblock {
106
 
  margin-right: 10%;
107
 
  margin-top: 1.5em;
108
 
  margin-bottom: 1.5em;
109
 
}
110
 
div.admonitionblock {
111
 
  margin-top: 2.5em;
112
 
  margin-bottom: 2.5em;
113
 
}
114
 
 
115
 
div.content { /* Block element content. */
116
 
  padding: 0;
117
 
}
118
 
 
119
 
/* Block element titles. */
120
 
div.title, caption.title {
121
 
  font-family: sans-serif;
122
 
  font-weight: bold;
123
 
  text-align: left;
124
 
  margin-top: 1.0em;
125
 
  margin-bottom: 0.5em;
126
 
}
127
 
div.title + * {
128
 
  margin-top: 0;
129
 
}
130
 
 
131
 
td div.title:first-child {
132
 
  margin-top: 0.0em;
133
 
}
134
 
div.content div.title:first-child {
135
 
  margin-top: 0.0em;
136
 
}
137
 
div.content + div.title {
138
 
  margin-top: 0.0em;
139
 
}
140
 
 
141
 
div.sidebarblock > div.content {
142
 
  background: #ffffee;
143
 
  border: 1px solid silver;
144
 
  padding: 0.5em;
145
 
}
146
 
 
147
 
div.listingblock {
148
 
  margin-right: 0%;
149
 
}
150
 
div.listingblock > div.content {
151
 
  border: 1px solid silver;
152
 
  background: #f4f4f4;
153
 
  padding: 0.5em;
154
 
}
155
 
 
156
 
div.quoteblock > div.content {
157
 
  padding-left: 2.0em;
158
 
}
159
 
 
160
 
div.attribution {
161
 
  text-align: right;
162
 
}
163
 
div.verseblock + div.attribution {
164
 
  text-align: left;
165
 
}
166
 
 
167
 
div.admonitionblock .icon {
168
 
  vertical-align: top;
169
 
  font-size: 1.1em;
170
 
  font-weight: bold;
171
 
  text-decoration: underline;
172
 
  color: #527bbd;
173
 
  padding-right: 0.5em;
174
 
}
175
 
div.admonitionblock td.content {
176
 
  padding-left: 0.5em;
177
 
  border-left: 2px solid silver;
178
 
}
179
 
 
180
 
div.exampleblock > div.content {
181
 
  border-left: 2px solid silver;
182
 
  padding: 0.5em;
183
 
}
184
 
 
185
 
div.verseblock div.content {
186
 
  white-space: pre;
187
 
}
188
 
 
189
 
div.imageblock div.content { padding-left: 0; }
190
 
div.imageblock img { border: 1px solid silver; }
191
 
span.image img { border-style: none; }
192
 
 
193
 
dl {
194
 
  margin-top: 0.8em;
195
 
  margin-bottom: 0.8em;
196
 
}
197
 
dt {
198
 
  margin-top: 0.5em;
199
 
  margin-bottom: 0;
200
 
  font-style: italic;
201
 
}
202
 
dd > *:first-child {
203
 
  margin-top: 0;
204
 
}
205
 
 
206
 
ul, ol {
207
 
    list-style-position: outside;
208
 
}
209
 
ol.olist2 {
210
 
  list-style-type: lower-alpha;
211
 
}
212
 
 
213
 
div.tableblock > table {
214
 
  border: 3px solid #527bbd;
215
 
}
216
 
thead {
217
 
  font-family: sans-serif;
218
 
  font-weight: bold;
219
 
}
220
 
tfoot {
221
 
  font-weight: bold;
222
 
}
223
 
 
224
 
div.hlist {
225
 
  margin-top: 0.8em;
226
 
  margin-bottom: 0.8em;
227
 
}
228
 
div.hlist td {
229
 
  padding-bottom: 5px;
230
 
}
231
 
td.hlist1 {
232
 
  vertical-align: top;
233
 
  font-style: italic;
234
 
  padding-right: 0.8em;
235
 
}
236
 
td.hlist2 {
237
 
  vertical-align: top;
238
 
}
239
 
 
240
 
@media print {
241
 
  div#footer-badges { display: none; }
242
 
}
243
 
 
244
 
div#toctitle {
245
 
  color: #527bbd;
246
 
  font-family: sans-serif;
247
 
  font-size: 1.1em;
248
 
  font-weight: bold;
249
 
  margin-top: 1.0em;
250
 
  margin-bottom: 0.1em;
251
 
}
252
 
 
253
 
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
254
 
  margin-top: 0;
255
 
  margin-bottom: 0;
256
 
}
257
 
div.toclevel2 {
258
 
  margin-left: 2em;
259
 
  font-size: 0.9em;
260
 
}
261
 
div.toclevel3 {
262
 
  margin-left: 4em;
263
 
  font-size: 0.9em;
264
 
}
265
 
div.toclevel4 {
266
 
  margin-left: 6em;
267
 
  font-size: 0.9em;
268
 
}
269
 
/* Workarounds for IE6's broken and incomplete CSS2. */
270
 
 
271
 
div.sidebar-content {
272
 
  background: #ffffee;
273
 
  border: 1px solid silver;
274
 
  padding: 0.5em;
275
 
}
276
 
div.sidebar-title, div.image-title {
277
 
  font-family: sans-serif;
278
 
  font-weight: bold;
279
 
  margin-top: 0.0em;
280
 
  margin-bottom: 0.5em;
281
 
}
282
 
 
283
 
div.listingblock div.content {
284
 
  border: 1px solid silver;
285
 
  background: #f4f4f4;
286
 
  padding: 0.5em;
287
 
}
288
 
 
289
 
div.quoteblock-content {
290
 
  padding-left: 2.0em;
291
 
}
292
 
 
293
 
div.exampleblock-content {
294
 
  border-left: 2px solid silver;
295
 
  padding-left: 0.5em;
296
 
}
297
 
 
298
 
/* IE6 sets dynamically generated links as visited. */
299
 
div#toc a:visited { color: blue; }
300
 
</style>
301
 
<title>Unit tests for C</title>
302
 
</head>
303
 
<body>
304
 
<div id="header">
305
 
<h1>Unit tests for C</h1>
306
 
</div>
307
 
<h2>1. About</h2>
308
 
<div class="sectionbody">
309
 
<p>The <tt>sigscheme/test-c/</tt> directory is existing for unit testing for C. The tests
310
 
are currently using our own testing framework. See test-c/README for further
311
 
information.</p>
312
 
</div>
313
 
<h2>2. Requirements for testing framework</h2>
314
 
<div class="sectionbody">
315
 
<p>I had tried to use the famous <a href="http://cunit.sf.net/">CUnit</a> at first to test
316
 
SigScheme, but it did not met my requirements and needs long way to modify to
317
 
fit to SigScheme. So I searched for other testing frameworks and once decided
318
 
to modify
319
 
<a href="http://www.cozmixng.org/~rwiki/?cmd=view;name=Cutter%3A%3AREADME.en">Cutter</a>.
320
 
Please let me know better solutions if you know.</p>
321
 
<ul>
322
 
<li>
323
 
<p>
324
 
Written in pure C
325
 
</p>
326
 
<ul>
327
 
<li>
328
 
<p>
329
 
To avoid C++-specific interferences especially stacks, frames
330
 
      and exceptions with GC
331
 
</p>
332
 
</li>
333
 
<li>
334
 
<p>
335
 
To allow running tests on platforms that has poor or no C++ support
336
 
</p>
337
 
</li>
338
 
</ul>
339
 
</li>
340
 
<li>
341
 
<p>
342
 
Don't terminate a test even if an assertion is failed
343
 
</p>
344
 
</li>
345
 
<li>
346
 
<p>
347
 
Prints the expected and actual values when an assertion failed, as follows
348
 
</p>
349
 
</li>
350
 
</ul>
351
 
<div class="listingblock">
352
 
<div class="content">
353
 
<pre><tt>./test_format.c:64: - format ~D -
354
 
expected: &lt;0&gt;
355
 
 but was: &lt;2147483647&gt;</tt></pre>
356
 
</div></div>
357
 
<ul>
358
 
<li>
359
 
<p>
360
 
Standalone test runner
361
 
</p>
362
 
<div class="literalblock">
363
 
<div class="content">
364
 
<pre><tt>i.e. There is no need to write the main function for each test.</tt></pre>
365
 
</div></div>
366
 
</li>
367
 
<li>
368
 
<p>
369
 
Automatic testsuite configuration
370
 
</p>
371
 
<div class="literalblock">
372
 
<div class="content">
373
 
<pre><tt>i.e. There is no need to register all tests into a testsuite by hand.</tt></pre>
374
 
</div></div>
375
 
</li>
376
 
<li>
377
 
<p>
378
 
It can be inserted SCM_GC_PROTECTED_CALL() on each tests
379
 
</p>
380
 
</li>
381
 
</ul>
382
 
<p>And some recommendations:</p>
383
 
<ul>
384
 
<li>
385
 
<p>
386
 
Small and Simple
387
 
</p>
388
 
</li>
389
 
<li>
390
 
<p>
391
 
Assertions macro names are short
392
 
</p>
393
 
</li>
394
 
<li>
395
 
<p>
396
 
Assertions have assert(expected, actual) form instead of
397
 
    assert(actual, expected)
398
 
</p>
399
 
</li>
400
 
</ul>
401
 
</div>
402
 
<div id="footer">
403
 
<div id="footer-text">
404
 
Last updated 20-Feb-2008 21:35:22 JST
405
 
</div>
406
 
</div>
407
 
</body>
408
 
</html>