File: preproc_constants_c_runme.cs

package info (click to toggle)
renderdoc 1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 79,584 kB
  • sloc: cpp: 491,671; ansic: 285,823; python: 12,617; java: 11,345; cs: 7,181; makefile: 6,703; yacc: 5,682; ruby: 4,648; perl: 3,461; php: 2,119; sh: 2,068; lisp: 1,835; tcl: 1,068; ml: 747; xml: 137
file content (70 lines) | stat: -rw-r--r-- 4,286 bytes parent folder | download | duplicates (10)
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
using System;
using System.Reflection;
using preproc_constants_cNamespace;

// Same as preproc_constants_c.i testcase, but bool types are int instead
public class runme {
  static void Main() {
    assert( typeof(int) == preproc_constants_c.CONST_INT1.GetType() );
    assert( typeof(int) == preproc_constants_c.CONST_INT2.GetType() );
    assert( typeof(uint) == preproc_constants_c.CONST_UINT1.GetType() );
    assert( typeof(uint) == preproc_constants_c.CONST_UINT2.GetType() );
    assert( typeof(uint) == preproc_constants_c.CONST_UINT3.GetType() );
    assert( typeof(uint) == preproc_constants_c.CONST_UINT4.GetType() );
    assert( typeof(int) == preproc_constants_c.CONST_LONG1.GetType() );
    assert( typeof(int) == preproc_constants_c.CONST_LONG2.GetType() );
    assert( typeof(int) == preproc_constants_c.CONST_LONG3.GetType() );
    assert( typeof(int) == preproc_constants_c.CONST_LONG4.GetType() );
    assert( typeof(long) == preproc_constants_c.CONST_LLONG1.GetType() );
    assert( typeof(long) == preproc_constants_c.CONST_LLONG2.GetType() );
    assert( typeof(long) == preproc_constants_c.CONST_LLONG3.GetType() );
    assert( typeof(long) == preproc_constants_c.CONST_LLONG4.GetType() );
    assert( typeof(ulong) == preproc_constants_c.CONST_ULLONG1.GetType() );
    assert( typeof(ulong) == preproc_constants_c.CONST_ULLONG2.GetType() );
    assert( typeof(ulong) == preproc_constants_c.CONST_ULLONG3.GetType() );
    assert( typeof(ulong) == preproc_constants_c.CONST_ULLONG4.GetType() );
    assert( typeof(double) == preproc_constants_c.CONST_DOUBLE1.GetType() );
    assert( typeof(double) == preproc_constants_c.CONST_DOUBLE2.GetType() );
    assert( typeof(double) == preproc_constants_c.CONST_DOUBLE3.GetType() );
    assert( typeof(double) == preproc_constants_c.CONST_DOUBLE4.GetType() );
    assert( typeof(double) == preproc_constants_c.CONST_DOUBLE5.GetType() );
    assert( typeof(double) == preproc_constants_c.CONST_DOUBLE6.GetType() );
    assert( typeof(int) == preproc_constants_c.CONST_BOOL1.GetType() );
    assert( typeof(int) == preproc_constants_c.CONST_BOOL2.GetType() );
    assert( typeof(char) == preproc_constants_c.CONST_CHAR.GetType() );
    assert( typeof(string) == preproc_constants_c.CONST_STRING1.GetType() );
    assert( typeof(string) == preproc_constants_c.CONST_STRING2.GetType() );

    assert( typeof(int) == preproc_constants_c.INT_AND_BOOL.GetType() );
//    assert( typeof(int) == preproc_constants_c.INT_AND_CHAR.GetType() );
    assert( typeof(int) == preproc_constants_c.INT_AND_INT.GetType() );
    assert( typeof(uint) == preproc_constants_c.INT_AND_UINT.GetType() );
    assert( typeof(int) == preproc_constants_c.INT_AND_LONG.GetType() );
    assert( typeof(uint) == preproc_constants_c.INT_AND_ULONG.GetType() );
    assert( typeof(long) == preproc_constants_c.INT_AND_LLONG.GetType() );
    assert( typeof(ulong) == preproc_constants_c.INT_AND_ULLONG.GetType() );
    assert( typeof(int ) == preproc_constants_c.BOOL_AND_BOOL.GetType() );

    assert( typeof(int) == preproc_constants_c.EXPR_MULTIPLY.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_DIVIDE.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_PLUS.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_MINUS.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_LSHIFT.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_RSHIFT.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_LTE.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_GTE.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_INEQUALITY.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_EQUALITY.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_AND.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_XOR.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_OR.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_LAND.GetType() );
    assert( typeof(int) == preproc_constants_c.EXPR_LOR.GetType() );
    assert( typeof(double) == preproc_constants_c.EXPR_CONDITIONAL.GetType() );

  }
  static void assert(bool assertion) {
    if (!assertion)
      throw new ApplicationException("test failed");
  }
}