/client_v4_2_comm/Test/Platform/Tests/CLR/mscorlib/statements/StatementsTests.cs
C# | 5504 lines | 5302 code | 168 blank | 34 comment | 566 complexity | 47987d8a12b78a6ce69532254bd0d8ee MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.0, MIT, MPL-2.0-no-copyleft-exception
Large files files are truncated, but you can click here to view the full file
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Copyright (c) Microsoft Corporation. All rights reserved.
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- using System;
- using System.Reflection;
- using Microsoft.SPOT.Platform.Test;
-
- namespace Microsoft.SPOT.Platform.Tests
- {
- public class StatementsTests : IMFTestInterface
- {
- [SetUp]
- public InitializeResult Initialize()
- {
- Log.Comment("Adding set up for the tests");
-
- return InitializeResult.ReadyToGo;
- }
-
- [TearDown]
- public void CleanUp()
- {
- Log.Comment("Cleaning up after the tests");
- }
-
- //Statements Test methods
- //The following tests were ported from folder current\test\cases\client\CLR\Conformance\10_classes\Statements
- //Label_001,Label_002,Label_004,Decl_001,Decl_002,Decl_003,Decl_004,Decl_007,Decl_009,Decl_010,Decl_012,Decl_014,Decl_016,Block_001,Empty_001,Expr_002,Expr_003,Expr_004,Expr_006,if_001,if_003,if_005,if_007,if_009,switch_001,switch_002,switch_003,switch_004,switch_005,switch_006,switch_007,switch_010,switch_012,switch_013,switch_015,switch_016,switch_017,switch_018,switch_019,switch_023,switch_030,switch_031,switch_032,switch_033,switch_034,switch_035,switch_036,switch_037,switch_038,switch_039,switch_040,switch_041,switch_042,switch_044,switch_047,switch_049,switch_string_001,dowhile_001,dowhile_002,dowhile_003,dowhile_004,dowhile_005,dowhile_006,for_001,for_003,for_004,for_006,for_007,for_008,for_009,for_010,for_011,for_013,for_014,char_in_string_s01,char_in_string_ex01,while_001,while_002,while_003,while_004,while_005,while_006,break_001,break_002,break_003,break_006,break_007,break_010,continue_001,continue_002,continue_006,continue_007,continue_010,goto_001,goto_008,goto_009,goto_010,goto_014,goto_017,goto_018,return_001,return_004,return_006,return_008,return_009,return_010,return_013,return_014,throw_001,throw_005,trycatch_001,trycatch_006,trycatch_007,tryfinally_001,tryfinally_002,tryfinally_003,tryfinally_004,tryfinally_006,tryfinally_007,tryfinally_008,tryfinally_009,tryfinally_010,tryfinally_011,tryfinally_012,tryfinally_013,Using_001,Using_002,Using_003,Using_005,Using_009,Using_010,Using_011,Using_012,Using_013,Using_014,Using_015,Using_017,Using_018,lock001,lock003,lock004,lock005,lock007,enum_002
-
- //Test Case Calls
- [TestMethod]
- public MFTestResults Statements_Label_001_Test()
- {
- Log.Comment("Label_001.sc");
- Log.Comment("Make sure labels can be declared");
- if (Statements_TestClass_Label_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Label_002_Test()
- {
- Log.Comment("Label_002.sc");
- Log.Comment("Make sure labels can be referenced. Assumes 'goto'");
- if (Statements_TestClass_Label_002.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Label_004_Test()
- {
- Log.Comment("Label_004.sc");
- Log.Comment("Make sure labels can be associated with an empty statement");
- if (Statements_TestClass_Label_004.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_001_Test()
- {
- Log.Comment("Decl_001.sc");
- Log.Comment("Declare a local variable of an intrinsic type");
- if (Statements_TestClass_Decl_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_002_Test()
- {
- Log.Comment("Decl_002.sc");
- Log.Comment("Declare a local variable of an intrinsic type and initialize it");
- if (Statements_TestClass_Decl_002.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_003_Test()
- {
- Log.Comment("Decl_003.sc");
- Log.Comment("Declare a local variable of an intrinsic type and initialize it");
- Log.Comment("with an expression.");
- if (Statements_TestClass_Decl_003.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_004_Test()
- {
- Log.Comment("Decl_004.sc");
- Log.Comment("Declare a local variable of an external object type");
- if (Statements_TestClass_Decl_004.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_007_Test()
- {
- Log.Comment("Decl_007.sc");
- Log.Comment("Declare a series of local variables of an intrinsic type with commas");
- if (Statements_TestClass_Decl_007.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_009_Test()
- {
- Log.Comment("Decl_009.sc");
- Log.Comment("Declare a series of local variables of an intrinsic type with commas and");
- Log.Comment("initial assignments.");
- if (Statements_TestClass_Decl_009.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_010_Test()
- {
- Log.Comment("Decl_010.sc");
- Log.Comment("Declare a local variable of an intrinsic type as an array");
- if (Statements_TestClass_Decl_010.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_012_Test()
- {
- Log.Comment("Decl_012.sc");
- Log.Comment("Declare a local variable of an intrinsic type as an array, allocate and reference it.");
- if (Statements_TestClass_Decl_012.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_014_Test()
- {
- Log.Comment("Decl_014.sc");
- Log.Comment("Declare a local variable of an intrinsic type as an initialized array");
- if (Statements_TestClass_Decl_014.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Decl_016_Test()
- {
- Log.Comment("Decl_016.sc");
- Log.Comment("Correctly declare a local variable of a type that has no default constructor");
- Log.Comment("as an array.");
- if (Statements_TestClass_Decl_016.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Block_001_Test()
- {
- Log.Comment("Block_001.sc");
- Log.Comment("Statements_TestClass_? Several types of statement blocks. Statement blocks");
- Log.Comment("are so fundamental, that most can be tested in one pass.");
- Log.Comment("Note that by the nature of this code, many warnings");
- Log.Comment("could/should be generated about items that are never reached.");
- if (Statements_TestClass_Block_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Empty_001_Test()
- {
- Log.Comment("Empty_001.sc");
- Log.Comment("Statements_TestClass_? Several scenarios for empty statement. Emtpy statements");
- Log.Comment("are so fundamental, that most can be tested in one pass.");
- Log.Comment("Note that by the nature of this code, many warnings");
- Log.Comment("could/should be generated about items that are never reached.");
- if (Statements_TestClass_Empty_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Expr_002_Test()
- {
- Log.Comment("Expr_002.sc");
- Log.Comment("Use an expression with side effects.");
- if (Statements_TestClass_Expr_002.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Expr_003_Test()
- {
- Log.Comment("Expr_003.sc");
- Log.Comment("Use an expression with side effects and multiple l-values.");
- if (Statements_TestClass_Expr_003.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Expr_004_Test()
- {
- Log.Comment("Expr_004.sc");
- Log.Comment("Run a quick test of common operator/assignment combos");
-
- if (Statements_TestClass_Expr_004.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_Expr_006_Test()
- {
- Log.Comment(" complex assignment");
- if (Statements_TestClass_Expr_006.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_if_001_Test()
- {
- Log.Comment("if_001.sc");
- Log.Comment("Simple boolean if with a single statement");
- if (Statements_TestClass_if_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_if_003_Test()
- {
- Log.Comment("if_003.sc");
- Log.Comment("Simple boolean if with a block statement");
- if (Statements_TestClass_if_003.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_if_005_Test()
- {
- Log.Comment("if_005.sc");
- Log.Comment("Simple boolean if with a single statement and else");
- if (Statements_TestClass_if_005.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_if_007_Test()
- {
- Log.Comment("if_007.sc");
- Log.Comment("Simple boolean if with a block statement");
- if (Statements_TestClass_if_007.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_if_009_Test()
- {
- Log.Comment("if_009.sc");
- Log.Comment("Nest ifs with elses without blocks. Statements_TestClass_? that the 'else' ambiguity from");
- Log.Comment("C/C++ is handled the same way (else bound to closest if)");
- if (Statements_TestClass_if_009.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_001_Test()
- {
- Log.Comment("switch_001.sc");
- Log.Comment("Empty switch");
- if (Statements_TestClass_switch_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_002_Test()
- {
- Log.Comment("switch_002.sc");
- Log.Comment("Default only switch");
- if (Statements_TestClass_switch_002.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_003_Test()
- {
- Log.Comment("switch_003.sc");
- Log.Comment("Switch with single case without break - no default");
- if (Statements_TestClass_switch_003.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_004_Test()
- {
- Log.Comment("switch_004.sc");
- Log.Comment("Switch with one case, using break");
- if (Statements_TestClass_switch_004.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_005_Test()
- {
- Log.Comment("switch_005.sc");
- Log.Comment("Switch with two cases, using break");
- if (Statements_TestClass_switch_005.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_006_Test()
- {
- Log.Comment("switch_006.sc");
- Log.Comment("Switch with one case and a default");
- if (Statements_TestClass_switch_006.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_007_Test()
- {
- Log.Comment("switch_007.sc");
- Log.Comment("Switch with two cases and a default");
- if (Statements_TestClass_switch_007.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_010_Test()
- {
- Log.Comment("switch_010.sc");
- Log.Comment("Switch with a const variable in a case");
- if (Statements_TestClass_switch_010.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_012_Test()
- {
- Log.Comment("switch_012.sc");
- Log.Comment("Multiple case labels");
- if (Statements_TestClass_switch_012.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_013_Test()
- {
- Log.Comment("switch_013.sc");
- Log.Comment("test goto all over");
- Log.Comment("Expected Output");
- if (Statements_TestClass_switch_013.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_015_Test()
- {
- Log.Comment("switch_015.sc");
- Log.Comment("Run a switch over a specific type: byte");
- if (Statements_TestClass_switch_015.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_016_Test()
- {
- Log.Comment("switch_016.sc");
- Log.Comment("Run a switch over a specific type: char");
- if (Statements_TestClass_switch_016.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_017_Test()
- {
- Log.Comment("switch_017.sc");
- Log.Comment("Run a switch over a specific type: short");
- if (Statements_TestClass_switch_017.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_018_Test()
- {
- Log.Comment("switch_018.sc");
- Log.Comment("Run a switch over a specific type: int");
- if (Statements_TestClass_switch_018.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_019_Test()
- {
- Log.Comment("switch_019.sc");
- Log.Comment("Run a switch over a specific type: long");
- if (Statements_TestClass_switch_019.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_023_Test()
- {
- Log.Comment("switch_023.sc");
- Log.Comment("Run a switch over a specific type: enum");
- if (Statements_TestClass_switch_023.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_030_Test()
- {
- Log.Comment(" switch on int variable, float case");
- if (Statements_TestClass_switch_030.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_031_Test()
- {
- Log.Comment(" switch with holes in range");
- if (Statements_TestClass_switch_031.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_032_Test()
- {
- Log.Comment(" switch: default case at top");
- if (Statements_TestClass_switch_032.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_033_Test()
- {
- Log.Comment(" switch: default case in middle");
- if (Statements_TestClass_switch_033.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_034_Test()
- {
- Log.Comment(" switch: default case in middle");
- if (Statements_TestClass_switch_034.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_035_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_035.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_036_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_036.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_037_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_037.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_038_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_038.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_039_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_039.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_040_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_040.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_041_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_041.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_042_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_042.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_044_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- if (Statements_TestClass_switch_044.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_047_Test()
- {
- Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
- Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
- Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
- Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
- Log.Comment("Ensure error is emmited on when more than one implicit conversion to an acceptable governing type is defined");
- if (Statements_TestClass_switch_047.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_049_Test()
- {
- Log.Comment("warning CS1522: Empty switch block");
- if (Statements_TestClass_switch_049.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_switch_string_001_Test()
- {
- Log.Comment(" switch on string: null");
- if (Statements_TestClass_switch_string_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_dowhile_001_Test()
- {
- Log.Comment("dowhile_001.sc");
- Log.Comment("do/while with a single statement");
- if (Statements_TestClass_dowhile_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_dowhile_002_Test()
- {
- Log.Comment("dowhile_002.sc");
- Log.Comment("do/while with a compound statement");
- if (Statements_TestClass_dowhile_002.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_dowhile_003_Test()
- {
- Log.Comment("dowhile_003.sc");
- Log.Comment("verify known false condition executes only once with single statement");
- if (Statements_TestClass_dowhile_003.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_dowhile_004_Test()
- {
- Log.Comment("dowhile_004.sc");
- Log.Comment("verify known true condition executes with single statement");
- if (Statements_TestClass_dowhile_004.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_dowhile_005_Test()
- {
- Log.Comment("dowhile_005.sc");
- Log.Comment("verify known false condition executes once with compound statements");
- if (Statements_TestClass_dowhile_005.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_dowhile_006_Test()
- {
- Log.Comment("dowhile_006.sc");
- Log.Comment("verify known true condition executes with compound statements");
- if (Statements_TestClass_dowhile_006.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_001_Test()
- {
- Log.Comment("for_001.sc");
- Log.Comment("empty for loop");
- if (Statements_TestClass_for_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_003_Test()
- {
- Log.Comment("for_003.sc");
- Log.Comment("empty initializer in for loop");
- if (Statements_TestClass_for_003.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_004_Test()
- {
- Log.Comment("for_004.sc");
- Log.Comment("empty iterator in for loop");
- if (Statements_TestClass_for_004.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_006_Test()
- {
- Log.Comment("for_006.sc");
- Log.Comment("Full normal for loop");
- if (Statements_TestClass_for_006.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_007_Test()
- {
- Log.Comment("for_007.sc");
- Log.Comment("Full normal for loop with a compound statement");
- if (Statements_TestClass_for_007.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_008_Test()
- {
- Log.Comment("for_008.sc");
- Log.Comment("Multiple declarations in initializer");
- if (Statements_TestClass_for_008.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_009_Test()
- {
- Log.Comment("for_009.sc");
- Log.Comment("Statements_TestClass_? statement expression lists in for initializer");
- if (Statements_TestClass_for_009.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_010_Test()
- {
- Log.Comment("for_010.sc");
- Log.Comment("Statements_TestClass_? statement expression lists in for iterator");
- if (Statements_TestClass_for_010.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_011_Test()
- {
- Log.Comment("for_011.sc");
- Log.Comment("Statements_TestClass_? statement expression lists in for initializer and iterator");
- if (Statements_TestClass_for_011.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_013_Test()
- {
- Log.Comment("for_013.sc");
- Log.Comment("Verify conditional evaluates before iterator");
- if (Statements_TestClass_for_013.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_for_014_Test()
- {
- Log.Comment("for_014.sc");
- Log.Comment("Verify method calls work ok in all for loop areas");
- if (Statements_TestClass_for_014.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_char_in_string_s01_Test()
- {
- Log.Comment("Optimization to foreach (char c in String) by treating String as a char array");
- if (Statements_TestClass_char_in_string_s01.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_char_in_string_ex01_Test()
- {
- Log.Comment("Optimization to foreach (char c in String) by treating String as a char array");
- if (Statements_TestClass_char_in_string_ex01.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_while_001_Test()
- {
- Log.Comment("while_001.sc");
- Log.Comment("while with a single statement");
- if (Statements_TestClass_while_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_while_002_Test()
- {
- Log.Comment("while_002.sc");
- Log.Comment("while with a compound statement");
- if (Statements_TestClass_while_002.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_while_003_Test()
- {
- Log.Comment("while_003.sc");
- Log.Comment("verify known false condition doesn't execute with single statement");
- if (Statements_TestClass_while_003.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_while_004_Test()
- {
- Log.Comment("while_004.sc");
- Log.Comment("verify known true condition executes with single statement");
- if (Statements_TestClass_while_004.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_while_005_Test()
- {
- Log.Comment("while_005.sc");
- Log.Comment("verify known false condition doesn't execute with compound statements");
- if (Statements_TestClass_while_005.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_while_006_Test()
- {
- Log.Comment("while_006.sc");
- Log.Comment("verify known true condition executes with compound statements");
- if (Statements_TestClass_while_006.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_break_001_Test()
- {
- Log.Comment("break_001.sc");
- Log.Comment("Make sure break works in all basic single statement loops");
- if (Statements_TestClass_break_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_break_002_Test()
- {
- Log.Comment("break_002.sc");
- Log.Comment("Make sure break works in all basic compound statement loops");
- if (Statements_TestClass_break_002.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_break_003_Test()
- {
- Log.Comment("break_003.sc");
- Log.Comment("Make sure break optional on end of switch");
- if (Statements_TestClass_break_003.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_break_006_Test()
- {
- Log.Comment("break_006.sc");
- Log.Comment("break in an if successfully breaks loop");
- if (Statements_TestClass_break_006.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_break_007_Test()
- {
- Log.Comment("break_007.sc");
- Log.Comment("break in a blocked if successfully breaks loop");
- if (Statements_TestClass_break_007.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_break_010_Test()
- {
- Log.Comment("break_010.sc");
- Log.Comment("Make sure break correctly when nested");
- if (Statements_TestClass_break_010.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_continue_001_Test()
- {
- Log.Comment("continue_001.sc");
- Log.Comment("Make sure continue works in all basic single statement loops");
- if (Statements_TestClass_continue_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_continue_002_Test()
- {
- Log.Comment("continue_002.sc");
- Log.Comment("Make sure continue works in all basic compound statement loops");
- Log.Comment("Expected Output");
- if (Statements_TestClass_continue_002.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_continue_006_Test()
- {
- Log.Comment("continue_006.sc");
- Log.Comment("continue in an if successfully continues loop");
- if (Statements_TestClass_continue_006.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_continue_007_Test()
- {
- Log.Comment("continue_007.sc");
- Log.Comment("continue in a block if successfully continues loop");
- if (Statements_TestClass_continue_007.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_continue_010_Test()
- {
- Log.Comment("continue_010.sc");
- Log.Comment("Make sure continue works correctly when nested");
- if (Statements_TestClass_continue_010.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_goto_001_Test()
- {
- Log.Comment("goto_001.sc");
- Log.Comment("simple goto to adjust flow control");
- if (Statements_TestClass_goto_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_goto_008_Test()
- {
- Log.Comment("goto_008.sc");
- Log.Comment("goto currect case");
- if (Statements_TestClass_goto_008.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_goto_009_Test()
- {
- Log.Comment("goto_009.sc");
- Log.Comment("goto a different case");
- Log.Comment("Expected Output");
- if (Statements_TestClass_goto_009.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_goto_010_Test()
- {
- Log.Comment("goto_010.sc");
- Log.Comment("goto default correctly");
- if (Statements_TestClass_goto_010.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_goto_014_Test()
- {
- Log.Comment("goto_014.sc");
- Log.Comment("simple gotos to test jumping to parent process.");
- if (Statements_TestClass_goto_014.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_goto_017_Test()
- {
- Log.Comment(" some gotos");
- if (Statements_TestClass_goto_017.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_goto_018_Test()
- {
- Log.Comment(" try/catch/finally with goto");
- if (Statements_TestClass_goto_018.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_return_001_Test()
- {
- Log.Comment("return_001.sc");
- Log.Comment("simple void return on a void method");
- if (Statements_TestClass_return_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_return_004_Test()
- {
- Log.Comment("return_004.sc");
- Log.Comment("simple return a normal type, assigning, and ignoring return value");
- if (Statements_TestClass_return_004.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_return_006_Test()
- {
- Log.Comment("return_006.sc");
- Log.Comment("simple return a type mismatch that has an implicit conversion");
- if (Statements_TestClass_return_006.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_return_008_Test()
- {
- Log.Comment("return_008.sc");
- Log.Comment("simple return a type mismatch that has an explicit convertion conversion,");
- Log.Comment("applying the cast");
- if (Statements_TestClass_return_008.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_return_009_Test()
- {
- Log.Comment("return_009.sc");
- Log.Comment("return of a struct");
- if (Statements_TestClass_return_009.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_return_010_Test()
- {
- Log.Comment("return_010.sc");
- Log.Comment("return of a class");
- if (Statements_TestClass_return_010.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_return_013_Test()
- {
- Log.Comment("return_013.sc");
- Log.Comment("simple falloff on a void method");
- if (Statements_TestClass_return_013.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_return_014_Test()
- {
- Log.Comment("return_014.sc");
- Log.Comment("verify that a 'throw' is adequate for flow control analysis of return type");
- if (Statements_TestClass_return_014.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- public MFTestResults Statements_throw_001_Test()
- {
- Log.Comment("throw_001.sc");
- Log.Comment("simple throw");
- if (Statements_TestClass_throw_001.testMethod())
- {
- return MFTestResults.Pass;
- }
- return MFTestResults.Fail;
- }
- [TestMethod]
- pub…
Large files files are truncated, but you can click here to view the full file