~ubuntu-branches/debian/experimental/inkscape/experimental

« back to all changes in this revision

Viewing changes to src/attributes-test.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#include <cxxtest/TestSuite.h>
6
6
 
7
7
#include <vector>
 
8
#include <glib.h>
 
9
#include <glib/gprintf.h>
8
10
#include "utest/utest.h"
9
11
#include "attributes.h"
10
12
#include "streq.h"
50
52
    {"accumulate", true},
51
53
    {"alignment-baseline", true},
52
54
    {"alphabetic", false},
53
 
    {"amplitude", false},
 
55
    {"amplitude", true},
54
56
    {"animate", false},
55
57
    {"arabic-form", false},
56
58
    {"ascent", false},
57
59
    {"attributeType", true},
58
 
    {"azimuth", false},
59
 
    {"baseFrequency", false},
 
60
    {"azimuth", true},
 
61
    {"baseFrequency", true},
60
62
    {"baseline-shift", true},
61
63
    {"baseProfile", false},
62
64
    {"bbox", false},
63
 
    {"bias", false},
 
65
    {"bias", true},
64
66
    {"block-progression", true},
65
67
    {"by", true},
66
68
    {"calcMode", true},
82
84
    {"cy", true},
83
85
    {"d", true},
84
86
    {"descent", false},
85
 
    {"diffuseConstant", false},
 
87
    {"diffuseConstant", true},
86
88
    {"direction", true},
87
89
    {"display", true},
88
 
    {"divisor", false},
 
90
    {"divisor", true},
89
91
    {"dominant-baseline", true},
90
92
    {"dur", true},
91
93
    {"dx", true},
92
94
    {"dy", true},
93
 
    {"edgeMode", false},
94
 
    {"elevation", false},
 
95
    {"edgeMode", true},
 
96
    {"elevation", true},
95
97
    {"enable-background", true},
96
98
    {"end", true},
97
 
    {"exponent", false},
 
99
    {"exponent", true},
98
100
    {"externalResourcesRequired", false},
 
101
    {"feBlend", false},
99
102
    {"feColorMatrix", false},
 
103
    {"feComponentTransfer", false},
100
104
    {"feComposite", false},
 
105
    {"feConvolveMatrix", false},
 
106
    {"feDiffuseLighting", false},
 
107
    {"feDisplacementMap", false},
 
108
    {"feFlood", false},
101
109
    {"feGaussianBlur", false},
 
110
    {"feImage", false},
 
111
    {"feMerge", false},
102
112
    {"feMorphology", false},
 
113
    {"feOffset", false},
 
114
    {"feSpecularLighting", false},
103
115
    {"feTile", false},
104
116
    {"fill", true},
105
117
    {"fill-opacity", true},
106
118
    {"fill-rule", true},
107
119
    {"filter", true},
108
 
    {"filterRes", false},
109
 
    {"filterUnits", false},
 
120
    {"filterRes", true},
 
121
    {"filterUnits", true},
110
122
    {"flood-color", true},
111
123
    {"flood-opacity", true},
112
124
    {"font-family", true},
135
147
    {"horiz-origin-y", false},
136
148
    {"ideographic", false},
137
149
    {"image-rendering", true},
138
 
    {"in", false},
139
 
    {"in2", false},
140
 
    {"intercept", false},
 
150
    {"in", true},
 
151
    {"in2", true},
 
152
    {"intercept", true},
141
153
    {"k", false},
142
 
    {"k1", false},
143
 
    {"k2", false},
144
 
    {"k3", false},
145
 
    {"k4", false},
146
 
    {"kernelMatrix", false},
147
 
    {"kernelUnitLength", false},
 
154
    {"k1", true},
 
155
    {"k2", true},
 
156
    {"k3", true},
 
157
    {"k4", true},
 
158
    {"kernelMatrix", true},
 
159
    {"kernelUnitLength", true},
148
160
    {"kerning", true},
149
161
    {"keyPoints", false},
150
162
    {"keySplines", true},
153
165
    {"lengthAdjust", false},
154
166
    {"letter-spacing", true},
155
167
    {"lighting-color", true},
156
 
    {"limitingConeAngle", false},
 
168
    {"limitingConeAngle", true},
157
169
    {"local", true},
158
170
    {"marker-end", true},
159
171
    {"marker-mid", true},
169
181
    {"media", false},
170
182
    {"method", false},
171
183
    {"min", true},
172
 
    {"mode", false},
 
184
    {"mode", true},
173
185
    {"name", true},
174
 
    {"numOctaves", false},
 
186
    {"numOctaves", true},
175
187
    {"offset", true},
176
188
    {"onabort", false},
177
189
    {"onactivate", false},
193
205
    {"onunload", false},
194
206
    {"onzoom", false},
195
207
    {"opacity", true},
196
 
    {"operator", false},
197
 
    {"order", false},
 
208
    {"operator", true},
 
209
    {"order", true},
198
210
    {"orient", true},
199
211
    {"orientation", true},
200
212
    {"origin", false},
209
221
    {"patternUnits", true},
210
222
    {"pointer-events", true},
211
223
    {"points", true},
212
 
    {"pointsAtX", false},
213
 
    {"pointsAtY", false},
214
 
    {"pointsAtZ", false},
215
 
    {"preserveAlpha", false},
 
224
    {"pointsAtX", true},
 
225
    {"pointsAtY", true},
 
226
    {"pointsAtZ", true},
 
227
    {"preserveAlpha", true},
216
228
    {"preserveAspectRatio", true},
217
 
    {"primitiveUnits", false},
 
229
    {"primitiveUnits", true},
218
230
    {"r", true},
219
 
    {"radius", false},
 
231
    {"radius", true},
220
232
    {"refX", true},
221
233
    {"refY", true},
222
234
    {"rendering-intent", true},
225
237
    {"requiredFeatures", true},
226
238
    {"requiredExtensions", true},
227
239
    {"restart", true},
228
 
    {"result", false},
 
240
    {"result", true},
229
241
    {"rotate", true},
230
242
    {"rx", true},
231
243
    {"ry", true},
232
 
    {"scale", false},
233
 
    {"seed", false},
 
244
    {"scale", true},
 
245
    {"seed", true},
234
246
    {"shape-rendering", true},
235
 
    {"slope", false},
 
247
    {"slope", true},
236
248
    {"spacing", false},
237
 
    {"specularConstant", false},
238
 
    {"specularExponent", false},
 
249
    {"specularConstant", true},
 
250
    {"specularExponent", true},
239
251
    {"spreadMethod", true},
240
252
    {"startOffset", true},
241
 
    {"stdDeviation", false},
 
253
    {"stdDeviation", true},
242
254
    {"stemh", false},
243
255
    {"stemv", false},
244
 
    {"stitchTiles", false},
 
256
    {"stitchTiles", true},
245
257
    {"stop-color", true},
246
258
    {"stop-opacity", true},
247
259
    {"strikethrough-position", false},
255
267
    {"stroke-opacity", true},
256
268
    {"stroke-width", true},
257
269
    {"style", true},
258
 
    {"surfaceScale", false},
 
270
    {"surfaceScale", true},
259
271
    {"systemLanguage", true},
260
 
    {"tableValues", false},
 
272
    {"tableValues", true},
261
273
    {"target", true},
262
 
    {"targetX", false},
263
 
    {"targetY", false},
 
274
    {"targetX", true},
 
275
    {"targetY", true},
264
276
    {"text-align", true},
265
277
    {"text-anchor", true},
266
278
    {"text-decoration", true},
300
312
    {"x-height", false},
301
313
    {"x1", true},
302
314
    {"x2", true},
303
 
    {"xChannelSelector", false},
 
315
    {"xChannelSelector", true},
304
316
    {"xlink:actuate", true},
305
317
    {"xlink:arcrole", true},
306
318
    {"xlink:href", true},
315
327
    {"y", true},
316
328
    {"y1", true},
317
329
    {"y2", true},
318
 
    {"yChannelSelector", false},
319
 
    {"z", false},
 
330
    {"yChannelSelector", true},
 
331
    {"z", true},
320
332
    {"zoomAndPan", false},
321
333
 
322
334
    /* Extra attributes. */
329
341
    {"inkscape:groupmode", true},
330
342
    {"sodipodi:version", true},
331
343
    {"inkscape:version", true},
332
 
    {"inkscape:object-bbox", true},
333
 
    {"inkscape:object-points", true},
334
344
    {"inkscape:object-paths", true},
335
345
    {"inkscape:object-nodes", true},
 
346
    {"inkscape:bbox-paths", true},
 
347
    {"inkscape:bbox-nodes", true},
 
348
    {"inkscape:snap-global", true},
 
349
    {"inkscape:snap-bbox", true},
 
350
    {"inkscape:snap-nodes", true},
 
351
    {"inkscape:snap-guide", true},
 
352
    {"inkscape:snap-center", true},
 
353
    {"inkscape:snap-intersection-grid-guide", true},
 
354
    {"inkscape:snap-intersection-line-segments", true},
336
355
    {"inkscape:pageopacity", true},
337
356
    {"inkscape:pageshadow", true},
338
357
    {"inkscape:transform-center-x", true},
344
363
    {"inkscape:window-height", true},
345
364
    {"inkscape:window-x", true},
346
365
    {"inkscape:window-y", true},
347
 
    {"inkscape:grid-bbox", true},
348
 
    {"inkscape:guide-bbox", true},
349
 
    {"inkscape:grid-points", true},
350
 
    {"inkscape:guide-points", true},
351
366
    {"inkscape:current-layer", true},
352
367
    {"inkscape:connector-type", true},
353
368
    {"inkscape:connection-start", true},
358
373
    {"sodipodi:cy", true},
359
374
    {"sodipodi:rx", true},
360
375
    {"sodipodi:ry", true},
 
376
    {"inkscape:perspectiveID", true},
 
377
    {"inkscape:corner0", true},
 
378
    {"inkscape:corner7", true},
 
379
    {"inkscape:box3dsidetype", true},
 
380
    {"inkscape:persp3d", true},
 
381
    {"inkscape:vp_x", true},
 
382
    {"inkscape:vp_y", true},
 
383
    {"inkscape:vp_z", true},
 
384
    {"inkscape:persp3d-origin", true},
361
385
    {"sodipodi:start", true},
362
386
    {"sodipodi:end", true},
363
387
    {"sodipodi:open", true},
392
416
    /* SPNamedView */
393
417
    {"viewonly", true},
394
418
    {"showgrid", true},
 
419
//    {"gridtype", true},
395
420
    {"showguides", true},
396
421
    {"gridtolerance", true},
397
422
    {"guidetolerance", true},
398
423
    {"objecttolerance", true},
399
 
    {"has_abs_tolerance", true},
400
 
    {"gridoriginx", true},
 
424
/*    {"gridoriginx", true},
401
425
    {"gridoriginy", true},
402
426
    {"gridspacingx", true},
403
427
    {"gridspacingy", true},
 
428
    {"gridanglex", true},
 
429
    {"gridanglez", true},
404
430
    {"gridcolor", true},
405
431
    {"gridopacity", true},
406
432
    {"gridempcolor", true},
407
433
    {"gridempopacity", true},
408
 
    {"gridempspacing", true},
 
434
    {"gridempspacing", true}, */
409
435
    {"guidecolor", true},
410
436
    {"guideopacity", true},
411
437
    {"guidehicolor", true},
473
499
        unsigned const n_ids = ids.size();
474
500
        for (unsigned id = 1; id < n_ids; ++id) {
475
501
            if (!ids[id]) {
476
 
                TS_WARN( std::string((const char*)sp_attribute_name(id)) );
 
502
                gchar* tmp = g_strdup_printf( "Attribute string with enum %d {%s} not handled", id, sp_attribute_name(id) );
 
503
                TS_WARN( std::string((const char*)tmp) );
 
504
                g_free( tmp );
477
505
                found = true;
478
506
            }
479
507
        }
480
508
        TS_ASSERT(!found);
 
509
 
 
510
        for ( guint index = 1; index < n_ids; index++ ) {
 
511
            guchar const* name = sp_attribute_name(index);
 
512
            gint postLookup = sp_attribute_lookup( reinterpret_cast<gchar const*>(name) );
 
513
            TSM_ASSERT_EQUALS( std::string("Enum round-trip through string {") + (char const*)name + "} failed.", index, postLookup );
 
514
        }
 
515
 
481
516
    }
482
517
};
483
518