This file is indexed.

/usr/share/doc/api-sanity-checker/SpecType.html is in api-sanity-checker 1.98.6-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<title>Specialized Type</title>
<meta charset="UTF-8" />
<meta name="generator" content="MediaWiki 1.18.1" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch_desc.php" title="ISP_RAS (en)" />
<link rel="EditURI" type="application/rsd+xml" href="http://ispras.linuxbase.org/api.php?action=rsd" />
<link rel="alternate" type="application/atom+xml" title="ISP_RAS Atom feed" href="/index.php?title=Special:RecentChanges&amp;feed=atom" />
<link rel="stylesheet" href="/load.php?debug=false&amp;lang=en&amp;modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.monobook&amp;only=styles&amp;skin=monobook&amp;*" />
<!--[if lt IE 5.5000]><link rel="stylesheet" href="/skins/monobook/IE50Fixes.css?303" media="screen" /><![endif]-->
<!--[if IE 5.5000]><link rel="stylesheet" href="/skins/monobook/IE55Fixes.css?303" media="screen" /><![endif]-->
<!--[if IE 6]><link rel="stylesheet" href="/skins/monobook/IE60Fixes.css?303" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/skins/monobook/IE70Fixes.css?303" media="screen" /><![endif]--><meta name="ResourceLoaderDynamicStyles" content="" />
<link rel="stylesheet" href="/load.php?debug=false&amp;lang=en&amp;modules=site&amp;only=styles&amp;skin=monobook&amp;*" />
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}a.new,#quickbar a.new{color:#ba0000}

/* cache key: rasispdb:resourceloader:filter:minify-css:4:c88e2bcd56513749bec09a7e29cb3ffa */
</style>
<script src="/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=monobook&amp;*"></script>
<script>if(window.mw){
	mw.config.set({"wgCanonicalNamespace": "", "wgCanonicalSpecialPageName": false, "wgNamespaceNumber": 0, "wgPageName": "Specialized_Type", "wgTitle": "Specialized Type", "wgCurRevisionId": 8199, "wgArticleId": 2414, "wgIsArticle": true, "wgAction": "view", "wgUserName": null, "wgUserGroups": ["*"], "wgCategories": ["API Sanity Checker"], "wgBreakFrames": false, "wgRestrictionEdit": [], "wgRestrictionMove": []});
}
</script><script>if(window.mw){
	mw.loader.load(["mediawiki.page.startup"]);
}
</script>
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-Specialized_Type action-view skin-monobook">
<div id="globalWrapper">
<div id="column-content"><div id="content">
	<a id="top"></a>
	
	<h1 id="firstHeading" class="firstHeading">Specialized Type</h1>
	<div id="bodyContent">
		<div id="siteSub"></div>
		<div id="contentSub"></div>
		
		<!-- start content -->
<div lang="en" dir="ltr" class="mw-content-ltr"><p>The basic idea of <i>specialized types</i> is to provide the test generator (<a href="http://ispras.linuxbase.org/index.php/API_Sanity_Checker" title="API Sanity Checker">API Sanity Checker</a>) with enough information to generate correct invocation of the target interface in a typical use case and check basic constraints on the return value. The issue is that, for many interfaces, correct invocation requires preparing correct environment and correct parameter values. And this in turn may require calling other interfaces. Specialized type (or "semantic type" of parameter) include information about various initialization means for various environments. Such information can be reused for multiple interfaces each time the same semantic types are used, which greatly speeds up the development. Correct values for simple types are created by generator completely automatically. When an interface has initialization means assigned for all of its parameters (and if necessary for initial environment), the generator can automatically compose a test for this interface.
</p><p>Test development process consists in creating the complete collection of specialized types for the library. Testing of libraries with numerous interfaces by this methodology requires relatively small effort per test and thus is cheap enough. The efficiency is best revealed for interface sets with the number of interfaces starting from hundreds.
</p>
<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#C.2FC.2B.2B_Language_Extensions"><span class="tocnumber">1</span> <span class="toctext">C/C++ Language Extensions</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Attributes_of_Specialized_Type"><span class="tocnumber">2</span> <span class="toctext">Attributes of Specialized Type</span></a></li>
<li class="toclevel-1 tocsection-3"><a href="#Associating_with_Interfaces"><span class="tocnumber">3</span> <span class="toctext">Associating with Interfaces</span></a></li>
<li class="toclevel-1 tocsection-4"><a href="#Writing_Specialized_Types"><span class="tocnumber">4</span> <span class="toctext">Writing Specialized Types</span></a></li>
<li class="toclevel-1 tocsection-5"><a href="#Writing_Collection_of_Specialized_Types"><span class="tocnumber">5</span> <span class="toctext">Writing Collection of Specialized Types</span></a></li>
<li class="toclevel-1 tocsection-6"><a href="#Using_Test_Data"><span class="tocnumber">6</span> <span class="toctext">Using Test Data</span></a></li>
<li class="toclevel-1 tocsection-7"><a href="#Examples"><span class="tocnumber">7</span> <span class="toctext">Examples</span></a></li>
</ul>
</td></tr></table>
<h2> <span class="mw-headline" id="C.2FC.2B.2B_Language_Extensions"> C/C++ Language Extensions </span></h2>
<p>Attributes of specialized type should be described on C/C++ language extended by the following instructions:
</p>
<ul><li> <b>$(type)</b> - instruction initializing an instance of data type.
</li></ul>
<pre>   void create_QAbstractProxyModel(QAbstractProxyModel* Obj)
   {
       Obj-&gt;setSourceModel(<span style="color:Brown;"><b>$(QAbstractItemModel*)</b></span>);
   }
</pre>
<ul><li> <b>$[interface]</b> - instruction for interface call with properly initialized parameters.
</li></ul>
<pre>   xmlListPtr create_filled_list()
   {
       xmlListPtr l=<span style="color:Brown"><b>$[xmlListCreate]</b></span>;
       int num=100;
       xmlListPushBack(l,&amp;num);
       return l;
   }
</pre>
<ul><li> <b>$0</b> - an instance of the specialized type.
</li></ul>
<pre>   /*initialize "doc" property of the associated parameter*/
   <span style="color:Brown;"><b>$0</b></span>-&gt;doc = xmlParseMemory("&lt;p/&gt;",4);
</pre>
<ul><li> <b>$1</b>, <b>$2</b>, <b>...</b> - references to 1st, 2nd and other interface parameters.
</li></ul>
<pre>   /*initialize "next" field of the first parameter by the second parameter*/
   <span style="color:Brown;"><b>$1</b></span>-&gt;next=<span style="color:Brown;"><b>$2</b></span>;
</pre>
<pre>   /*write first parameter to the second parameter*/
   <span style="color:Brown;"><b>$2</b></span>.write(<span style="color:Brown;"><b>$1</b></span>);
</pre>
<ul><li> <b>$obj</b> - reference to the object that current method calls on (C++ only).
</li></ul>
<pre>   /*call setStyle() method on the object*/
   <span style="color:Brown;"><b>$obj</b></span>.setStyle(Qt::DotLine);
</pre>
<h2> <span class="mw-headline" id="Attributes_of_Specialized_Type"> Attributes of Specialized Type</span></h2>
<p>Specialized type has the following attributes:
</p>
<ul><li> <b>name</b> - Name of the specialized type
</li><li> <b>data_type</b> - Name of the associated real data type (QObject*, int, xmlChar ...) or the list of such types (one per line)
</li><li> <b>value</b> - Value for initialization (true, 1.0, "string")
</li><li> <b>pre_condition/post_condition</b> - Pre/Postcondition on associated function return value or parameter
</li></ul>
<pre>   <span style="color:Brown;"><b>$0</b></span>!=NULL
</pre>
<ul><li> <b>init_code</b>/<b>final_code</b> - Code that should be invoked before/after function call
</li></ul>
<pre>   /*call the start() method on the associated parameter*/
   <span style="color:Brown;"><b>$0</b></span>-&gt;start();
</pre>
<ul><li> <b>global_code</b> - Declarations of auxiliary functions and global variables, header includes
</li></ul>
<pre>   <span style="color:Green;">#include &lt;QWidgetAction&gt;</span>
   QWidgetAction* create_QWidgetAction()
   {
       QWidgetAction* Obj = new QWidgetAction(<span style="color:Brown;"><b>$(QWidget*)</b></span>);
       Obj-&gt;setDefaultWidget(<span style="color:Brown;"><b>$(QWidget*)</b></span>);
       return Obj;
   }
</pre>
<ul><li> <b>libs</b> - List of external shared objects used by this type. Corresponding external header files should be included in the <b>global_code</b> section
</li><li> <b>kind</b> - Kind of the specialized type:
<ul><li> <i><b>normal</b></i> - This specialized type should be manually associated with the parameters or return values of suitable interfaces
</li><li> <i><b>common_param</b></i> - This specialized type will be automatically associated with the parameters of all suitable interfaces
</li><li> <i><b>common_retval</b></i> - This specialized type will be automatically associated with the return values of all suitable interfaces
</li><li> <i><b>env</b></i> - This kind of specialized type was introduced for setting up correct environment for the interfaces. The code of this specialized<br />type will be added once at the beginning or at the end of main() function in the test for manually associated interface
</li><li> <i><b>common_env</b></i> - This kind of specialized type is the same as <i><b>env</b></i>, but will be automatically associated with all library interfaces
</li></ul>
</li></ul>
<h2> <span class="mw-headline" id="Associating_with_Interfaces"> Associating with Interfaces </span></h2>
<p>Specialized Types should be associated with the return values or parameters of some library interfaces. Base type of the specialized type should be the same as base type of return value or parameter. For example, specialized type with data_type=<i>int*</i> can be associated with any parameter that has <i>int</i> as the base type like <i>int</i>, <i>int**</i>, <i>int&amp;*</i> and others (it is a so-called <i>family of data types</i> - collection of types that have the same base type).
</p>
<h2> <span class="mw-headline" id="Writing_Specialized_Types"> Writing Specialized Types </span></h2>
<p>Specialized Type has XML-like structure (you can skip any section if it is not needed):
</p>
<pre> <span style="color:Blue;">&lt;spec_type&gt;</span>
 
     <span style="color:Green;">&lt;kind&gt;</span>
         &lt;!-- Kind of the specialized type.
              Select it from the following list:
                normal
                common_param
                common_retval
                env
                common_env --&gt;
     <span style="color:Green;">&lt;/kind&gt;</span>
 
     <span style="color:Green;">&lt;data_type&gt;</span>
         &lt;!-- Name of the corresponding real data type, one per line.
              You can specify several data types if kind is 'common_param'
              or 'common_retval', one per line.
              This section is not used if kind is 'env' or 'common_env' --&gt;
     <span style="color:Green;">&lt;/data_type&gt;</span>
     
     <span style="color:Green;">&lt;value&gt;</span>
         &lt;!-- Value for initialization (true, 1.0, \"string\", ...) --&gt;
     <span style="color:Green;">&lt;/value&gt;</span>
     
     <span style="color:Green;">&lt;pre_condition&gt;</span>
         &lt;!-- Precondition on associated function parameter.
                Example: $0!=NULL --&gt;
     <span style="color:Green;">&lt;/pre_condition&gt;</span>
     
     <span style="color:Green;">&lt;post_condition&gt;</span>
         &lt;!-- Postcondition on associated function return value or parameter.
                Example: $0!=NULL &amp;&amp; $obj.style()==Qt::DotLine --&gt;
     <span style="color:Green;">&lt;/post_condition&gt;</span>
     
     <span style="color:Green;">&lt;init_code&gt;</span>
         &lt;!-- Code that should be invoked before function call.
                Example: $0-&gt;start(); --&gt;
     <span style="color:Green;">&lt;/init_code&gt;</span>
     
     <span style="color:Green;">&lt;final_code&gt;</span>
         &lt;!-- Code that should be invoked after function call
                Example: $0-&gt;end(); --&gt;
     <span style="color:Green;">&lt;/final_code&gt;</span>
     
     <span style="color:Green;">&lt;global_code&gt;</span>
         &lt;!-- Declarations of auxiliary functions and global variables, header includes --&gt;
     <span style="color:Green;">&lt;/global_code&gt;</span>
     
     <span style="color:Green;">&lt;associating&gt;</span>
         <span style="color:Purple;">&lt;interfaces&gt;</span>
             &lt;!-- List of interfaces (mangled/symbol names in C++)
                  that will be associated with the specialized type, one per line --&gt;
         <span style="color:Purple;">&lt;/interfaces&gt;</span>
         
         <span style="color:Purple;">&lt;except&gt;</span>
             &lt;!-- List of interfaces (mangled/symbol names in C++)
                  that will not be associated with the specialized type, one per line.
                  This section is used if kind is 'common_env', 'common_param' or 'common_return' --&gt;
         <span style="color:Purple;">&lt;/except&gt;</span>
         
         <span style="color:Purple;">&lt;links&gt;</span>
             &lt;!-- Associations with the return value, parameters or/and object, one per line:
                    param1
                    param2
                     ...
                    object
                    retval --&gt;
         <span style="color:Purple;">&lt;/links&gt;</span>
         
         <span style="color:Purple;">&lt;param_name&gt;</span>
             &lt;!-- Associations with the parameters by name, one per line:
                    param_name1
                    param_name2
                    param_name3
                     ...
                         --&gt;
         <span style="color:Purple;">&lt;/param_name&gt;</span>
     <span style="color:Green;">&lt;/associating&gt;</span>
     
     <span style="color:Green;">&lt;associating&gt;</span>
         &lt;!-- Other associations --&gt;
     <span style="color:Green;">&lt;/associating&gt;</span>
     
     <span style="color:Green;">&lt;name&gt;</span>
         &lt;!-- Name of the specialized type --&gt;
     <span style="color:Green;">&lt;/name&gt;</span>
     
     <span style="color:Green;">&lt;libs&gt;</span>
         &lt;!-- External shared objects, one per line.
              If spectype contains call of the functions from
              some external shared objects then these objects
              should be listed here. Corresponding external
              header files should be included in global_code --&gt;
     <span style="color:Green;">&lt;/libs&gt;</span>
     
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
</pre>
<h2> <span class="mw-headline" id="Writing_Collection_of_Specialized_Types"> Writing Collection of Specialized Types </span></h2>
<p>You can unite several specialized types into collection(s):
</p>
<pre> <span style="color:Red;">&lt;collection&gt;</span>
 
     <span style="color:Blue;">&lt;spec_type&gt;</span>
         &lt;!-- Specialized Type №1 --&gt;
     <span style="color:Blue;">&lt;/spec_type&gt;</span>
     
     <span style="color:Blue;">&lt;spec_type&gt;</span>
         &lt;!-- Specialized Type №2 --&gt;
     <span style="color:Blue;">&lt;/spec_type&gt;</span>
     
        ...
     
 <span style="color:Red;">&lt;/collection&gt;</span>
 
 <span style="color:Red;">&lt;collection&gt;</span>
     &lt;!-- Other Collection --&gt;
 <span style="color:Red;">&lt;/collection&gt;</span>

</pre>
<p>The file containing collection(s) of specialized types can be provided to the <a href="Options.html" title="API Sanity Checker Options">-specialized-types</a> (<a href="Options.html" title="API Sanity Checker Options">-st</a>) option:<br />
&#160;&#160;<code style="border: dashed 1px gray; background-color: #f0f0f0;">&#160;api-sanity-checker -specialized-types <i>SPECTYPES.xml</i> -gen -build -run&#160;</code>
</p>
<h2> <span class="mw-headline" id="Using_Test_Data"> Using Test Data </span></h2>
<p>Test data (special files needed by tests) should be created in some directory before generating tests. Path to that directory should be provided to <a href="Options.html" title="API Sanity Checker Options">-test-data</a> (<a href="Options.html" title="API Sanity Checker Options">-td</a>) option:<br />
&#160;&#160;<code style="border: dashed 1px gray; background-color: #f0f0f0;">&#160;api-sanity-checker -test-data <i>DIR</i> -specialized-types <i>SPECTYPES.xml</i> -gen -build -run&#160;</code>
</p><p>For accessing test data files in the attributes of specialized types you should use TEST_DATA_PATH("file") construction. Test generator will copy specified file to the local "testdata/" directory and replace TEST_DATA_PATH("file") with the "testdata/file" in the generated code.
</p>
<pre>   QSound* create_QSound()
   {
       QSound* Obj = new QSound(<span style="color:Brown;"><b>TEST_DATA_PATH</b></span>("SoundFile.wav"), NULL);
       Obj-&gt;setLoops(5);
       return Obj;
   }
</pre>
<h2> <span class="mw-headline" id="Examples"> Examples </span></h2>
<ul><li> Setting up environment for all interfaces and correct initialization for parameters of type <b>GObject*</b> in the <b>ATK</b> library:
</li></ul>
<pre> <span style="color:Blue;">&lt;spec_type&gt;</span>
     <span style="color:Green;">&lt;kind&gt;</span>
         common_env
     <span style="color:Green;">&lt;/kind&gt;</span>
 
     <span style="color:Green;">&lt;init_code&gt;</span>
         g_type_init();
     <span style="color:Green;">&lt;/init_code&gt;</span>
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
 
 <span style="color:Blue;">&lt;spec_type&gt;</span>
     <span style="color:Green;">&lt;kind&gt;</span>
         common_param
     <span style="color:Green;">&lt;/kind&gt;</span>
 
     <span style="color:Green;">&lt;data_type&gt;</span>
         GObject*
     <span style="color:Green;">&lt;/data_type&gt;</span>
    
     <span style="color:Green;">&lt;value&gt;</span>
         g_object_new (G_TYPE_OBJECT, NULL)
     <span style="color:Green;">&lt;/value&gt;</span>
    
     <span style="color:Green;">&lt;global_code&gt;</span>
         #include &lt;glib.h&gt;
     <span style="color:Green;">&lt;/global_code&gt;</span>
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
</pre>
<ul><li> Correct initialization for all parameters of type <b>xmlListPtr</b> in the <b>libxml2</b> library:
</li></ul>
<pre> <span style="color:Blue;">&lt;spec_type&gt;</span>
     <span style="color:Green;">&lt;kind&gt;</span>
         common_param
     <span style="color:Green;">&lt;/kind&gt;</span>
 
     <span style="color:Green;">&lt;data_type&gt;</span>
         xmlListPtr
     <span style="color:Green;">&lt;/data_type&gt;</span>
    
     <span style="color:Green;">&lt;value&gt;</span>
         create_filled_list()
     <span style="color:Green;">&lt;/value&gt;</span>
    
     <span style="color:Green;">&lt;constraint&gt;</span>
         $0!=NULL
     <span style="color:Green;">&lt;/constraint&gt;</span>
    
     <span style="color:Green;">&lt;global_code&gt;</span>
         xmlListPtr create_filled_list()
         {
             xmlListPtr l = <span style="color:Brown;"><b>$[xmlListCreate]</b></span>;
             int num = 100;
             xmlListPushBack(l, &amp;num);
             return l;
         }
     <span style="color:Green;">&lt;/global_code&gt;</span>
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
</pre>
<ul><li> Correct initialization for the 1st parameter of interface <b>xmlListAppend(xmlListPtr l, void* data)</b> from <b>libxml2</b> library:
</li></ul>
<pre> <span style="color:Blue;">&lt;spec_type&gt;</span>
     <span style="color:Green;">&lt;kind&gt;</span>
         normal
     <span style="color:Green;">&lt;/kind&gt;</span>
     
     <span style="color:Green;">&lt;data_type&gt;</span>
         xmlListPtr
     <span style="color:Green;">&lt;/data_type&gt;</span>
     
     <span style="color:Green;">&lt;value&gt;</span>
         create_filled_list()
     <span style="color:Green;">&lt;/value&gt;</span>
 
     <span style="color:Green;">&lt;global_code&gt;</span>
         xmlListPtr create_filled_list()
         {
             xmlListPtr l = <span style="color:Brown;"><b>$[xmlListCreate]</b></span>;
             int num = 100;
             xmlListPushBack(l, &amp;num);
             return l;
         }
     <span style="color:Green;">&lt;/global_code&gt;</span>
     
     <span style="color:Green;">&lt;associating&gt;</span>
         <span style="color:Purple;">&lt;interfaces&gt;</span>
             xmlListAppend
         <span style="color:Purple;">&lt;/interfaces&gt;</span>
       
         <span style="color:Purple;">&lt;links&gt;</span>
             param1
         <span style="color:Purple;">&lt;/links&gt;</span>
     <span style="color:Green;">&lt;/associating&gt;</span>
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
</pre>
<ul><li> Setting up environment for all interfaces from the <b>QtCore</b> library:
</li></ul>
<pre> <span style="color:Blue;">&lt;spec_type&gt;</span>
     <span style="color:Green;">&lt;kind&gt;</span>
         common_env
     <span style="color:Green;">&lt;/kind&gt;</span>
 
     <span style="color:Green;">&lt;global_code&gt;</span>
         #include&lt;QApplication&gt;
         #include&lt;QTimer&gt;
     <span style="color:Green;">&lt;/global_code&gt;</span>
 
     <span style="color:Green;">&lt;init_code&gt;</span>
         #ifdef Q_WS_X11
           bool useGUI = getenv( "DISPLAY" )&#160;!= 0;
         #else
           bool useGUI = TRUE;
         #endif
         QApplication* app = new QApplication(argc, argv, useGUI);
     <span style="color:Green;">&lt;/init_code&gt;</span>
 
     <span style="color:Green;">&lt;final_code&gt;</span>
         QTimer::singleShot(100, app, SLOT(quit()));
         app-&gt;exec();
     <span style="color:Green;">&lt;/final_code&gt;</span>
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
</pre>
<ul><li> Setting up environment for all interfaces from the <b>Gtk+</b> library:
</li></ul>
<pre> <span style="color:Blue;">&lt;spec_type&gt;</span>
     <span style="color:Green;">&lt;kind&gt;</span>
         common_env
     <span style="color:Green;">&lt;/kind&gt;</span>
 
     <span style="color:Green;">&lt;init_code&gt;</span>
         gtk_init(&amp;argc, &amp;argv);
     <span style="color:Green;">&lt;/init_code&gt;</span>
 
     <span style="color:Green;">&lt;final_code&gt;</span>
        gtk_timeout_add(100, &amp;main_loop_quit, NULL);
        gtk_main();
     <span style="color:Green;">&lt;/final_code&gt;</span>
 
     <span style="color:Green;">&lt;global_code&gt;</span>
         #include &lt;gtk.h&gt;
         gboolean main_loop_quit(gpointer data)
         {
             gtk_main_quit();
             return FALSE;
         }
     <span style="color:Green;">&lt;/global_code&gt;</span>
 
     <span style="color:Green;">&lt;associating&gt;</span>
         <span style="color:Purple;">&lt;except&gt;</span>
             gtk_init
             gtk_init_check
             gtk_parse_args
             gdk_init
             gdk_init_check
             gdk_parse_args
             gtk_test_init
         <span style="color:Purple;">&lt;/except&gt;</span>
     <span style="color:Green;">&lt;/associating&gt;</span>
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
</pre>
<ul><li> Using test data for initializing all parameters of type <b>xmlTextReaderPtr</b> in the <b>libxml2</b> library:
</li></ul>
<pre> <span style="color:Blue;">&lt;spec_type&gt;</span>
     <span style="color:Green;">&lt;kind&gt;</span>
         common_param
     <span style="color:Green;">&lt;/kind&gt;</span>
     
     <span style="color:Green;">&lt;data_type&gt;</span>
         xmlTextReaderPtr
     <span style="color:Green;">&lt;/data_type&gt;</span>
     
     <span style="color:Green;">&lt;value&gt;</span>
         create_reader()
     <span style="color:Green;">&lt;/value&gt;</span>
 
     <span style="color:Green;">&lt;global_code&gt;</span>
         xmlTextReaderPtr create_reader(int n)
         {
             xmlTextReaderPtr reader = xmlReaderForFile(<span style="color:Brown;"><b>TEST_DATA_PATH</b></span>("file.xml"), NULL, 0);
             int i;
             for(i=0; i&lt;n; i+=1)
             {
                 xmlTextReaderRead(reader);
             }
             return reader;
         }
     <span style="color:Green;">&lt;/global_code&gt;</span>
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
</pre>
<ul><li> Checking the return value of interface <b>xmlLinkGetData(xmlLinkPtr lk)</b> from the <b>libxml2</b> library:
</li></ul>
<pre> <span style="color:Blue;">&lt;spec_type&gt;</span>
     <span style="color:Green;">&lt;kind&gt;</span>
         normal
     <span style="color:Green;">&lt;/kind&gt;</span>
 
     <span style="color:Green;">&lt;data_type&gt;</span>
         void*
     <span style="color:Green;">&lt;/data_type&gt;</span>
 
     <span style="color:Green;">&lt;constraint&gt;</span>
         $0!=NULL
     <span style="color:Green;">&lt;/constraint&gt;</span>
     
     <span style="color:Green;">&lt;associating&gt;</span>
         <span style="color:Purple;">&lt;interfaces&gt;</span>
             xmlLinkGetData
         <span style="color:Purple;">&lt;/interfaces&gt;</span>
       
         <span style="color:Purple;">&lt;links&gt;</span>
             retval
         <span style="color:Purple;">&lt;/links&gt;</span>
     <span style="color:Green;">&lt;/associating&gt;</span>
 <span style="color:Blue;">&lt;/spec_type&gt;</span>
</pre>
<!-- 
NewPP limit report
Preprocessor node count: 180/1000000
Post-expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key rasispdb:pcache:idhash:2414-0!*!0!!en!*!* and timestamp 20130916092208 -->
</div></div></div></div></div></body></html>