PageRenderTime 52ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/DLR_Main/Languages/IronPython/IronPythonTest/IntegerTest.cs

https://bitbucket.org/mdavid/dlr
C# | 237 lines | 218 code | 5 blank | 14 comment | 7 complexity | 925ab231084d1cd1f632aed945369fdf MD5 | raw file
  1. /* ****************************************************************************
  2. *
  3. * Copyright (c) Microsoft Corporation.
  4. *
  5. * This source code is subject to terms and conditions of the Apache License, Version 2.0. A
  6. * copy of the license can be found in the License.html file at the root of this distribution. If
  7. * you cannot locate the Apache License, Version 2.0, please send an email to
  8. * ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
  9. * by the terms of the Apache License, Version 2.0.
  10. *
  11. * You must not remove this notice, or any other, from this software.
  12. *
  13. *
  14. * ***************************************************************************/
  15. using System;
  16. namespace IronPythonTest {
  17. public class IntegerTest {
  18. public static Int32 Int32Int32MaxValue = (Int32)Int32.MaxValue;
  19. public static Int32 Int32Int32MinValue = (Int32)Int32.MinValue;
  20. public static Int32 Int32UInt32MinValue = (Int32)UInt32.MinValue;
  21. public static Int32 Int32Int16MaxValue = (Int32)Int16.MaxValue;
  22. public static Int32 Int32Int16MinValue = (Int32)Int16.MinValue;
  23. public static Int32 Int32UInt16MaxValue = (Int32)UInt16.MaxValue;
  24. public static Int32 Int32UInt16MinValue = (Int32)UInt16.MinValue;
  25. public static Int32 Int32UInt64MinValue = (Int32)UInt64.MinValue;
  26. public static Int32 Int32ByteMaxValue = (Int32)Byte.MaxValue;
  27. public static Int32 Int32ByteMinValue = (Int32)Byte.MinValue;
  28. public static Int32 Int32SByteMaxValue = (Int32)SByte.MaxValue;
  29. public static Int32 Int32SByteMinValue = (Int32)SByte.MinValue;
  30. public static Int32 Int32CharMaxValue = (Int32)Char.MaxValue;
  31. public static Int32 Int32CharMinValue = (Int32)Char.MinValue;
  32. public static Int32 Int32Val0 = (Int32)('a');
  33. public static Int32 Int32Val1 = (Int32)(10);
  34. public static Int32 Int32Val2 = (Int32)(42);
  35. public static Int32 Int32Val3 = (Int32)(-24);
  36. public static Int32 Int32Val6 = (Int32)(0);
  37. public static Int32 Int32Val7 = (Int32)(1);
  38. public static Int32 Int32Val8 = (Int32)(-1);
  39. public static UInt32 UInt32Int32MaxValue = (UInt32)Int32.MaxValue;
  40. public static UInt32 UInt32UInt32MaxValue = (UInt32)UInt32.MaxValue;
  41. public static UInt32 UInt32UInt32MinValue = (UInt32)UInt32.MinValue;
  42. public static UInt32 UInt32Int16MaxValue = (UInt32)Int16.MaxValue;
  43. public static UInt32 UInt32UInt16MaxValue = (UInt32)UInt16.MaxValue;
  44. public static UInt32 UInt32UInt16MinValue = (UInt32)UInt16.MinValue;
  45. public static UInt32 UInt32UInt64MinValue = (UInt32)UInt64.MinValue;
  46. public static UInt32 UInt32ByteMaxValue = (UInt32)Byte.MaxValue;
  47. public static UInt32 UInt32ByteMinValue = (UInt32)Byte.MinValue;
  48. public static UInt32 UInt32SByteMaxValue = (UInt32)SByte.MaxValue;
  49. public static UInt32 UInt32CharMaxValue = (UInt32)Char.MaxValue;
  50. public static UInt32 UInt32CharMinValue = (UInt32)Char.MinValue;
  51. public static UInt32 UInt32Val0 = (UInt32)('a');
  52. public static UInt32 UInt32Val1 = (UInt32)(10);
  53. public static UInt32 UInt32Val2 = (UInt32)(42);
  54. public static UInt32 UInt32Val6 = (UInt32)(0);
  55. public static UInt32 UInt32Val7 = (UInt32)(1);
  56. public static Int16 Int16UInt32MinValue = (Int16)UInt32.MinValue;
  57. public static Int16 Int16Int16MaxValue = (Int16)Int16.MaxValue;
  58. public static Int16 Int16Int16MinValue = (Int16)Int16.MinValue;
  59. public static Int16 Int16UInt16MinValue = (Int16)UInt16.MinValue;
  60. public static Int16 Int16UInt64MinValue = (Int16)UInt64.MinValue;
  61. public static Int16 Int16ByteMaxValue = (Int16)Byte.MaxValue;
  62. public static Int16 Int16ByteMinValue = (Int16)Byte.MinValue;
  63. public static Int16 Int16SByteMaxValue = (Int16)SByte.MaxValue;
  64. public static Int16 Int16SByteMinValue = (Int16)SByte.MinValue;
  65. public static Int16 Int16CharMinValue = (Int16)Char.MinValue;
  66. public static Int16 Int16Val0 = (Int16)('a');
  67. public static Int16 Int16Val1 = (Int16)(10);
  68. public static Int16 Int16Val2 = (Int16)(42);
  69. public static Int16 Int16Val3 = (Int16)(-24);
  70. public static Int16 Int16Val6 = (Int16)(0);
  71. public static Int16 Int16Val7 = (Int16)(1);
  72. public static Int16 Int16Val8 = (Int16)(-1);
  73. public static UInt16 UInt16UInt32MinValue = (UInt16)UInt32.MinValue;
  74. public static UInt16 UInt16Int16MaxValue = (UInt16)Int16.MaxValue;
  75. public static UInt16 UInt16UInt16MaxValue = (UInt16)UInt16.MaxValue;
  76. public static UInt16 UInt16UInt16MinValue = (UInt16)UInt16.MinValue;
  77. public static UInt16 UInt16UInt64MinValue = (UInt16)UInt64.MinValue;
  78. public static UInt16 UInt16ByteMaxValue = (UInt16)Byte.MaxValue;
  79. public static UInt16 UInt16ByteMinValue = (UInt16)Byte.MinValue;
  80. public static UInt16 UInt16SByteMaxValue = (UInt16)SByte.MaxValue;
  81. public static UInt16 UInt16CharMaxValue = (UInt16)Char.MaxValue;
  82. public static UInt16 UInt16CharMinValue = (UInt16)Char.MinValue;
  83. public static UInt16 UInt16Val0 = (UInt16)('a');
  84. public static UInt16 UInt16Val1 = (UInt16)(10);
  85. public static UInt16 UInt16Val2 = (UInt16)(42);
  86. public static UInt16 UInt16Val6 = (UInt16)(0);
  87. public static UInt16 UInt16Val7 = (UInt16)(1);
  88. public static Int64 Int64Int32MaxValue = (Int64)Int32.MaxValue;
  89. public static Int64 Int64Int32MinValue = (Int64)Int32.MinValue;
  90. public static Int64 Int64UInt32MaxValue = (Int64)UInt32.MaxValue;
  91. public static Int64 Int64UInt32MinValue = (Int64)UInt32.MinValue;
  92. public static Int64 Int64Int16MaxValue = (Int64)Int16.MaxValue;
  93. public static Int64 Int64Int16MinValue = (Int64)Int16.MinValue;
  94. public static Int64 Int64UInt16MaxValue = (Int64)UInt16.MaxValue;
  95. public static Int64 Int64UInt16MinValue = (Int64)UInt16.MinValue;
  96. public static Int64 Int64Int64MaxValue = (Int64)Int64.MaxValue;
  97. public static Int64 Int64Int64MinValue = (Int64)Int64.MinValue;
  98. public static Int64 Int64UInt64MinValue = (Int64)UInt64.MinValue;
  99. public static Int64 Int64ByteMaxValue = (Int64)Byte.MaxValue;
  100. public static Int64 Int64ByteMinValue = (Int64)Byte.MinValue;
  101. public static Int64 Int64SByteMaxValue = (Int64)SByte.MaxValue;
  102. public static Int64 Int64SByteMinValue = (Int64)SByte.MinValue;
  103. public static Int64 Int64CharMaxValue = (Int64)Char.MaxValue;
  104. public static Int64 Int64CharMinValue = (Int64)Char.MinValue;
  105. public static Int64 Int64Val0 = (Int64)('a');
  106. public static Int64 Int64Val1 = (Int64)(10);
  107. public static Int64 Int64Val2 = (Int64)(42);
  108. public static Int64 Int64Val3 = (Int64)(-24);
  109. public static Int64 Int64Val6 = (Int64)(0);
  110. public static Int64 Int64Val7 = (Int64)(1);
  111. public static Int64 Int64Val8 = (Int64)(-1);
  112. public static UInt64 UInt64Int32MaxValue = (UInt64)Int32.MaxValue;
  113. public static UInt64 UInt64UInt32MaxValue = (UInt64)UInt32.MaxValue;
  114. public static UInt64 UInt64UInt32MinValue = (UInt64)UInt32.MinValue;
  115. public static UInt64 UInt64Int16MaxValue = (UInt64)Int16.MaxValue;
  116. public static UInt64 UInt64UInt16MaxValue = (UInt64)UInt16.MaxValue;
  117. public static UInt64 UInt64UInt16MinValue = (UInt64)UInt16.MinValue;
  118. public static UInt64 UInt64Int64MaxValue = (UInt64)Int64.MaxValue;
  119. public static UInt64 UInt64UInt64MaxValue = (UInt64)UInt64.MaxValue;
  120. public static UInt64 UInt64UInt64MinValue = (UInt64)UInt64.MinValue;
  121. public static UInt64 UInt64ByteMaxValue = (UInt64)Byte.MaxValue;
  122. public static UInt64 UInt64ByteMinValue = (UInt64)Byte.MinValue;
  123. public static UInt64 UInt64SByteMaxValue = (UInt64)SByte.MaxValue;
  124. public static UInt64 UInt64CharMaxValue = (UInt64)Char.MaxValue;
  125. public static UInt64 UInt64CharMinValue = (UInt64)Char.MinValue;
  126. public static UInt64 UInt64Val0 = (UInt64)('a');
  127. public static UInt64 UInt64Val1 = (UInt64)(10);
  128. public static UInt64 UInt64Val2 = (UInt64)(42);
  129. public static UInt64 UInt64Val6 = (UInt64)(0);
  130. public static UInt64 UInt64Val7 = (UInt64)(1);
  131. public static Byte ByteUInt32MinValue = (Byte)UInt32.MinValue;
  132. public static Byte ByteUInt16MinValue = (Byte)UInt16.MinValue;
  133. public static Byte ByteUInt64MinValue = (Byte)UInt64.MinValue;
  134. public static Byte ByteByteMaxValue = (Byte)Byte.MaxValue;
  135. public static Byte ByteByteMinValue = (Byte)Byte.MinValue;
  136. public static Byte ByteSByteMaxValue = (Byte)SByte.MaxValue;
  137. public static Byte ByteCharMinValue = (Byte)Char.MinValue;
  138. public static Byte ByteVal0 = (Byte)('a');
  139. public static Byte ByteVal1 = (Byte)(10);
  140. public static Byte ByteVal2 = (Byte)(42);
  141. public static Byte ByteVal6 = (Byte)(0);
  142. public static Byte ByteVal7 = (Byte)(1);
  143. public static SByte SByteUInt32MinValue = (SByte)UInt32.MinValue;
  144. public static SByte SByteUInt16MinValue = (SByte)UInt16.MinValue;
  145. public static SByte SByteUInt64MinValue = (SByte)UInt64.MinValue;
  146. public static SByte SByteByteMinValue = (SByte)Byte.MinValue;
  147. public static SByte SByteSByteMaxValue = (SByte)SByte.MaxValue;
  148. public static SByte SByteSByteMinValue = (SByte)SByte.MinValue;
  149. public static SByte SByteCharMinValue = (SByte)Char.MinValue;
  150. public static SByte SByteVal0 = (SByte)('a');
  151. public static SByte SByteVal1 = (SByte)(10);
  152. public static SByte SByteVal2 = (SByte)(42);
  153. public static SByte SByteVal3 = (SByte)(-24);
  154. public static SByte SByteVal6 = (SByte)(0);
  155. public static SByte SByteVal7 = (SByte)(1);
  156. public static SByte SByteVal8 = (SByte)(-1);
  157. public static Char CharUInt32MinValue = (Char)UInt32.MinValue;
  158. public static Char CharInt16MaxValue = (Char)Int16.MaxValue;
  159. public static Char CharUInt16MaxValue = (Char)UInt16.MaxValue;
  160. public static Char CharUInt16MinValue = (Char)UInt16.MinValue;
  161. public static Char CharUInt64MinValue = (Char)UInt64.MinValue;
  162. public static Char CharByteMaxValue = (Char)Byte.MaxValue;
  163. public static Char CharByteMinValue = (Char)Byte.MinValue;
  164. public static Char CharSByteMaxValue = (Char)SByte.MaxValue;
  165. public static Char CharCharMaxValue = (Char)Char.MaxValue;
  166. public static Char CharCharMinValue = (Char)Char.MinValue;
  167. public static Char CharVal0 = (Char)('a');
  168. public static Char CharVal1 = (Char)(10);
  169. public static Char CharVal2 = (Char)(42);
  170. public static Char CharVal6 = (Char)(0);
  171. public static Char CharVal7 = (Char)(1);
  172. public static Boolean BooleanInt32MaxValue = (Boolean)true;
  173. public static Boolean BooleanInt32MinValue = (Boolean)true;
  174. public static Boolean BooleanUInt32MaxValue = (Boolean)true;
  175. public static Boolean BooleanUInt32MinValue = (Boolean)false;
  176. public static Boolean BooleanInt16MaxValue = (Boolean)true;
  177. public static Boolean BooleanInt16MinValue = (Boolean)true;
  178. public static Boolean BooleanUInt16MaxValue = (Boolean)true;
  179. public static Boolean BooleanUInt16MinValue = (Boolean)false;
  180. public static Boolean BooleanInt64MaxValue = (Boolean)true;
  181. public static Boolean BooleanInt64MinValue = (Boolean)true;
  182. public static Boolean BooleanUInt64MaxValue = (Boolean)true;
  183. public static Boolean BooleanUInt64MinValue = (Boolean)false;
  184. public static Boolean BooleanByteMaxValue = (Boolean)true;
  185. public static Boolean BooleanByteMinValue = (Boolean)false;
  186. public static Boolean BooleanSByteMaxValue = (Boolean)true;
  187. public static Boolean BooleanSByteMinValue = (Boolean)true;
  188. public static Boolean BooleanVal1 = (Boolean)(true);
  189. public static Boolean BooleanVal2 = (Boolean)(true);
  190. public static Boolean BooleanVal3 = (Boolean)(true);
  191. public static Boolean BooleanVal4 = (Boolean)(true);
  192. public static Boolean BooleanVal5 = (Boolean)(false);
  193. public static Boolean BooleanVal6 = (Boolean)(false);
  194. public static Boolean BooleanVal7 = (Boolean)(true);
  195. public static Boolean BooleanVal8 = (Boolean)(true);
  196. public static uint uintT(uint val) {
  197. return val;
  198. }
  199. public static ushort ushortT(ushort val) {
  200. return val;
  201. }
  202. public static ulong ulongT(ulong val) {
  203. return val;
  204. }
  205. public static int intT(int val) {
  206. return val;
  207. }
  208. public static short shortT(short val) {
  209. return val;
  210. }
  211. public static long longT(long val) {
  212. return val;
  213. }
  214. public static byte byteT(byte val) {
  215. return val;
  216. }
  217. public static sbyte sbyteT(sbyte val) {
  218. return val;
  219. }
  220. public static char charT(char val) {
  221. return val;
  222. }
  223. public static bool boolT(bool val) {
  224. return val;
  225. }
  226. public static bool AreEqual(object x, object y) {
  227. if (x == y) return true;
  228. if (x == null || y == null) return false;
  229. return x.ToString() == y.ToString();
  230. }
  231. }
  232. }