/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
- #if !CLR2
- using System.Linq.Expressions;
- #else
- using Microsoft.Scripting.Ast;
- #endif
-
- using System;
- using System.Collections.Generic;
- using System.Reflection;
-
- namespace ETScenarios {
- using EU = ETUtils.ExpressionUtils;
- using Expr = Expression;
- using AstUtils = Microsoft.Scripting.Ast.Utils;
-
- public class Conversions {
- private static Expr TE(Type t, string Message) {
- ConstructorInfo ci = t.GetConstructor(new Type[] { typeof(String) });
- Expression Ex = Expr.New(ci, Expr.Constant(Message));
- return Ex;
- }
-
-
-
-
-
-
- //Void type. No declaration needed
-
- public class BooleanType {
- public static Boolean TrueVal = true;
- public static Boolean FalseVal = false;
- public static Boolean defaultvalueval = true;
- }
-
- public class sbyteType {
- public static sbyte MinValue = sbyte.MinValue;
- public static sbyte MaxValue = sbyte.MaxValue;
- public static sbyte defaultvalueval = (sbyte)5;
- public static sbyte Zero = (sbyte)0;
- }
-
- public class byteType {
- public static byte MinValue = byte.MinValue;
- public static byte MaxValue = byte.MaxValue;
- public static byte defaultvalueval = (byte)5;
- public static byte Zero = (byte)0;
- }
-
- public class shortType {
- public static short MinValue = short.MinValue;
- public static short MaxValue = short.MaxValue;
- public static short defaultvalueval = (short)5;
- public static short Zero = (short)0;
- }
-
- public class ushortType {
- public static ushort MinValue = ushort.MinValue;
- public static ushort MaxValue = ushort.MaxValue;
- public static ushort defaultvalueval = (ushort)5;
- public static ushort Zero = (ushort)0;
- }
-
- public class intType {
- public static int MinValue = int.MinValue;
- public static int MaxValue = int.MaxValue;
- public static int defaultvalueval = (int)5;
- public static int Zero = (int)0;
- }
-
- public class uintType {
- public static uint MinValue = uint.MinValue;
- public static uint MaxValue = uint.MaxValue;
- public static uint defaultvalueval = (uint)5;
- public static uint Zero = (uint)0;
- }
-
- public class longType {
- public static long MinValue = long.MinValue;
- public static long MaxValue = long.MaxValue;
- public static long defaultvalueval = (long)5;
- public static long Zero = (long)0;
- }
-
- public class ulongType {
- public static ulong MinValue = ulong.MinValue;
- public static ulong MaxValue = ulong.MaxValue;
- public static ulong defaultvalueval = (ulong)5;
- public static ulong Zero = (ulong)0;
- }
-
- public class decimalType {
- public static decimal MinValue = decimal.MinValue;
- public static decimal MaxValue = decimal.MaxValue;
- public static decimal defaultvalueval = (decimal)5;
- public static decimal Zero = (decimal)0;
- }
-
- public class floatType {
- public static float MinValue = float.MinValue;
- public static float MaxValue = float.MaxValue;
- public static float defaultvalueval = (float)5;
- public static float Zero = (float)0;
- }
-
- public class doubleType {
- public static double MinValue = double.MinValue;
- public static double MaxValue = double.MaxValue;
- public static double defaultvalueval = (double)5;
- public static double Zero = (double)0;
- }
-
- public class DateTimeType {
- public static DateTime MinValue = DateTime.MinValue;
- public static DateTime MaxValue = DateTime.MaxValue;
- public static DateTime defaultvalueval = DateTime.Parse("1/2/3");
- public static DateTime Zero = DateTime.Parse("1/1/1");
- }
-
- public class stringType {
- public static string defaultvalueval = "abc123!";
- public static string nullval = (string)null;
- public static string Zero = "";
- }
-
- public class charType {
- public static char defaultvalueval = 'c';
- #if SILVERLIGHT
- public static char Zero = Convert.ToChar(0);
- #else
- public static char Zero = char.ConvertFromUtf32(0)[0];
- #endif
- }
-
- public enum sbyteenum : sbyte {
- }
- public class sbyteenumType {
- public static sbyteenum MinValue = (sbyteenum)sbyte.MinValue;
- public static sbyteenum MaxValue = (sbyteenum)sbyte.MaxValue;
- public static sbyteenum defaultvalueval = (sbyteenum)5;
- public static sbyteenum Zero = (sbyteenum)0;
- }
-
- public enum byteenum : byte {
- }
- public class byteenumType {
- public static byteenum MinValue = (byteenum)byte.MinValue;
- public static byteenum MaxValue = (byteenum)byte.MaxValue;
- public static byteenum defaultvalueval = (byteenum)5;
- public static byteenum Zero = (byteenum)0;
- }
-
- public enum shortenum : short {
- }
- public class shortenumType {
- public static shortenum MinValue = (shortenum)short.MinValue;
- public static shortenum MaxValue = (shortenum)short.MaxValue;
- public static shortenum defaultvalueval = (shortenum)5;
- public static shortenum Zero = (shortenum)0;
- }
-
- public enum ushortenum : ushort {
- }
- public class ushortenumType {
- public static ushortenum MinValue = (ushortenum)ushort.MinValue;
- public static ushortenum MaxValue = (ushortenum)ushort.MaxValue;
- public static ushortenum defaultvalueval = (ushortenum)5;
- public static ushortenum Zero = (ushortenum)0;
- }
-
- public enum intenum : int {
- }
- public class intenumType {
- public static intenum MinValue = (intenum)int.MinValue;
- public static intenum MaxValue = (intenum)int.MaxValue;
- public static intenum defaultvalueval = (intenum)5;
- public static intenum Zero = (intenum)0;
- }
-
- public enum uintenum : uint {
- }
- public class uintenumType {
- public static uintenum MinValue = (uintenum)uint.MinValue;
- public static uintenum MaxValue = (uintenum)uint.MaxValue;
- public static uintenum defaultvalueval = (uintenum)5;
- public static uintenum Zero = (uintenum)0;
- }
-
- public enum longenum : long {
- }
- public class longenumType {
- public static longenum MinValue = (longenum)long.MinValue;
- public static longenum MaxValue = (longenum)long.MaxValue;
- public static longenum defaultvalueval = (longenum)5;
- public static longenum Zero = (longenum)0;
- }
-
- public enum ulongenum : ulong {
- }
- public class ulongenumType {
- public static ulongenum MinValue = (ulongenum)ulong.MinValue;
- public static ulongenum MaxValue = (ulongenum)ulong.MaxValue;
- public static ulongenum defaultvalueval = (ulongenum)5;
- public static ulongenum Zero = (ulongenum)0;
- }
-
- public struct structure {
- int x;
- void foo() {
- x = 5;
- Console.WriteLine(x);
- }
- public static bool operator ==(structure a, structure b) {
- return a.x == b.x;
- }
- public static bool operator !=(structure a, structure b) {
- return a.x != b.x;
- }
- public override int GetHashCode() {
- return base.GetHashCode();
- }
- public override bool Equals(object obj) {
- return base.Equals(obj);
- }
- }
- public class structureType {
- public static structure defaultvalueval;
- }
-
- public class BooleanNullableType {
- public static Boolean? TrueVal = (Boolean?)true;
- public static Boolean? FalseVal = (Boolean?)false;
- public static Boolean? nullval = (Boolean?)null;
- public static Boolean? defaultvalueval = (Boolean?)true;
- }
-
- public class sbyteNullableType {
- public static sbyte? MinValue = (sbyte?)sbyte.MinValue;
- public static sbyte? MaxValue = (sbyte?)sbyte.MaxValue;
- public static sbyte? nullval = (sbyte?)null;
- public static sbyte? defaultvalueval = (sbyte?)5;
- public static sbyte? Zero = (sbyte?)0;
- }
-
- public class byteNullableType {
- public static byte? MinValue = (byte?)byte.MinValue;
- public static byte? MaxValue = (byte?)byte.MaxValue;
- public static byte? nullval = (byte?)null;
- public static byte? defaultvalueval = (byte?)5;
- public static byte? Zero = (byte?)0;
- }
-
- public class shortNullableType {
- public static short? MinValue = (short?)short.MinValue;
- public static short? MaxValue = (short?)short.MaxValue;
- public static short? nullval = (short?)null;
- public static short? defaultvalueval = (short?)5;
- public static short? Zero = (short?)0;
- }
-
- public class ushortNullableType {
- public static ushort? MinValue = (ushort?)ushort.MinValue;
- public static ushort? MaxValue = (ushort?)ushort.MaxValue;
- public static ushort? nullval = (ushort?)null;
- public static ushort? defaultvalueval = (ushort?)5;
- public static ushort? Zero = (ushort?)0;
- }
-
- public class intNullableType {
- public static int? MinValue = (int?)int.MinValue;
- public static int? MaxValue = (int?)int.MaxValue;
- public static int? nullval = (int?)null;
- public static int? defaultvalueval = (int?)5;
- public static int? Zero = (int?)0;
- }
-
- public class uintNullableType {
- public static uint? MinValue = (uint?)uint.MinValue;
- public static uint? MaxValue = (uint?)uint.MaxValue;
- public static uint? nullval = (uint?)null;
- public static uint? defaultvalueval = (uint?)5;
- public static uint? Zero = (uint?)0;
- }
-
- public class longNullableType {
- public static long? MinValue = (long?)long.MinValue;
- public static long? MaxValue = (long?)long.MaxValue;
- public static long? nullval = (long?)null;
- public static long? defaultvalueval = (long?)5;
- public static long? Zero = (long?)0;
- }
-
- public class ulongNullableType {
- public static ulong? MinValue = (ulong?)ulong.MinValue;
- public static ulong? MaxValue = (ulong?)ulong.MaxValue;
- public static ulong? nullval = (ulong?)null;
- public static ulong? defaultvalueval = (ulong?)5;
- public static ulong? Zero = (ulong?)0;
- }
-
- public class decimalNullableType {
- public static decimal? MinValue = (decimal?)decimal.MinValue;
- public static decimal? MaxValue = (decimal?)decimal.MaxValue;
- public static decimal? nullval = (decimal?)null;
- public static decimal? defaultvalueval = (decimal?)5;
- public static decimal? Zero = (decimal?)0;
- }
-
- public class floatNullableType {
- public static float? MinValue = (float?)float.MinValue;
- public static float? MaxValue = (float?)float.MaxValue;
- public static float? nullval = (float?)null;
- public static float? defaultvalueval = (float?)5;
- public static float? Zero = (float?)0;
- }
-
- public class doubleNullableType {
- public static double? MinValue = (double?)double.MinValue;
- public static double? MaxValue = (double?)double.MaxValue;
- public static double? nullval = (double?)null;
- public static double? defaultvalueval = (double?)5;
- public static double? Zero = (double?)0;
- }
-
- public class DateTimeNullableType {
- public static DateTime? MinValue = (DateTime?)DateTime.MinValue;
- public static DateTime? MaxValue = (DateTime?)DateTime.MaxValue;
- public static DateTime? nullval = (DateTime?)null;
- public static DateTime? defaultvalueval = (DateTime?)DateTime.Parse("1/2/3");
- public static DateTime? Zero = (DateTime?)DateTime.Parse("1/1/1");
- }
-
- public class charNullableType {
- public static char? defaultvalueval = (char?)'c';
- public static char? nullval = (char?)null;
- #if SILVERLIGHT
- public static char? Zero = (char?)Convert.ToChar(0);
- #else
- public static char? Zero = (char?)char.ConvertFromUtf32(0)[0];
- #endif
- }
-
- public enum sbyteenumNullable : sbyte {
- }
- public class sbyteenumNullableType {
- public static sbyteenum? MinValue = (sbyteenum?)sbyte.MinValue;
- public static sbyteenum? MaxValue = (sbyteenum?)sbyte.MaxValue;
- public static sbyteenum? defaultvalueval = (sbyteenum?)5;
- public static sbyteenum? nullval = (sbyteenum?)null;
- public static sbyteenum? Zero = (sbyteenum?)0;
- }
-
- public enum byteenumNullable : byte {
- }
- public class byteenumNullableType {
- public static byteenum? MinValue = (byteenum?)byte.MinValue;
- public static byteenum? MaxValue = (byteenum?)byte.MaxValue;
- public static byteenum? nullval = (byteenum?)null;
- public static byteenum? defaultvalueval = (byteenum?)5;
- public static byteenum? Zero = (byteenum?)0;
- }
-
- public enum shortenumNullable : short {
- }
- public class shortenumNullableType {
- public static shortenum? MinValue = (shortenum?)short.MinValue;
- public static shortenum? MaxValue = (shortenum?)short.MaxValue;
- public static shortenum? nullval = (shortenum?)null;
- public static shortenum? defaultvalueval = (shortenum?)5;
- public static shortenum? Zero = (shortenum?)0;
- }
-
- public enum ushortenumNullable : ushort {
- }
- public class ushortenumNullableType {
- public static ushortenum? MinValue = (ushortenum?)ushort.MinValue;
- public static ushortenum? MaxValue = (ushortenum?)ushort.MaxValue;
- public static ushortenum? nullval = (ushortenum?)null;
- public static ushortenum? defaultvalueval = (ushortenum?)5;
- public static ushortenum? Zero = (ushortenum?)0;
- }
-
- public enum intenumNullable : int {
- }
- public class intenumNullableType {
- public static intenum? MinValue = (intenum?)int.MinValue;
- public static intenum? MaxValue = (intenum?)int.MaxValue;
- public static intenum? nullval = (intenum?)null;
- public static intenum? defaultvalueval = (intenum?)5;
- public static intenum? Zero = (intenum?)0;
- }
-
- public enum uintenumNullable : uint {
- }
- public class uintenumNullableType {
- public static uintenum? MinValue = (uintenum?)uint.MinValue;
- public static uintenum? MaxValue = (uintenum?)uint.MaxValue;
- public static uintenum? nullval = (uintenum?)null;
- public static uintenum? defaultvalueval = (uintenum?)5;
- public static uintenum? Zero = (uintenum?)0;
- }
-
- public enum longenumNullable : long {
- }
- public class longenumNullableType {
- public static longenum? MinValue = (longenum?)long.MinValue;
- public static longenum? MaxValue = (longenum?)long.MaxValue;
- public static longenum? nullval = (longenum?)null;
- public static longenum? defaultvalueval = (longenum?)5;
- public static longenum? Zero = (longenum?)0;
- }
-
- public enum ulongenumNullable : ulong {
- }
- public class ulongenumNullableType {
- public static ulongenum? MinValue = (ulongenum?)ulong.MinValue;
- public static ulongenum? MaxValue = (ulongenum?)ulong.MaxValue;
- public static ulongenum? nullval = (ulongenum?)null;
- public static ulongenum? defaultvalueval = (ulongenum?)5;
- public static ulongenum? Zero = (ulongenum?)0;
- }
-
- public struct structureNullable {
- int x;
- void foo() {
- x = 5;
- Console.WriteLine(x);
- }
- }
- public class structureNullableType {
- public static structure? defaultvalueval = new structure();
- public static structure? nullval = (structure?)null;
- }
-
- public class Class1 {
- int x;
- void foo() {
- x = 5;
- Console.WriteLine(x);
- }
- }
- public class Class1Type {
- public static Class1 defaultvalueval = new Class1();
- public static Class1 nullval = (Class1)null;
- }
-
- public interface Interface1 {
- int x();
- }
- public class Interface1Type {
- public static Interface1 defaultvalueval;
- public static Interface1 nullval = (Interface1)null;
- }
-
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 1", new string[] { "positive", "convert", "Pri2" }, Priority = 2)]
- public static Expr Convert1(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- //just checking no exception is thrown.
- Expressions.Add(Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(void)));
- var tree = Expr.Block(Expressions);
- V.Validate(tree);
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 2", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert2(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(Boolean), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(Boolean)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 3", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert3(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(sbyte), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(sbyte)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 4", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert4(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(byte), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(byte)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 5", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert5(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(short), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(short)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 6", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert6(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(ushort), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ushort)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 7", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert7(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(int), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(int)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 8", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert8(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(uint), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(uint)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 9", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert9(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(long), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(long)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 10", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert10(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(ulong), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ulong)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
-
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 11", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert11(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(decimal), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(decimal)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 12", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert12(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(float), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(float)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 13", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert13(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(double), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(double)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 14", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert14(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(DateTime), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(DateTime)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 15", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert15(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(string), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(string)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 16", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert16(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(char), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(char)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 17", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert17(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(sbyteenum), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(sbyteenum)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 18", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert18(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(byteenum), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(byteenum)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 19", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert19(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(shortenum), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(shortenum)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 20", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert20(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(ushortenum), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ushortenum)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 21", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert21(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(intenum), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(intenum)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 22", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert22(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(uintenum), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(uintenum)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 23", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert23(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(longenum), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(longenum)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 24", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert24(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(ulongenum), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ulongenum)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 25", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert25(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(structure), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(structure)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 26", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert26(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(Boolean?), "");
- Expressions.Add(EU.Throws<System.InvalidOperationException>(() =>
- {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(Boolean?)));
- }));
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 27", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert27(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(sbyte?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(sbyte?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 28", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert28(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(byte?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(byte?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 29", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert29(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(short?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(short?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 30", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert30(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(ushort?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ushort?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 31", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert31(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(int?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(int?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 32", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert32(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(uint?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(uint?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 33", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert33(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(long?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(long?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 34", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert34(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(ulong?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ulong?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 35", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert35(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(decimal?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(decimal?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 36", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert36(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(float?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(float?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 37", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert37(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(double?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(double?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 38", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert38(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(DateTime?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(DateTime?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 39", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert39(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(char?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(char?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 40", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert40(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(sbyteenum?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(sbyteenum?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 41", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert41(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(byteenum?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(byteenum?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 42", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert42(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(shortenum?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(shortenum?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 43", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert43(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(ushortenum?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ushortenum?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 44", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert44(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(intenum?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(intenum?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 45", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert45(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(uintenum?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(uintenum?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 46", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert46(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(longenum?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(longenum?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "Convert 47", new string[] { "negative", "convert", "Pri2" }, Exception = typeof(InvalidOperationException), Priority = 2)]
- public static Expr Convert47(EU.IValidator V) {
- List<Expression> Expressions = new List<Expression>();
- ParameterExpression Result = Expr.Variable(typeof(ulongenum?), "");
- Expressions.Add( EU.Throws<System.InvalidOperationException>(() => {
- Expr.Assign(Result, Expr.Convert(AstUtils.Void(Expr.Empty()), typeof(ulongenum?)));}) );
- var tree = Expr.Block(new[] { Result }, Expressions);
-
- return tree;
- }
- [ETUtils.TestAttribute(ETUtils.…