File: preproc_constants_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 (83 lines) | stat: -rw-r--r-- 4,891 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
using System;
using System.Reflection;
using preproc_constantsNamespace;

public class runme {
  static void Main() {
    System.Type typeof_long = typeof(int);
    System.Type typeof_ulong = typeof(uint);
    if (preproc_constants.SWIGWORDSIZE64_enabled == 1) {
      typeof_long = typeof(long);
      typeof_ulong = typeof(ulong);
    }
    assert( typeof(int) == preproc_constants.CONST_INT1.GetType() );
    assert( typeof(int) == preproc_constants.CONST_INT2.GetType() );
    assert( typeof(uint) == preproc_constants.CONST_UINT1.GetType() );
    assert( typeof(uint) == preproc_constants.CONST_UINT2.GetType() );
    assert( typeof(uint) == preproc_constants.CONST_UINT3.GetType() );
    assert( typeof(uint) == preproc_constants.CONST_UINT4.GetType() );
    assert( typeof_long == preproc_constants.CONST_LONG1.GetType() );
    assert( typeof_long == preproc_constants.CONST_LONG2.GetType() );
    assert( typeof_long == preproc_constants.CONST_LONG3.GetType() );
    assert( typeof_long == preproc_constants.CONST_LONG4.GetType() );
    assert( typeof(long) == preproc_constants.CONST_LLONG1.GetType() );
    assert( typeof(long) == preproc_constants.CONST_LLONG2.GetType() );
    assert( typeof(long) == preproc_constants.CONST_LLONG3.GetType() );
    assert( typeof(long) == preproc_constants.CONST_LLONG4.GetType() );
    assert( typeof(ulong) == preproc_constants.CONST_ULLONG1.GetType() );
    assert( typeof(ulong) == preproc_constants.CONST_ULLONG2.GetType() );
    assert( typeof(ulong) == preproc_constants.CONST_ULLONG3.GetType() );
    assert( typeof(ulong) == preproc_constants.CONST_ULLONG4.GetType() );
    assert( typeof(double) == preproc_constants.CONST_DOUBLE1.GetType() );
    assert( typeof(double) == preproc_constants.CONST_DOUBLE2.GetType() );
    assert( typeof(double) == preproc_constants.CONST_DOUBLE3.GetType() );
    assert( typeof(double) == preproc_constants.CONST_DOUBLE4.GetType() );
    assert( typeof(float) == preproc_constants.CONST_FLOAT1.GetType() );
    assert( typeof(float) == preproc_constants.CONST_FLOAT2.GetType() );
    assert( typeof(bool) == preproc_constants.CONST_BOOL1.GetType() );
    assert( typeof(bool) == preproc_constants.CONST_BOOL2.GetType() );
    assert( typeof(char) == preproc_constants.CONST_CHAR.GetType() );
    assert( typeof(string) == preproc_constants.CONST_STRING1.GetType() );
    assert( typeof(string) == preproc_constants.CONST_STRING2.GetType() );
    assert( typeof(string) == preproc_constants.CONST_STRING3.GetType() );
    assert( typeof(string) == preproc_constants.CONST_STRING4.GetType() );
    assert( preproc_constants.CONST_STRING4 == "zer\0zer\0" );

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

    assert( typeof(int) == preproc_constants.EXPR_MULTIPLY.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_DIVIDE.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_PLUS.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_MINUS.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_LSHIFT.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_RSHIFT.GetType() );
    assert( typeof(bool) == preproc_constants.EXPR_LT.GetType() );
    assert( typeof(bool) == preproc_constants.EXPR_GT.GetType() );
    assert( typeof(bool) == preproc_constants.EXPR_LTE.GetType() );
    assert( typeof(bool) == preproc_constants.EXPR_GTE.GetType() );
    assert( typeof(bool) == preproc_constants.EXPR_INEQUALITY.GetType() );
    assert( typeof(bool) == preproc_constants.EXPR_EQUALITY.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_AND.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_XOR.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_OR.GetType() );
    assert( typeof(bool) == preproc_constants.EXPR_LAND.GetType() );
    assert( typeof(bool) == preproc_constants.EXPR_LOR.GetType() );
    assert( typeof(double) == preproc_constants.EXPR_CONDITIONAL.GetType() );
    assert( typeof(double) == preproc_constants.EXPR_MIXED1.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_WCHAR_MAX.GetType() );
    assert( typeof(int) == preproc_constants.EXPR_WCHAR_MIN.GetType() );

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