PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/csharp/preproc_constants_runme.cs

#
C# | 69 lines | 64 code | 4 blank | 1 comment | 54 complexity | c7c0fa2b2b9d57c719bec962982082e0 MD5 | raw file
 1using System;
 2using System.Reflection;
 3using preproc_constantsNamespace;
 4
 5public class runme {
 6  static void Main() {
 7    assert( typeof(int) == preproc_constants.CONST_INT1.GetType() );
 8    assert( typeof(int) == preproc_constants.CONST_INT2.GetType() );
 9    assert( typeof(uint) == preproc_constants.CONST_UINT1.GetType() );
10    assert( typeof(uint) == preproc_constants.CONST_UINT2.GetType() );
11    assert( typeof(uint) == preproc_constants.CONST_UINT3.GetType() );
12    assert( typeof(uint) == preproc_constants.CONST_UINT4.GetType() );
13    assert( typeof(int) == preproc_constants.CONST_LONG1.GetType() );
14    assert( typeof(int) == preproc_constants.CONST_LONG2.GetType() );
15    assert( typeof(int) == preproc_constants.CONST_LONG3.GetType() );
16    assert( typeof(int) == preproc_constants.CONST_LONG4.GetType() );
17    assert( typeof(long) == preproc_constants.CONST_LLONG1.GetType() );
18    assert( typeof(long) == preproc_constants.CONST_LLONG2.GetType() );
19    assert( typeof(long) == preproc_constants.CONST_LLONG3.GetType() );
20    assert( typeof(long) == preproc_constants.CONST_LLONG4.GetType() );
21    assert( typeof(ulong) == preproc_constants.CONST_ULLONG1.GetType() );
22    assert( typeof(ulong) == preproc_constants.CONST_ULLONG2.GetType() );
23    assert( typeof(ulong) == preproc_constants.CONST_ULLONG3.GetType() );
24    assert( typeof(ulong) == preproc_constants.CONST_ULLONG4.GetType() );
25    assert( typeof(double) == preproc_constants.CONST_DOUBLE1.GetType() );
26    assert( typeof(double) == preproc_constants.CONST_DOUBLE2.GetType() );
27    assert( typeof(double) == preproc_constants.CONST_DOUBLE3.GetType() );
28    assert( typeof(double) == preproc_constants.CONST_DOUBLE4.GetType() );
29    assert( typeof(double) == preproc_constants.CONST_DOUBLE5.GetType() );
30    assert( typeof(double) == preproc_constants.CONST_DOUBLE6.GetType() );
31    assert( typeof(bool) == preproc_constants.CONST_BOOL1.GetType() );
32    assert( typeof(bool) == preproc_constants.CONST_BOOL2.GetType() );
33    assert( typeof(char) == preproc_constants.CONST_CHAR.GetType() );
34    assert( typeof(string) == preproc_constants.CONST_STRING1.GetType() );
35    assert( typeof(string) == preproc_constants.CONST_STRING2.GetType() );
36
37    assert( typeof(int) == preproc_constants.INT_AND_BOOL.GetType() );
38//    assert( typeof(int) == preproc_constants.INT_AND_CHAR.GetType() );
39    assert( typeof(int) == preproc_constants.INT_AND_INT.GetType() );
40    assert( typeof(uint) == preproc_constants.INT_AND_UINT.GetType() );
41    assert( typeof(int) == preproc_constants.INT_AND_LONG.GetType() );
42    assert( typeof(uint) == preproc_constants.INT_AND_ULONG.GetType() );
43    assert( typeof(long) == preproc_constants.INT_AND_LLONG.GetType() );
44    assert( typeof(ulong) == preproc_constants.INT_AND_ULLONG.GetType() );
45    assert( typeof(int ) == preproc_constants.BOOL_AND_BOOL.GetType() );
46
47    assert( typeof(int) == preproc_constants.EXPR_MULTIPLY.GetType() );
48    assert( typeof(int) == preproc_constants.EXPR_DIVIDE.GetType() );
49    assert( typeof(int) == preproc_constants.EXPR_PLUS.GetType() );
50    assert( typeof(int) == preproc_constants.EXPR_MINUS.GetType() );
51    assert( typeof(int) == preproc_constants.EXPR_LSHIFT.GetType() );
52    assert( typeof(int) == preproc_constants.EXPR_RSHIFT.GetType() );
53    assert( typeof(bool) == preproc_constants.EXPR_LTE.GetType() );
54    assert( typeof(bool) == preproc_constants.EXPR_GTE.GetType() );
55    assert( typeof(bool) == preproc_constants.EXPR_INEQUALITY.GetType() );
56    assert( typeof(bool) == preproc_constants.EXPR_EQUALITY.GetType() );
57    assert( typeof(int) == preproc_constants.EXPR_AND.GetType() );
58    assert( typeof(int) == preproc_constants.EXPR_XOR.GetType() );
59    assert( typeof(int) == preproc_constants.EXPR_OR.GetType() );
60    assert( typeof(bool) == preproc_constants.EXPR_LAND.GetType() );
61    assert( typeof(bool) == preproc_constants.EXPR_LOR.GetType() );
62    assert( typeof(double) == preproc_constants.EXPR_CONDITIONAL.GetType() );
63
64  }
65  static void assert(bool assertion) {
66    if (!assertion)
67      throw new ApplicationException("test failed");
68  }
69}