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