/IronPython_Main/Runtime/Tests/ETScenarios/Conversions.cs

# · C# · 73625 lines · 70779 code · 2844 blank · 2 comment · 2 complexity · 3e7ebc728cfe1966ce5315d9130ed40a MD5 · raw file

Large files are truncated click here to view the full file

  1. #if !CLR2
  2. using System.Linq.Expressions;
  3. #else
  4. using Microsoft.Scripting.Ast;
  5. #endif
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Reflection;
  9. namespace ETScenarios {
  10. using EU = ETUtils.ExpressionUtils;
  11. using Expr = Expression;
  12. using AstUtils = Microsoft.Scripting.Ast.Utils;
  13. public class Conversions {
  14. private static Expr TE(Type t, string Message) {
  15. ConstructorInfo ci = t.GetConstructor(new Type[] { typeof(String) });
  16. Expression Ex = Expr.New(ci, Expr.Constant(Message));
  17. return Ex;
  18. }
  19. //Void type. No declaration needed
  20. public class BooleanType {
  21. public static Boolean TrueVal = true;
  22. public static Boolean FalseVal = false;
  23. public static Boolean defaultvalueval = true;
  24. }
  25. public class sbyteType {
  26. public static sbyte MinValue = sbyte.MinValue;
  27. public static sbyte MaxValue = sbyte.MaxValue;
  28. public static sbyte defaultvalueval = (sbyte)5;
  29. public static sbyte Zero = (sbyte)0;
  30. }
  31. public class byteType {
  32. public static byte MinValue = byte.MinValue;
  33. public static byte MaxValue = byte.MaxValue;
  34. public static byte defaultvalueval = (byte)5;
  35. public static byte Zero = (byte)0;
  36. }
  37. public class shortType {
  38. public static short MinValue = short.MinValue;
  39. public static short MaxValue = short.MaxValue;
  40. public static short defaultvalueval = (short)5;
  41. public static short Zero = (short)0;
  42. }
  43. public class ushortType {
  44. public static ushort MinValue = ushort.MinValue;
  45. public static ushort MaxValue = ushort.MaxValue;
  46. public static ushort defaultvalueval = (ushort)5;
  47. public static ushort Zero = (ushort)0;
  48. }
  49. public class intType {
  50. public static int MinValue = int.MinValue;
  51. public static int MaxValue = int.MaxValue;
  52. public static int defaultvalueval = (int)5;
  53. public static int Zero = (int)0;
  54. }
  55. public class uintType {
  56. public static uint MinValue = uint.MinValue;
  57. public static uint MaxValue = uint.MaxValue;
  58. public static uint defaultvalueval = (uint)5;
  59. public static uint Zero = (uint)0;
  60. }
  61. public class longType {
  62. public static long MinValue = long.MinValue;
  63. public static long MaxValue = long.MaxValue;
  64. public static long defaultvalueval = (long)5;
  65. public static long Zero = (long)0;
  66. }
  67. public class ulongType {
  68. public static ulong MinValue = ulong.MinValue;
  69. public static ulong MaxValue = ulong.MaxValue;
  70. public static ulong defaultvalueval = (ulong)5;
  71. public static ulong Zero = (ulong)0;
  72. }
  73. public class decimalType {
  74. public static decimal MinValue = decimal.MinValue;
  75. public static decimal MaxValue = decimal.MaxValue;
  76. public static decimal defaultvalueval = (decimal)5;
  77. public static decimal Zero = (decimal)0;
  78. }
  79. public class floatType {
  80. public static float MinValue = float.MinValue;
  81. public static float MaxValue = float.MaxValue;
  82. public static float defaultvalueval = (float)5;
  83. public static float Zero = (float)0;
  84. }
  85. public class doubleType {
  86. public static double MinValue = double.MinValue;
  87. public static double MaxValue = double.MaxValue;
  88. public static double defaultvalueval = (double)5;
  89. public static double Zero = (double)0;
  90. }
  91. public class DateTimeType {
  92. public static DateTime MinValue = DateTime.MinValue;
  93. public static DateTime MaxValue = DateTime.MaxValue;
  94. public static DateTime defaultvalueval = DateTime.Parse("1/2/3");
  95. public static DateTime Zero = DateTime.Parse("1/1/1");
  96. }
  97. public class stringType {
  98. public static string defaultvalueval = "abc123!";
  99. public static string nullval = (string)null;
  100. public static string Zero = "";
  101. }
  102. public class charType {
  103. public static char defaultvalueval = 'c';
  104. #if SILVERLIGHT
  105. public static char Zero = Convert.ToChar(0);
  106. #else
  107. public static char Zero = char.ConvertFromUtf32(0)[0];
  108. #endif
  109. }
  110. public enum sbyteenum : sbyte {
  111. }
  112. public class sbyteenumType {
  113. public static sbyteenum MinValue = (sbyteenum)sbyte.MinValue;
  114. public static sbyteenum MaxValue = (sbyteenum)sbyte.MaxValue;
  115. public static sbyteenum defaultvalueval = (sbyteenum)5;
  116. public static sbyteenum Zero = (sbyteenum)0;
  117. }
  118. public enum byteenum : byte {
  119. }
  120. public class byteenumType {
  121. public static byteenum MinValue = (byteenum)byte.MinValue;
  122. public static byteenum MaxValue = (byteenum)byte.MaxValue;
  123. public static byteenum defaultvalueval = (byteenum)5;
  124. public static byteenum Zero = (byteenum)0;
  125. }
  126. public enum shortenum : short {
  127. }
  128. public class shortenumType {
  129. public static shortenum MinValue = (shortenum)short.MinValue;
  130. public static shortenum MaxValue = (shortenum)short.MaxValue;
  131. public static shortenum defaultvalueval = (shortenum)5;
  132. public static shortenum Zero = (shortenum)0;
  133. }
  134. public enum ushortenum : ushort {
  135. }
  136. public class ushortenumType {
  137. public static ushortenum MinValue = (ushortenum)ushort.MinValue;
  138. public static ushortenum MaxValue = (ushortenum)ushort.MaxValue;
  139. public static ushortenum defaultvalueval = (ushortenum)5;
  140. public static ushortenum Zero = (ushortenum)0;
  141. }
  142. public enum intenum : int {
  143. }
  144. public class intenumType {
  145. public static intenum MinValue = (intenum)int.MinValue;
  146. public static intenum MaxValue = (intenum)int.MaxValue;
  147. public static intenum defaultvalueval = (intenum)5;
  148. public static intenum Zero = (intenum)0;
  149. }
  150. public enum uintenum : uint {
  151. }
  152. public class uintenumType {
  153. public static uintenum MinValue = (uintenum)uint.MinValue;
  154. public static uintenum MaxValue = (uintenum)uint.MaxValue;
  155. public static uintenum defaultvalueval = (uintenum)5;
  156. public static uintenum Zero = (uintenum)0;
  157. }
  158. public enum longenum : long {
  159. }
  160. public class longenumType {
  161. public static longenum MinValue = (longenum)long.MinValue;
  162. public static longenum MaxValue = (longenum)long.MaxValue;
  163. public static longenum defaultvalueval = (longenum)5;
  164. public static longenum Zero = (longenum)0;
  165. }
  166. public enum ulongenum : ulong {
  167. }
  168. public class ulongenumType {
  169. public static ulongenum MinValue = (ulongenum)ulong.MinValue;
  170. public static ulongenum MaxValue = (ulongenum)ulong.MaxValue;
  171. public static ulongenum defaultvalueval = (ulongenum)5;
  172. public static ulongenum Zero = (ulongenum)0;
  173. }
  174. public struct structure {
  175. int x;
  176. void foo() {
  177. x = 5;
  178. Console.WriteLine(x);
  179. }
  180. public static bool operator ==(structure a, structure b) {
  181. return a.x == b.x;
  182. }
  183. public static bool operator !=(structure a, structure b) {
  184. return a.x != b.x;
  185. }
  186. public override int GetHashCode() {
  187. return base.GetHashCode();
  188. }
  189. public override bool Equals(object obj) {
  190. return base.Equals(obj);
  191. }
  192. }
  193. public class structureType {
  194. public static structure defaultvalueval;
  195. }
  196. public class BooleanNullableType {
  197. public static Boolean? TrueVal = (Boolean?)true;
  198. public static Boolean? FalseVal = (Boolean?)false;
  199. public static Boolean? nullval = (Boolean?)null;
  200. public static Boolean? defaultvalueval = (Boolean?)true;
  201. }
  202. public class sbyteNullableType {
  203. public static sbyte? MinValue = (sbyte?)sbyte.MinValue;
  204. public static sbyte? MaxValue = (sbyte?)sbyte.MaxValue;
  205. public static sbyte? nullval = (sbyte?)null;
  206. public static sbyte? defaultvalueval = (sbyte?)5;
  207. public static sbyte? Zero = (sbyte?)0;
  208. }
  209. public class byteNullableType {
  210. public static byte? MinValue = (byte?)byte.MinValue;
  211. public static byte? MaxValue = (byte?)byte.MaxValue;
  212. public static byte? nullval = (byte?)null;
  213. public static byte? defaultvalueval = (byte?)5;
  214. public static byte? Zero = (byte?)0;
  215. }
  216. public class shortNullableType {
  217. public static short? MinValue = (short?)short.MinValue;
  218. public static short? MaxValue = (short?)short.MaxValue;
  219. public static short? nullval = (short?)null;
  220. public static short? defaultvalueval = (short?)5;
  221. public static short? Zero = (short?)0;
  222. }
  223. public class ushortNullableType {
  224. public static ushort? MinValue = (ushort?)ushort.MinValue;
  225. public static ushort? MaxValue = (ushort?)ushort.MaxValue;
  226. public static ushort? nullval = (ushort?)null;
  227. public static ushort? defaultvalueval = (ushort?)5;
  228. public static ushort? Zero = (ushort?)0;
  229. }
  230. public class intNullableType {
  231. public static int? MinValue = (int?)int.MinValue;
  232. public static int? MaxValue = (int?)int.MaxValue;
  233. public static int? nullval = (int?)null;
  234. public static int? defaultvalueval = (int?)5;
  235. public static int? Zero = (int?)0;
  236. }
  237. public class uintNullableType {
  238. public static uint? MinValue = (uint?)uint.MinValue;
  239. public static uint? MaxValue = (uint?)uint.MaxValue;
  240. public static uint? nullval = (uint?)null;
  241. public static uint? defaultvalueval = (uint?)5;
  242. public static uint? Zero = (uint?)0;
  243. }
  244. public class longNullableType {
  245. public static long? MinValue = (long?)long.MinValue;
  246. public static long? MaxValue = (long?)long.MaxValue;
  247. public static long? nullval = (long?)null;
  248. public static long? defaultvalueval = (long?)5;
  249. public static long? Zero = (long?)0;
  250. }
  251. public class ulongNullableType {
  252. public static ulong? MinValue = (ulong?)ulong.MinValue;
  253. public static ulong? MaxValue = (ulong?)ulong.MaxValue;
  254. public static ulong? nullval = (ulong?)null;
  255. public static ulong? defaultvalueval = (ulong?)5;
  256. public static ulong? Zero = (ulong?)0;
  257. }
  258. public class decimalNullableType {
  259. public static decimal? MinValue = (decimal?)decimal.MinValue;
  260. public static decimal? MaxValue = (decimal?)decimal.MaxValue;
  261. public static decimal? nullval = (decimal?)null;
  262. public static decimal? defaultvalueval = (decimal?)5;
  263. public static decimal? Zero = (decimal?)0;
  264. }
  265. public class floatNullableType {
  266. public static float? MinValue = (float?)float.MinValue;
  267. public static float? MaxValue = (float?)float.MaxValue;
  268. public static float? nullval = (float?)null;
  269. public static float? defaultvalueval = (float?)5;
  270. public static float? Zero = (float?)0;
  271. }
  272. public class doubleNullableType {
  273. public static double? MinValue = (double?)double.MinValue;
  274. public static double? MaxValue = (double?)double.MaxValue;
  275. public static double? nullval = (double?)null;
  276. public static double? defaultvalueval = (double?)5;
  277. public static double? Zero = (double?)0;
  278. }
  279. public class DateTimeNullableType {
  280. public static DateTime? MinValue = (DateTime?)DateTime.MinValue;
  281. public static DateTime? MaxValue = (DateTime?)DateTime.MaxValue;
  282. public static DateTime? nullval = (DateTime?)null;
  283. public static DateTime? defaultvalueval = (DateTime?)DateTime.Parse("1/2/3");
  284. public static DateTime? Zero = (DateTime?)DateTime.Parse("1/1/1");
  285. }
  286. public class charNullableType {
  287. public static char? defaultvalueval = (char?)'c';
  288. public static char? nullval = (char?)null;
  289. #if SILVERLIGHT
  290. public static char? Zero = (char?)Convert.ToChar(0);
  291. #else
  292. public static char? Zero = (char?)char.ConvertFromUtf32(0)[0];
  293. #endif
  294. }
  295. public enum sbyteenumNullable : sbyte {
  296. }
  297. public class sbyteenumNullableType {
  298. public static sbyteenum? MinValue = (sbyteenum?)sbyte.MinValue;
  299. public static sbyteenum? MaxValue = (sbyteenum?)sbyte.MaxValue;
  300. public static sbyteenum? defaultvalueval = (sbyteenum?)5;
  301. public static sbyteenum? nullval = (sbyteenum?)null;
  302. public static sbyteenum? Zero = (sbyteenum?)0;
  303. }
  304. public enum byteenumNullable : byte {
  305. }
  306. public class byteenumNullableType {
  307. public static byteenum? MinValue = (byteenum?)byte.MinValue;
  308. public static byteenum? MaxValue = (byteenum?)byte.MaxValue;
  309. public static byteenum? nullval = (byteenum?)null;
  310. public static byteenum? defaultvalueval = (byteenum?)5;
  311. public static byteenum? Zero = (byteenum?)0;
  312. }
  313. public enum shortenumNullable : short {
  314. }
  315. public class shortenumNullableType {
  316. public static shortenum? MinValue = (shortenum?)short.MinValue;
  317. public static shortenum? MaxValue = (shortenum?)short.MaxValue;
  318. public static shortenum? nullval = (shortenum?)null;
  319. public static shortenum? defaultvalueval = (shortenum?)5;
  320. public static shortenum? Zero = (shortenum?)0;
  321. }
  322. public enum ushortenumNullable : ushort {
  323. }
  324. public class ushortenumNullableType {
  325. public static ushortenum? MinValue = (ushortenum?)ushort.MinValue;
  326. public static ushortenum? MaxValue = (ushortenum?)ushort.MaxValue;
  327. public static ushortenum? nullval = (ushortenum?)null;
  328. public static ushortenum? defaultvalueval = (ushortenum?)5;
  329. public static ushortenum? Zero = (ushortenum?)0;
  330. }
  331. public enum intenumNullable : int {
  332. }
  333. public class intenumNullableType {
  334. public static intenum? MinValue = (intenum?)int.MinValue;
  335. public static intenum? MaxValue = (intenum?)int.MaxValue;
  336. public static intenum? nullval = (intenum?)null;
  337. public static intenum? defaultvalueval = (intenum?)5;
  338. public static intenum? Zero = (intenum?)0;
  339. }
  340. public enum uintenumNullable : uint {
  341. }
  342. public class uintenumNullableType {
  343. public static uintenum? MinValue = (uintenum?)uint.MinValue;
  344. public static uintenum? MaxValue = (uintenum?)uint.MaxValue;
  345. public static uintenum? nullval = (uintenum?)null;
  346. public static uintenum? defaultvalueval = (uintenum?)5;
  347. public static uintenum? Zero = (uintenum?)0;
  348. }
  349. public enum longenumNullable : long {
  350. }
  351. public class longenumNullableType {
  352. public static longenum? MinValue = (longenum?)long.MinValue;
  353. public static longenum? MaxValue = (longenum?)long.MaxValue;
  354. public static longenum? nullval = (longenum?)null;
  355. public static longenum? defaultvalueval = (longenum?)5;
  356. public static longenum? Zero = (longenum?)0;
  357. }
  358. public enum ulongenumNullable : ulong {
  359. }
  360. public class ulongenumNullableType {
  361. public static ulongenum? MinValue = (ulongenum?)ulong.MinValue;
  362. public static ulongenum? MaxValue = (ulongenum?)ulong.MaxValue;
  363. public static ulongenum? nullval = (ulongenum?)null;
  364. public static ulongenum? defaultvalueval = (ulongenum?)5;
  365. public static ulongenum? Zero = (ulongenum?)0;
  366. }
  367. public struct structureNullable {
  368. int x;
  369. void foo() {
  370. x = 5;
  371. Console.WriteLine(x);
  372. }
  373. }
  374. public class structureNullableType {
  375. public static structure? defaultvalueval = new structure();
  376. public static structure? nullval = (structure?)null;
  377. }
  378. public class Class1 {
  379. int x;
  380. void foo() {
  381. x = 5;
  382. Console.WriteLine(x);
  383. }
  384. }
  385. public class Class1Type {
  386. public static Class1 defaultvalueval = new Class1();
  387. public static Class1 nullval = (Class1)null;
  388. }
  389. public interface Interface1 {
  390. int x();
  391. }
  392. public class Interface1Type {
  393. public static Interface1 defaultvalueval;
  394. public static Interface1 nullval = (Interface1)null;
  395. }
  396. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 1", new string[] { "positive", "convert", "Pri2" }, Priority = 2)]
  397. public static Expr Convert1(EU.IValidator V) {
  398. List<Expression> Expressions = new List<Expression>();
  399. //just checking no exception is thrown.
  400. Expressions.Add(Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(void)));
  401. var tree = Expr.Block(Expressions);
  402. V.Validate(tree);
  403. return tree;
  404. }
  405. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 2", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  406. public static Expr Convert2(EU.IValidator V) {
  407. List<Expression> Expressions = new List<Expression>();
  408. ParameterExpression Result = Expr.Variable(typeof(Boolean), "");
  409. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  410. {
  411. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(Boolean)));
  412. }));
  413. var tree = Expr.Block(new[] { Result }, Expressions);
  414. return tree;
  415. }
  416. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 3", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  417. public static Expr Convert3(EU.IValidator V) {
  418. List<Expression> Expressions = new List<Expression>();
  419. ParameterExpression Result = Expr.Variable(typeof(sbyte), "");
  420. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  421. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(sbyte)));}) );
  422. var tree = Expr.Block(new[] { Result }, Expressions);
  423. return tree;
  424. }
  425. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 4", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  426. public static Expr Convert4(EU.IValidator V) {
  427. List<Expression> Expressions = new List<Expression>();
  428. ParameterExpression Result = Expr.Variable(typeof(byte), "");
  429. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  430. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(byte)));}) );
  431. var tree = Expr.Block(new[] { Result }, Expressions);
  432. return tree;
  433. }
  434. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 5", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  435. public static Expr Convert5(EU.IValidator V) {
  436. List<Expression> Expressions = new List<Expression>();
  437. ParameterExpression Result = Expr.Variable(typeof(short), "");
  438. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  439. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(short)));}) );
  440. var tree = Expr.Block(new[] { Result }, Expressions);
  441. return tree;
  442. }
  443. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 6", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  444. public static Expr Convert6(EU.IValidator V) {
  445. List<Expression> Expressions = new List<Expression>();
  446. ParameterExpression Result = Expr.Variable(typeof(ushort), "");
  447. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  448. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ushort)));}) );
  449. var tree = Expr.Block(new[] { Result }, Expressions);
  450. return tree;
  451. }
  452. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 7", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  453. public static Expr Convert7(EU.IValidator V) {
  454. List<Expression> Expressions = new List<Expression>();
  455. ParameterExpression Result = Expr.Variable(typeof(int), "");
  456. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  457. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(int)));}) );
  458. var tree = Expr.Block(new[] { Result }, Expressions);
  459. return tree;
  460. }
  461. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 8", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  462. public static Expr Convert8(EU.IValidator V) {
  463. List<Expression> Expressions = new List<Expression>();
  464. ParameterExpression Result = Expr.Variable(typeof(uint), "");
  465. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  466. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(uint)));}) );
  467. var tree = Expr.Block(new[] { Result }, Expressions);
  468. return tree;
  469. }
  470. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 9", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  471. public static Expr Convert9(EU.IValidator V) {
  472. List<Expression> Expressions = new List<Expression>();
  473. ParameterExpression Result = Expr.Variable(typeof(long), "");
  474. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  475. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(long)));}) );
  476. var tree = Expr.Block(new[] { Result }, Expressions);
  477. return tree;
  478. }
  479. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 10", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  480. public static Expr Convert10(EU.IValidator V) {
  481. List<Expression> Expressions = new List<Expression>();
  482. ParameterExpression Result = Expr.Variable(typeof(ulong), "");
  483. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  484. {
  485. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ulong)));
  486. }));
  487. var tree = Expr.Block(new[] { Result }, Expressions);
  488. return tree;
  489. }
  490. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 11", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  491. public static Expr Convert11(EU.IValidator V) {
  492. List<Expression> Expressions = new List<Expression>();
  493. ParameterExpression Result = Expr.Variable(typeof(decimal), "");
  494. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  495. {
  496. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(decimal)));
  497. }));
  498. var tree = Expr.Block(new[] { Result }, Expressions);
  499. return tree;
  500. }
  501. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 12", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  502. public static Expr Convert12(EU.IValidator V) {
  503. List<Expression> Expressions = new List<Expression>();
  504. ParameterExpression Result = Expr.Variable(typeof(float), "");
  505. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  506. {
  507. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(float)));
  508. }));
  509. var tree = Expr.Block(new[] { Result }, Expressions);
  510. return tree;
  511. }
  512. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 13", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  513. public static Expr Convert13(EU.IValidator V) {
  514. List<Expression> Expressions = new List<Expression>();
  515. ParameterExpression Result = Expr.Variable(typeof(double), "");
  516. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  517. {
  518. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(double)));
  519. }));
  520. var tree = Expr.Block(new[] { Result }, Expressions);
  521. return tree;
  522. }
  523. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 14", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  524. public static Expr Convert14(EU.IValidator V) {
  525. List<Expression> Expressions = new List<Expression>();
  526. ParameterExpression Result = Expr.Variable(typeof(DateTime), "");
  527. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  528. {
  529. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(DateTime)));
  530. }));
  531. var tree = Expr.Block(new[] { Result }, Expressions);
  532. return tree;
  533. }
  534. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 15", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  535. public static Expr Convert15(EU.IValidator V) {
  536. List<Expression> Expressions = new List<Expression>();
  537. ParameterExpression Result = Expr.Variable(typeof(string), "");
  538. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  539. {
  540. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(string)));
  541. }));
  542. var tree = Expr.Block(new[] { Result }, Expressions);
  543. return tree;
  544. }
  545. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 16", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  546. public static Expr Convert16(EU.IValidator V) {
  547. List<Expression> Expressions = new List<Expression>();
  548. ParameterExpression Result = Expr.Variable(typeof(char), "");
  549. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  550. {
  551. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(char)));
  552. }));
  553. var tree = Expr.Block(new[] { Result }, Expressions);
  554. return tree;
  555. }
  556. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 17", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  557. public static Expr Convert17(EU.IValidator V) {
  558. List<Expression> Expressions = new List<Expression>();
  559. ParameterExpression Result = Expr.Variable(typeof(sbyteenum), "");
  560. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  561. {
  562. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(sbyteenum)));
  563. }));
  564. var tree = Expr.Block(new[] { Result }, Expressions);
  565. return tree;
  566. }
  567. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 18", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  568. public static Expr Convert18(EU.IValidator V) {
  569. List<Expression> Expressions = new List<Expression>();
  570. ParameterExpression Result = Expr.Variable(typeof(byteenum), "");
  571. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  572. {
  573. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(byteenum)));
  574. }));
  575. var tree = Expr.Block(new[] { Result }, Expressions);
  576. return tree;
  577. }
  578. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 19", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  579. public static Expr Convert19(EU.IValidator V) {
  580. List<Expression> Expressions = new List<Expression>();
  581. ParameterExpression Result = Expr.Variable(typeof(shortenum), "");
  582. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  583. {
  584. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(shortenum)));
  585. }));
  586. var tree = Expr.Block(new[] { Result }, Expressions);
  587. return tree;
  588. }
  589. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 20", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  590. public static Expr Convert20(EU.IValidator V) {
  591. List<Expression> Expressions = new List<Expression>();
  592. ParameterExpression Result = Expr.Variable(typeof(ushortenum), "");
  593. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  594. {
  595. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ushortenum)));
  596. }));
  597. var tree = Expr.Block(new[] { Result }, Expressions);
  598. return tree;
  599. }
  600. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 21", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  601. public static Expr Convert21(EU.IValidator V) {
  602. List<Expression> Expressions = new List<Expression>();
  603. ParameterExpression Result = Expr.Variable(typeof(intenum), "");
  604. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  605. {
  606. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(intenum)));
  607. }));
  608. var tree = Expr.Block(new[] { Result }, Expressions);
  609. return tree;
  610. }
  611. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 22", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  612. public static Expr Convert22(EU.IValidator V) {
  613. List<Expression> Expressions = new List<Expression>();
  614. ParameterExpression Result = Expr.Variable(typeof(uintenum), "");
  615. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  616. {
  617. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(uintenum)));
  618. }));
  619. var tree = Expr.Block(new[] { Result }, Expressions);
  620. return tree;
  621. }
  622. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 23", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  623. public static Expr Convert23(EU.IValidator V) {
  624. List<Expression> Expressions = new List<Expression>();
  625. ParameterExpression Result = Expr.Variable(typeof(longenum), "");
  626. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  627. {
  628. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(longenum)));
  629. }));
  630. var tree = Expr.Block(new[] { Result }, Expressions);
  631. return tree;
  632. }
  633. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 24", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  634. public static Expr Convert24(EU.IValidator V) {
  635. List<Expression> Expressions = new List<Expression>();
  636. ParameterExpression Result = Expr.Variable(typeof(ulongenum), "");
  637. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  638. {
  639. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ulongenum)));
  640. }));
  641. var tree = Expr.Block(new[] { Result }, Expressions);
  642. return tree;
  643. }
  644. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 25", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  645. public static Expr Convert25(EU.IValidator V) {
  646. List<Expression> Expressions = new List<Expression>();
  647. ParameterExpression Result = Expr.Variable(typeof(structure), "");
  648. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  649. {
  650. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(structure)));
  651. }));
  652. var tree = Expr.Block(new[] { Result }, Expressions);
  653. return tree;
  654. }
  655. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 26", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  656. public static Expr Convert26(EU.IValidator V) {
  657. List<Expression> Expressions = new List<Expression>();
  658. ParameterExpression Result = Expr.Variable(typeof(Boolean?), "");
  659. Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
  660. {
  661. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(Boolean?)));
  662. }));
  663. var tree = Expr.Block(new[] { Result }, Expressions);
  664. return tree;
  665. }
  666. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 27", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  667. public static Expr Convert27(EU.IValidator V) {
  668. List<Expression> Expressions = new List<Expression>();
  669. ParameterExpression Result = Expr.Variable(typeof(sbyte?), "");
  670. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  671. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(sbyte?)));}) );
  672. var tree = Expr.Block(new[] { Result }, Expressions);
  673. return tree;
  674. }
  675. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 28", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  676. public static Expr Convert28(EU.IValidator V) {
  677. List<Expression> Expressions = new List<Expression>();
  678. ParameterExpression Result = Expr.Variable(typeof(byte?), "");
  679. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  680. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(byte?)));}) );
  681. var tree = Expr.Block(new[] { Result }, Expressions);
  682. return tree;
  683. }
  684. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 29", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  685. public static Expr Convert29(EU.IValidator V) {
  686. List<Expression> Expressions = new List<Expression>();
  687. ParameterExpression Result = Expr.Variable(typeof(short?), "");
  688. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  689. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(short?)));}) );
  690. var tree = Expr.Block(new[] { Result }, Expressions);
  691. return tree;
  692. }
  693. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 30", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  694. public static Expr Convert30(EU.IValidator V) {
  695. List<Expression> Expressions = new List<Expression>();
  696. ParameterExpression Result = Expr.Variable(typeof(ushort?), "");
  697. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  698. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ushort?)));}) );
  699. var tree = Expr.Block(new[] { Result }, Expressions);
  700. return tree;
  701. }
  702. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 31", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  703. public static Expr Convert31(EU.IValidator V) {
  704. List<Expression> Expressions = new List<Expression>();
  705. ParameterExpression Result = Expr.Variable(typeof(int?), "");
  706. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  707. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(int?)));}) );
  708. var tree = Expr.Block(new[] { Result }, Expressions);
  709. return tree;
  710. }
  711. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 32", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  712. public static Expr Convert32(EU.IValidator V) {
  713. List<Expression> Expressions = new List<Expression>();
  714. ParameterExpression Result = Expr.Variable(typeof(uint?), "");
  715. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  716. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(uint?)));}) );
  717. var tree = Expr.Block(new[] { Result }, Expressions);
  718. return tree;
  719. }
  720. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 33", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  721. public static Expr Convert33(EU.IValidator V) {
  722. List<Expression> Expressions = new List<Expression>();
  723. ParameterExpression Result = Expr.Variable(typeof(long?), "");
  724. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  725. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(long?)));}) );
  726. var tree = Expr.Block(new[] { Result }, Expressions);
  727. return tree;
  728. }
  729. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 34", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  730. public static Expr Convert34(EU.IValidator V) {
  731. List<Expression> Expressions = new List<Expression>();
  732. ParameterExpression Result = Expr.Variable(typeof(ulong?), "");
  733. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  734. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ulong?)));}) );
  735. var tree = Expr.Block(new[] { Result }, Expressions);
  736. return tree;
  737. }
  738. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 35", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  739. public static Expr Convert35(EU.IValidator V) {
  740. List<Expression> Expressions = new List<Expression>();
  741. ParameterExpression Result = Expr.Variable(typeof(decimal?), "");
  742. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  743. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(decimal?)));}) );
  744. var tree = Expr.Block(new[] { Result }, Expressions);
  745. return tree;
  746. }
  747. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 36", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  748. public static Expr Convert36(EU.IValidator V) {
  749. List<Expression> Expressions = new List<Expression>();
  750. ParameterExpression Result = Expr.Variable(typeof(float?), "");
  751. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  752. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(float?)));}) );
  753. var tree = Expr.Block(new[] { Result }, Expressions);
  754. return tree;
  755. }
  756. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 37", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  757. public static Expr Convert37(EU.IValidator V) {
  758. List<Expression> Expressions = new List<Expression>();
  759. ParameterExpression Result = Expr.Variable(typeof(double?), "");
  760. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  761. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(double?)));}) );
  762. var tree = Expr.Block(new[] { Result }, Expressions);
  763. return tree;
  764. }
  765. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 38", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  766. public static Expr Convert38(EU.IValidator V) {
  767. List<Expression> Expressions = new List<Expression>();
  768. ParameterExpression Result = Expr.Variable(typeof(DateTime?), "");
  769. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  770. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(DateTime?)));}) );
  771. var tree = Expr.Block(new[] { Result }, Expressions);
  772. return tree;
  773. }
  774. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 39", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  775. public static Expr Convert39(EU.IValidator V) {
  776. List<Expression> Expressions = new List<Expression>();
  777. ParameterExpression Result = Expr.Variable(typeof(char?), "");
  778. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  779. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(char?)));}) );
  780. var tree = Expr.Block(new[] { Result }, Expressions);
  781. return tree;
  782. }
  783. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 40", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  784. public static Expr Convert40(EU.IValidator V) {
  785. List<Expression> Expressions = new List<Expression>();
  786. ParameterExpression Result = Expr.Variable(typeof(sbyteenum?), "");
  787. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  788. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(sbyteenum?)));}) );
  789. var tree = Expr.Block(new[] { Result }, Expressions);
  790. return tree;
  791. }
  792. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 41", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  793. public static Expr Convert41(EU.IValidator V) {
  794. List<Expression> Expressions = new List<Expression>();
  795. ParameterExpression Result = Expr.Variable(typeof(byteenum?), "");
  796. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  797. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(byteenum?)));}) );
  798. var tree = Expr.Block(new[] { Result }, Expressions);
  799. return tree;
  800. }
  801. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 42", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  802. public static Expr Convert42(EU.IValidator V) {
  803. List<Expression> Expressions = new List<Expression>();
  804. ParameterExpression Result = Expr.Variable(typeof(shortenum?), "");
  805. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  806. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(shortenum?)));}) );
  807. var tree = Expr.Block(new[] { Result }, Expressions);
  808. return tree;
  809. }
  810. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 43", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  811. public static Expr Convert43(EU.IValidator V) {
  812. List<Expression> Expressions = new List<Expression>();
  813. ParameterExpression Result = Expr.Variable(typeof(ushortenum?), "");
  814. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  815. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ushortenum?)));}) );
  816. var tree = Expr.Block(new[] { Result }, Expressions);
  817. return tree;
  818. }
  819. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 44", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  820. public static Expr Convert44(EU.IValidator V) {
  821. List<Expression> Expressions = new List<Expression>();
  822. ParameterExpression Result = Expr.Variable(typeof(intenum?), "");
  823. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  824. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(intenum?)));}) );
  825. var tree = Expr.Block(new[] { Result }, Expressions);
  826. return tree;
  827. }
  828. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 45", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  829. public static Expr Convert45(EU.IValidator V) {
  830. List<Expression> Expressions = new List<Expression>();
  831. ParameterExpression Result = Expr.Variable(typeof(uintenum?), "");
  832. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  833. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(uintenum?)));}) );
  834. var tree = Expr.Block(new[] { Result }, Expressions);
  835. return tree;
  836. }
  837. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 46", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  838. public static Expr Convert46(EU.IValidator V) {
  839. List<Expression> Expressions = new List<Expression>();
  840. ParameterExpression Result = Expr.Variable(typeof(longenum?), "");
  841. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  842. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(longenum?)));}) );
  843. var tree = Expr.Block(new[] { Result }, Expressions);
  844. return tree;
  845. }
  846. [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 47", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
  847. public static Expr Convert47(EU.IValidator V) {
  848. List<Expression> Expressions = new List<Expression>();
  849. ParameterExpression Result = Expr.Variable(typeof(ulongenum?), "");
  850. Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
  851. Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ulongenum?)));}) );
  852. var tree = Expr.Block(new[] { Result }, Expressions);
  853. return tree;
  854. }
  855. [ETUtils.TestAttribute(ETUtils.