File: doxygen_translate_runme.cs

package info (click to toggle)
swig 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 46,232 kB
  • sloc: cpp: 54,631; ansic: 29,122; java: 17,530; python: 12,505; cs: 10,369; ruby: 7,232; yacc: 6,477; makefile: 5,965; javascript: 5,520; sh: 5,415; perl: 4,187; php: 3,693; ml: 2,187; lisp: 2,056; tcl: 1,991; xml: 115
file content (189 lines) | stat: -rw-r--r-- 7,096 bytes parent folder | download | duplicates (2)
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
using System;
using System.Xml;
using System.IO;
using doxygen_translateNamespace;

public class doxygen_translate_runme {

  doxygen_checker _checker;

  public static void Main() {
        doxygen_translate_runme runme = new doxygen_translate_runme();

        runme.test_function1();
        runme.test_function2();
        runme.test_function3();
        runme.test_function4();
  }

  public doxygen_translate_runme()
  {
    _checker = new doxygen_checker("doxygen_translate", "doxygen_translate", "./doxygen_translate/doxygen_translate.xml");
  }

  public void test_function1()
  {
    string function_name = "function(System.Int32,System.Single)";
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "code", 0, "    some test code");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "remarks", 0, "some copyright");
    _checker.checkObjectAttribute(doxygen_checker.CodeType.MEMBER, function_name, "exception", 0, "cref", "!:SuperError");
    _checker.checkObjectAttribute(doxygen_checker.CodeType.MEMBER, function_name, "param", 0, "name", "a");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "param", 0, " the first param");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "remarks", 1, "Some remark text");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "remarks", 2, "Another remarks section");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "returns", 0, "Whatever");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "returns", 1, "it");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "returns", 2, "may return");
    _checker.checkObjectAttribute(doxygen_checker.CodeType.MEMBER, function_name, "seealso", 0, "cref", "!:someOtherMethod");
    _checker.checkObjectAttribute(doxygen_checker.CodeType.MEMBER, function_name, "seealso", 1, "cref", "M:doxygen_translateNamespace.doxygen_translate.function(System.Int32,System.Single)");
    _checker.checkObjectAttribute(doxygen_checker.CodeType.MEMBER, function_name, "exception", 1, "cref", "!:superException");
    _checker.checkObjectAttribute(doxygen_checker.CodeType.MEMBER, function_name, "exception", 2, "cref", "!:RuntimeError");
    _checker.checkObjectAttribute(doxygen_checker.CodeType.MEMBER, function_name, "param", 1, "name", "b");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "param", 1, " B is mentioned again...");
    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "remarks", 3, "This is senseless!");

    string description = @"
             *Hello*
            
             * some list item
             Author: lots of them
            
            
             Author: Zubr
            
            
             **boldword**
            
             ``codeword``
            
             'citationword'
            
             ";

    _checker.checkText(doxygen_checker.CodeType.MEMBER, function_name, description);
  }

public void test_function2()
  {
    string function_name = "htmlFunction(System.Int32,System.Single)";


    string description = @"
             Test for html tags. See Doxygen doc for list of tags recognized by Doxygen.
             This is link (""http://acme.com/index.html"")
             **bold**
             Quote:
             Quotation block.
              (""http://www.worldwildlife.org/who/index.html"")
            
            
             center
             ``this is code``
             Starts an item title.
                 Starts an item description.
             Starts a piece of text displayed in a typewriter font.
            
             Starts a section with a specific style (HTML only)
            
             **Starts a piece of text displayed in an italic font.**
             'Form' does not generate any output.
            
             --------------------------------------------------------------------
            
             # Heading 1
            
             ## Heading 2
            
             ### Heading 3
            
             *Starts a piece of text displayed in an italic font.*
             Input tag.
             Image: src=""slika.png""
             Meta tag.
             Multicol is ignored by doxygen.
             * List item 1.
             * List item 2.
            
             Starts a new paragraph.
            
             Starts a preformatted fragment.
            
             Starts a section of text displayed in a smaller font.
            
             'Starts an inline text fragment with a specific style.'
             **Starts a section of bold text.**
              Starts a piece of text displayed in subscript.
              Starts a piece of text displayed in superscript.
             Animals
             | Column 1 | Column 2 |
             -----------------------
             | cow      | dog      |
             | cat      | mouse    |
             | horse    | parrot   |
             Starts a piece of text displayed in a typewriter font.
            
             Starts a piece of text displayed in a typewriter font.
             * List item 1.
             * List item 2.
             * List item 3.
             *Starts a piece of text displayed in an italic font.*
             <u>underlined \b bold text - doxy commands are ignored inside 'htmlonly' section </u>
            ";

    _checker.checkText(doxygen_checker.CodeType.MEMBER, function_name, description);
  }

  public void test_function3()
  {
    string function_name = "htmlTableFunction(System.Int32)";

    _checker.checkObjectAttribute(doxygen_checker.CodeType.MEMBER, function_name, "param", 0, "name", "byFlags");

    string paramDesc = @" bits marking required items:
            
                   | Size in bits| Items Required |
                   --------------------------------
                   | 1 - 8       |      1         |
                   | 9 - 16      |      2         |
                   | 17 - 32     |      4         |
            
                   Almost all combinations of above flags are supported by
                   ``htmlTable...`` functions.";

    _checker.checkObject(doxygen_checker.CodeType.MEMBER, function_name, "param", 0, paramDesc);
  }

  public void test_function4()
  {
    string function_name = "htmlEntitiesFunction(System.Int32,System.Single)";

    string description = @"
             All entities are treated as commands (C)  TM (R)
             should work also<in text
             >
             &
             '
             ""
             `
             '
             ""
             ""
             -
             --
            
             x
             -
             .
             ~
             <=
             >=
             <--
             -->
             Not an  html entity - ignored by Doxygen.
             Not an &text html entity - ampersand is replaced with entity.
            ";

    _checker.checkText(doxygen_checker.CodeType.MEMBER, function_name, description);
  }

}