PageRenderTime 68ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/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
  1. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  4. using System;
  5. using System.Reflection;
  6. using Microsoft.SPOT.Platform.Test;
  7. namespace Microsoft.SPOT.Platform.Tests
  8. {
  9. public class StatementsTests : IMFTestInterface
  10. {
  11. [SetUp]
  12. public InitializeResult Initialize()
  13. {
  14. Log.Comment("Adding set up for the tests");
  15. return InitializeResult.ReadyToGo;
  16. }
  17. [TearDown]
  18. public void CleanUp()
  19. {
  20. Log.Comment("Cleaning up after the tests");
  21. }
  22. //Statements Test methods
  23. //The following tests were ported from folder current\test\cases\client\CLR\Conformance\10_classes\Statements
  24. //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
  25. //Test Case Calls
  26. [TestMethod]
  27. public MFTestResults Statements_Label_001_Test()
  28. {
  29. Log.Comment("Label_001.sc");
  30. Log.Comment("Make sure labels can be declared");
  31. if (Statements_TestClass_Label_001.testMethod())
  32. {
  33. return MFTestResults.Pass;
  34. }
  35. return MFTestResults.Fail;
  36. }
  37. [TestMethod]
  38. public MFTestResults Statements_Label_002_Test()
  39. {
  40. Log.Comment("Label_002.sc");
  41. Log.Comment("Make sure labels can be referenced. Assumes 'goto'");
  42. if (Statements_TestClass_Label_002.testMethod())
  43. {
  44. return MFTestResults.Pass;
  45. }
  46. return MFTestResults.Fail;
  47. }
  48. [TestMethod]
  49. public MFTestResults Statements_Label_004_Test()
  50. {
  51. Log.Comment("Label_004.sc");
  52. Log.Comment("Make sure labels can be associated with an empty statement");
  53. if (Statements_TestClass_Label_004.testMethod())
  54. {
  55. return MFTestResults.Pass;
  56. }
  57. return MFTestResults.Fail;
  58. }
  59. [TestMethod]
  60. public MFTestResults Statements_Decl_001_Test()
  61. {
  62. Log.Comment("Decl_001.sc");
  63. Log.Comment("Declare a local variable of an intrinsic type");
  64. if (Statements_TestClass_Decl_001.testMethod())
  65. {
  66. return MFTestResults.Pass;
  67. }
  68. return MFTestResults.Fail;
  69. }
  70. [TestMethod]
  71. public MFTestResults Statements_Decl_002_Test()
  72. {
  73. Log.Comment("Decl_002.sc");
  74. Log.Comment("Declare a local variable of an intrinsic type and initialize it");
  75. if (Statements_TestClass_Decl_002.testMethod())
  76. {
  77. return MFTestResults.Pass;
  78. }
  79. return MFTestResults.Fail;
  80. }
  81. [TestMethod]
  82. public MFTestResults Statements_Decl_003_Test()
  83. {
  84. Log.Comment("Decl_003.sc");
  85. Log.Comment("Declare a local variable of an intrinsic type and initialize it");
  86. Log.Comment("with an expression.");
  87. if (Statements_TestClass_Decl_003.testMethod())
  88. {
  89. return MFTestResults.Pass;
  90. }
  91. return MFTestResults.Fail;
  92. }
  93. [TestMethod]
  94. public MFTestResults Statements_Decl_004_Test()
  95. {
  96. Log.Comment("Decl_004.sc");
  97. Log.Comment("Declare a local variable of an external object type");
  98. if (Statements_TestClass_Decl_004.testMethod())
  99. {
  100. return MFTestResults.Pass;
  101. }
  102. return MFTestResults.Fail;
  103. }
  104. [TestMethod]
  105. public MFTestResults Statements_Decl_007_Test()
  106. {
  107. Log.Comment("Decl_007.sc");
  108. Log.Comment("Declare a series of local variables of an intrinsic type with commas");
  109. if (Statements_TestClass_Decl_007.testMethod())
  110. {
  111. return MFTestResults.Pass;
  112. }
  113. return MFTestResults.Fail;
  114. }
  115. [TestMethod]
  116. public MFTestResults Statements_Decl_009_Test()
  117. {
  118. Log.Comment("Decl_009.sc");
  119. Log.Comment("Declare a series of local variables of an intrinsic type with commas and");
  120. Log.Comment("initial assignments.");
  121. if (Statements_TestClass_Decl_009.testMethod())
  122. {
  123. return MFTestResults.Pass;
  124. }
  125. return MFTestResults.Fail;
  126. }
  127. [TestMethod]
  128. public MFTestResults Statements_Decl_010_Test()
  129. {
  130. Log.Comment("Decl_010.sc");
  131. Log.Comment("Declare a local variable of an intrinsic type as an array");
  132. if (Statements_TestClass_Decl_010.testMethod())
  133. {
  134. return MFTestResults.Pass;
  135. }
  136. return MFTestResults.Fail;
  137. }
  138. [TestMethod]
  139. public MFTestResults Statements_Decl_012_Test()
  140. {
  141. Log.Comment("Decl_012.sc");
  142. Log.Comment("Declare a local variable of an intrinsic type as an array, allocate and reference it.");
  143. if (Statements_TestClass_Decl_012.testMethod())
  144. {
  145. return MFTestResults.Pass;
  146. }
  147. return MFTestResults.Fail;
  148. }
  149. [TestMethod]
  150. public MFTestResults Statements_Decl_014_Test()
  151. {
  152. Log.Comment("Decl_014.sc");
  153. Log.Comment("Declare a local variable of an intrinsic type as an initialized array");
  154. if (Statements_TestClass_Decl_014.testMethod())
  155. {
  156. return MFTestResults.Pass;
  157. }
  158. return MFTestResults.Fail;
  159. }
  160. [TestMethod]
  161. public MFTestResults Statements_Decl_016_Test()
  162. {
  163. Log.Comment("Decl_016.sc");
  164. Log.Comment("Correctly declare a local variable of a type that has no default constructor");
  165. Log.Comment("as an array.");
  166. if (Statements_TestClass_Decl_016.testMethod())
  167. {
  168. return MFTestResults.Pass;
  169. }
  170. return MFTestResults.Fail;
  171. }
  172. [TestMethod]
  173. public MFTestResults Statements_Block_001_Test()
  174. {
  175. Log.Comment("Block_001.sc");
  176. Log.Comment("Statements_TestClass_? Several types of statement blocks. Statement blocks");
  177. Log.Comment("are so fundamental, that most can be tested in one pass.");
  178. Log.Comment("Note that by the nature of this code, many warnings");
  179. Log.Comment("could/should be generated about items that are never reached.");
  180. if (Statements_TestClass_Block_001.testMethod())
  181. {
  182. return MFTestResults.Pass;
  183. }
  184. return MFTestResults.Fail;
  185. }
  186. [TestMethod]
  187. public MFTestResults Statements_Empty_001_Test()
  188. {
  189. Log.Comment("Empty_001.sc");
  190. Log.Comment("Statements_TestClass_? Several scenarios for empty statement. Emtpy statements");
  191. Log.Comment("are so fundamental, that most can be tested in one pass.");
  192. Log.Comment("Note that by the nature of this code, many warnings");
  193. Log.Comment("could/should be generated about items that are never reached.");
  194. if (Statements_TestClass_Empty_001.testMethod())
  195. {
  196. return MFTestResults.Pass;
  197. }
  198. return MFTestResults.Fail;
  199. }
  200. [TestMethod]
  201. public MFTestResults Statements_Expr_002_Test()
  202. {
  203. Log.Comment("Expr_002.sc");
  204. Log.Comment("Use an expression with side effects.");
  205. if (Statements_TestClass_Expr_002.testMethod())
  206. {
  207. return MFTestResults.Pass;
  208. }
  209. return MFTestResults.Fail;
  210. }
  211. [TestMethod]
  212. public MFTestResults Statements_Expr_003_Test()
  213. {
  214. Log.Comment("Expr_003.sc");
  215. Log.Comment("Use an expression with side effects and multiple l-values.");
  216. if (Statements_TestClass_Expr_003.testMethod())
  217. {
  218. return MFTestResults.Pass;
  219. }
  220. return MFTestResults.Fail;
  221. }
  222. [TestMethod]
  223. public MFTestResults Statements_Expr_004_Test()
  224. {
  225. Log.Comment("Expr_004.sc");
  226. Log.Comment("Run a quick test of common operator/assignment combos");
  227. if (Statements_TestClass_Expr_004.testMethod())
  228. {
  229. return MFTestResults.Pass;
  230. }
  231. return MFTestResults.Fail;
  232. }
  233. [TestMethod]
  234. public MFTestResults Statements_Expr_006_Test()
  235. {
  236. Log.Comment(" complex assignment");
  237. if (Statements_TestClass_Expr_006.testMethod())
  238. {
  239. return MFTestResults.Pass;
  240. }
  241. return MFTestResults.Fail;
  242. }
  243. [TestMethod]
  244. public MFTestResults Statements_if_001_Test()
  245. {
  246. Log.Comment("if_001.sc");
  247. Log.Comment("Simple boolean if with a single statement");
  248. if (Statements_TestClass_if_001.testMethod())
  249. {
  250. return MFTestResults.Pass;
  251. }
  252. return MFTestResults.Fail;
  253. }
  254. [TestMethod]
  255. public MFTestResults Statements_if_003_Test()
  256. {
  257. Log.Comment("if_003.sc");
  258. Log.Comment("Simple boolean if with a block statement");
  259. if (Statements_TestClass_if_003.testMethod())
  260. {
  261. return MFTestResults.Pass;
  262. }
  263. return MFTestResults.Fail;
  264. }
  265. [TestMethod]
  266. public MFTestResults Statements_if_005_Test()
  267. {
  268. Log.Comment("if_005.sc");
  269. Log.Comment("Simple boolean if with a single statement and else");
  270. if (Statements_TestClass_if_005.testMethod())
  271. {
  272. return MFTestResults.Pass;
  273. }
  274. return MFTestResults.Fail;
  275. }
  276. [TestMethod]
  277. public MFTestResults Statements_if_007_Test()
  278. {
  279. Log.Comment("if_007.sc");
  280. Log.Comment("Simple boolean if with a block statement");
  281. if (Statements_TestClass_if_007.testMethod())
  282. {
  283. return MFTestResults.Pass;
  284. }
  285. return MFTestResults.Fail;
  286. }
  287. [TestMethod]
  288. public MFTestResults Statements_if_009_Test()
  289. {
  290. Log.Comment("if_009.sc");
  291. Log.Comment("Nest ifs with elses without blocks. Statements_TestClass_? that the 'else' ambiguity from");
  292. Log.Comment("C/C++ is handled the same way (else bound to closest if)");
  293. if (Statements_TestClass_if_009.testMethod())
  294. {
  295. return MFTestResults.Pass;
  296. }
  297. return MFTestResults.Fail;
  298. }
  299. [TestMethod]
  300. public MFTestResults Statements_switch_001_Test()
  301. {
  302. Log.Comment("switch_001.sc");
  303. Log.Comment("Empty switch");
  304. if (Statements_TestClass_switch_001.testMethod())
  305. {
  306. return MFTestResults.Pass;
  307. }
  308. return MFTestResults.Fail;
  309. }
  310. [TestMethod]
  311. public MFTestResults Statements_switch_002_Test()
  312. {
  313. Log.Comment("switch_002.sc");
  314. Log.Comment("Default only switch");
  315. if (Statements_TestClass_switch_002.testMethod())
  316. {
  317. return MFTestResults.Pass;
  318. }
  319. return MFTestResults.Fail;
  320. }
  321. [TestMethod]
  322. public MFTestResults Statements_switch_003_Test()
  323. {
  324. Log.Comment("switch_003.sc");
  325. Log.Comment("Switch with single case without break - no default");
  326. if (Statements_TestClass_switch_003.testMethod())
  327. {
  328. return MFTestResults.Pass;
  329. }
  330. return MFTestResults.Fail;
  331. }
  332. [TestMethod]
  333. public MFTestResults Statements_switch_004_Test()
  334. {
  335. Log.Comment("switch_004.sc");
  336. Log.Comment("Switch with one case, using break");
  337. if (Statements_TestClass_switch_004.testMethod())
  338. {
  339. return MFTestResults.Pass;
  340. }
  341. return MFTestResults.Fail;
  342. }
  343. [TestMethod]
  344. public MFTestResults Statements_switch_005_Test()
  345. {
  346. Log.Comment("switch_005.sc");
  347. Log.Comment("Switch with two cases, using break");
  348. if (Statements_TestClass_switch_005.testMethod())
  349. {
  350. return MFTestResults.Pass;
  351. }
  352. return MFTestResults.Fail;
  353. }
  354. [TestMethod]
  355. public MFTestResults Statements_switch_006_Test()
  356. {
  357. Log.Comment("switch_006.sc");
  358. Log.Comment("Switch with one case and a default");
  359. if (Statements_TestClass_switch_006.testMethod())
  360. {
  361. return MFTestResults.Pass;
  362. }
  363. return MFTestResults.Fail;
  364. }
  365. [TestMethod]
  366. public MFTestResults Statements_switch_007_Test()
  367. {
  368. Log.Comment("switch_007.sc");
  369. Log.Comment("Switch with two cases and a default");
  370. if (Statements_TestClass_switch_007.testMethod())
  371. {
  372. return MFTestResults.Pass;
  373. }
  374. return MFTestResults.Fail;
  375. }
  376. [TestMethod]
  377. public MFTestResults Statements_switch_010_Test()
  378. {
  379. Log.Comment("switch_010.sc");
  380. Log.Comment("Switch with a const variable in a case");
  381. if (Statements_TestClass_switch_010.testMethod())
  382. {
  383. return MFTestResults.Pass;
  384. }
  385. return MFTestResults.Fail;
  386. }
  387. [TestMethod]
  388. public MFTestResults Statements_switch_012_Test()
  389. {
  390. Log.Comment("switch_012.sc");
  391. Log.Comment("Multiple case labels");
  392. if (Statements_TestClass_switch_012.testMethod())
  393. {
  394. return MFTestResults.Pass;
  395. }
  396. return MFTestResults.Fail;
  397. }
  398. [TestMethod]
  399. public MFTestResults Statements_switch_013_Test()
  400. {
  401. Log.Comment("switch_013.sc");
  402. Log.Comment("test goto all over");
  403. Log.Comment("Expected Output");
  404. if (Statements_TestClass_switch_013.testMethod())
  405. {
  406. return MFTestResults.Pass;
  407. }
  408. return MFTestResults.Fail;
  409. }
  410. [TestMethod]
  411. public MFTestResults Statements_switch_015_Test()
  412. {
  413. Log.Comment("switch_015.sc");
  414. Log.Comment("Run a switch over a specific type: byte");
  415. if (Statements_TestClass_switch_015.testMethod())
  416. {
  417. return MFTestResults.Pass;
  418. }
  419. return MFTestResults.Fail;
  420. }
  421. [TestMethod]
  422. public MFTestResults Statements_switch_016_Test()
  423. {
  424. Log.Comment("switch_016.sc");
  425. Log.Comment("Run a switch over a specific type: char");
  426. if (Statements_TestClass_switch_016.testMethod())
  427. {
  428. return MFTestResults.Pass;
  429. }
  430. return MFTestResults.Fail;
  431. }
  432. [TestMethod]
  433. public MFTestResults Statements_switch_017_Test()
  434. {
  435. Log.Comment("switch_017.sc");
  436. Log.Comment("Run a switch over a specific type: short");
  437. if (Statements_TestClass_switch_017.testMethod())
  438. {
  439. return MFTestResults.Pass;
  440. }
  441. return MFTestResults.Fail;
  442. }
  443. [TestMethod]
  444. public MFTestResults Statements_switch_018_Test()
  445. {
  446. Log.Comment("switch_018.sc");
  447. Log.Comment("Run a switch over a specific type: int");
  448. if (Statements_TestClass_switch_018.testMethod())
  449. {
  450. return MFTestResults.Pass;
  451. }
  452. return MFTestResults.Fail;
  453. }
  454. [TestMethod]
  455. public MFTestResults Statements_switch_019_Test()
  456. {
  457. Log.Comment("switch_019.sc");
  458. Log.Comment("Run a switch over a specific type: long");
  459. if (Statements_TestClass_switch_019.testMethod())
  460. {
  461. return MFTestResults.Pass;
  462. }
  463. return MFTestResults.Fail;
  464. }
  465. [TestMethod]
  466. public MFTestResults Statements_switch_023_Test()
  467. {
  468. Log.Comment("switch_023.sc");
  469. Log.Comment("Run a switch over a specific type: enum");
  470. if (Statements_TestClass_switch_023.testMethod())
  471. {
  472. return MFTestResults.Pass;
  473. }
  474. return MFTestResults.Fail;
  475. }
  476. [TestMethod]
  477. public MFTestResults Statements_switch_030_Test()
  478. {
  479. Log.Comment(" switch on int variable, float case");
  480. if (Statements_TestClass_switch_030.testMethod())
  481. {
  482. return MFTestResults.Pass;
  483. }
  484. return MFTestResults.Fail;
  485. }
  486. [TestMethod]
  487. public MFTestResults Statements_switch_031_Test()
  488. {
  489. Log.Comment(" switch with holes in range");
  490. if (Statements_TestClass_switch_031.testMethod())
  491. {
  492. return MFTestResults.Pass;
  493. }
  494. return MFTestResults.Fail;
  495. }
  496. [TestMethod]
  497. public MFTestResults Statements_switch_032_Test()
  498. {
  499. Log.Comment(" switch: default case at top");
  500. if (Statements_TestClass_switch_032.testMethod())
  501. {
  502. return MFTestResults.Pass;
  503. }
  504. return MFTestResults.Fail;
  505. }
  506. [TestMethod]
  507. public MFTestResults Statements_switch_033_Test()
  508. {
  509. Log.Comment(" switch: default case in middle");
  510. if (Statements_TestClass_switch_033.testMethod())
  511. {
  512. return MFTestResults.Pass;
  513. }
  514. return MFTestResults.Fail;
  515. }
  516. [TestMethod]
  517. public MFTestResults Statements_switch_034_Test()
  518. {
  519. Log.Comment(" switch: default case in middle");
  520. if (Statements_TestClass_switch_034.testMethod())
  521. {
  522. return MFTestResults.Pass;
  523. }
  524. return MFTestResults.Fail;
  525. }
  526. [TestMethod]
  527. public MFTestResults Statements_switch_035_Test()
  528. {
  529. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  530. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  531. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  532. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  533. if (Statements_TestClass_switch_035.testMethod())
  534. {
  535. return MFTestResults.Pass;
  536. }
  537. return MFTestResults.Fail;
  538. }
  539. [TestMethod]
  540. public MFTestResults Statements_switch_036_Test()
  541. {
  542. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  543. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  544. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  545. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  546. if (Statements_TestClass_switch_036.testMethod())
  547. {
  548. return MFTestResults.Pass;
  549. }
  550. return MFTestResults.Fail;
  551. }
  552. [TestMethod]
  553. public MFTestResults Statements_switch_037_Test()
  554. {
  555. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  556. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  557. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  558. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  559. if (Statements_TestClass_switch_037.testMethod())
  560. {
  561. return MFTestResults.Pass;
  562. }
  563. return MFTestResults.Fail;
  564. }
  565. [TestMethod]
  566. public MFTestResults Statements_switch_038_Test()
  567. {
  568. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  569. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  570. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  571. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  572. if (Statements_TestClass_switch_038.testMethod())
  573. {
  574. return MFTestResults.Pass;
  575. }
  576. return MFTestResults.Fail;
  577. }
  578. [TestMethod]
  579. public MFTestResults Statements_switch_039_Test()
  580. {
  581. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  582. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  583. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  584. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  585. if (Statements_TestClass_switch_039.testMethod())
  586. {
  587. return MFTestResults.Pass;
  588. }
  589. return MFTestResults.Fail;
  590. }
  591. [TestMethod]
  592. public MFTestResults Statements_switch_040_Test()
  593. {
  594. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  595. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  596. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  597. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  598. if (Statements_TestClass_switch_040.testMethod())
  599. {
  600. return MFTestResults.Pass;
  601. }
  602. return MFTestResults.Fail;
  603. }
  604. [TestMethod]
  605. public MFTestResults Statements_switch_041_Test()
  606. {
  607. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  608. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  609. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  610. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  611. if (Statements_TestClass_switch_041.testMethod())
  612. {
  613. return MFTestResults.Pass;
  614. }
  615. return MFTestResults.Fail;
  616. }
  617. [TestMethod]
  618. public MFTestResults Statements_switch_042_Test()
  619. {
  620. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  621. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  622. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  623. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  624. if (Statements_TestClass_switch_042.testMethod())
  625. {
  626. return MFTestResults.Pass;
  627. }
  628. return MFTestResults.Fail;
  629. }
  630. [TestMethod]
  631. public MFTestResults Statements_switch_044_Test()
  632. {
  633. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  634. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  635. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  636. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  637. if (Statements_TestClass_switch_044.testMethod())
  638. {
  639. return MFTestResults.Pass;
  640. }
  641. return MFTestResults.Fail;
  642. }
  643. [TestMethod]
  644. public MFTestResults Statements_switch_047_Test()
  645. {
  646. Log.Comment("Otherwise, exactly one user-defined implicit conversion (§6.4) must exist from the type of ");
  647. Log.Comment("the switch expression to one of the following possible governing types: sbyte, byte, short,");
  648. Log.Comment("ushort, int, uint, long, ulong, char, string. If no such implicit conversion exists, or if ");
  649. Log.Comment("more than one such implicit conversion exists, a compile-time error occurs.");
  650. Log.Comment("Ensure error is emmited on when more than one implicit conversion to an acceptable governing type is defined");
  651. if (Statements_TestClass_switch_047.testMethod())
  652. {
  653. return MFTestResults.Pass;
  654. }
  655. return MFTestResults.Fail;
  656. }
  657. [TestMethod]
  658. public MFTestResults Statements_switch_049_Test()
  659. {
  660. Log.Comment("warning CS1522: Empty switch block");
  661. if (Statements_TestClass_switch_049.testMethod())
  662. {
  663. return MFTestResults.Pass;
  664. }
  665. return MFTestResults.Fail;
  666. }
  667. [TestMethod]
  668. public MFTestResults Statements_switch_string_001_Test()
  669. {
  670. Log.Comment(" switch on string: null");
  671. if (Statements_TestClass_switch_string_001.testMethod())
  672. {
  673. return MFTestResults.Pass;
  674. }
  675. return MFTestResults.Fail;
  676. }
  677. [TestMethod]
  678. public MFTestResults Statements_dowhile_001_Test()
  679. {
  680. Log.Comment("dowhile_001.sc");
  681. Log.Comment("do/while with a single statement");
  682. if (Statements_TestClass_dowhile_001.testMethod())
  683. {
  684. return MFTestResults.Pass;
  685. }
  686. return MFTestResults.Fail;
  687. }
  688. [TestMethod]
  689. public MFTestResults Statements_dowhile_002_Test()
  690. {
  691. Log.Comment("dowhile_002.sc");
  692. Log.Comment("do/while with a compound statement");
  693. if (Statements_TestClass_dowhile_002.testMethod())
  694. {
  695. return MFTestResults.Pass;
  696. }
  697. return MFTestResults.Fail;
  698. }
  699. [TestMethod]
  700. public MFTestResults Statements_dowhile_003_Test()
  701. {
  702. Log.Comment("dowhile_003.sc");
  703. Log.Comment("verify known false condition executes only once with single statement");
  704. if (Statements_TestClass_dowhile_003.testMethod())
  705. {
  706. return MFTestResults.Pass;
  707. }
  708. return MFTestResults.Fail;
  709. }
  710. [TestMethod]
  711. public MFTestResults Statements_dowhile_004_Test()
  712. {
  713. Log.Comment("dowhile_004.sc");
  714. Log.Comment("verify known true condition executes with single statement");
  715. if (Statements_TestClass_dowhile_004.testMethod())
  716. {
  717. return MFTestResults.Pass;
  718. }
  719. return MFTestResults.Fail;
  720. }
  721. [TestMethod]
  722. public MFTestResults Statements_dowhile_005_Test()
  723. {
  724. Log.Comment("dowhile_005.sc");
  725. Log.Comment("verify known false condition executes once with compound statements");
  726. if (Statements_TestClass_dowhile_005.testMethod())
  727. {
  728. return MFTestResults.Pass;
  729. }
  730. return MFTestResults.Fail;
  731. }
  732. [TestMethod]
  733. public MFTestResults Statements_dowhile_006_Test()
  734. {
  735. Log.Comment("dowhile_006.sc");
  736. Log.Comment("verify known true condition executes with compound statements");
  737. if (Statements_TestClass_dowhile_006.testMethod())
  738. {
  739. return MFTestResults.Pass;
  740. }
  741. return MFTestResults.Fail;
  742. }
  743. [TestMethod]
  744. public MFTestResults Statements_for_001_Test()
  745. {
  746. Log.Comment("for_001.sc");
  747. Log.Comment("empty for loop");
  748. if (Statements_TestClass_for_001.testMethod())
  749. {
  750. return MFTestResults.Pass;
  751. }
  752. return MFTestResults.Fail;
  753. }
  754. [TestMethod]
  755. public MFTestResults Statements_for_003_Test()
  756. {
  757. Log.Comment("for_003.sc");
  758. Log.Comment("empty initializer in for loop");
  759. if (Statements_TestClass_for_003.testMethod())
  760. {
  761. return MFTestResults.Pass;
  762. }
  763. return MFTestResults.Fail;
  764. }
  765. [TestMethod]
  766. public MFTestResults Statements_for_004_Test()
  767. {
  768. Log.Comment("for_004.sc");
  769. Log.Comment("empty iterator in for loop");
  770. if (Statements_TestClass_for_004.testMethod())
  771. {
  772. return MFTestResults.Pass;
  773. }
  774. return MFTestResults.Fail;
  775. }
  776. [TestMethod]
  777. public MFTestResults Statements_for_006_Test()
  778. {
  779. Log.Comment("for_006.sc");
  780. Log.Comment("Full normal for loop");
  781. if (Statements_TestClass_for_006.testMethod())
  782. {
  783. return MFTestResults.Pass;
  784. }
  785. return MFTestResults.Fail;
  786. }
  787. [TestMethod]
  788. public MFTestResults Statements_for_007_Test()
  789. {
  790. Log.Comment("for_007.sc");
  791. Log.Comment("Full normal for loop with a compound statement");
  792. if (Statements_TestClass_for_007.testMethod())
  793. {
  794. return MFTestResults.Pass;
  795. }
  796. return MFTestResults.Fail;
  797. }
  798. [TestMethod]
  799. public MFTestResults Statements_for_008_Test()
  800. {
  801. Log.Comment("for_008.sc");
  802. Log.Comment("Multiple declarations in initializer");
  803. if (Statements_TestClass_for_008.testMethod())
  804. {
  805. return MFTestResults.Pass;
  806. }
  807. return MFTestResults.Fail;
  808. }
  809. [TestMethod]
  810. public MFTestResults Statements_for_009_Test()
  811. {
  812. Log.Comment("for_009.sc");
  813. Log.Comment("Statements_TestClass_? statement expression lists in for initializer");
  814. if (Statements_TestClass_for_009.testMethod())
  815. {
  816. return MFTestResults.Pass;
  817. }
  818. return MFTestResults.Fail;
  819. }
  820. [TestMethod]
  821. public MFTestResults Statements_for_010_Test()
  822. {
  823. Log.Comment("for_010.sc");
  824. Log.Comment("Statements_TestClass_? statement expression lists in for iterator");
  825. if (Statements_TestClass_for_010.testMethod())
  826. {
  827. return MFTestResults.Pass;
  828. }
  829. return MFTestResults.Fail;
  830. }
  831. [TestMethod]
  832. public MFTestResults Statements_for_011_Test()
  833. {
  834. Log.Comment("for_011.sc");
  835. Log.Comment("Statements_TestClass_? statement expression lists in for initializer and iterator");
  836. if (Statements_TestClass_for_011.testMethod())
  837. {
  838. return MFTestResults.Pass;
  839. }
  840. return MFTestResults.Fail;
  841. }
  842. [TestMethod]
  843. public MFTestResults Statements_for_013_Test()
  844. {
  845. Log.Comment("for_013.sc");
  846. Log.Comment("Verify conditional evaluates before iterator");
  847. if (Statements_TestClass_for_013.testMethod())
  848. {
  849. return MFTestResults.Pass;
  850. }
  851. return MFTestResults.Fail;
  852. }
  853. [TestMethod]
  854. public MFTestResults Statements_for_014_Test()
  855. {
  856. Log.Comment("for_014.sc");
  857. Log.Comment("Verify method calls work ok in all for loop areas");
  858. if (Statements_TestClass_for_014.testMethod())
  859. {
  860. return MFTestResults.Pass;
  861. }
  862. return MFTestResults.Fail;
  863. }
  864. [TestMethod]
  865. public MFTestResults Statements_char_in_string_s01_Test()
  866. {
  867. Log.Comment("Optimization to foreach (char c in String) by treating String as a char array");
  868. if (Statements_TestClass_char_in_string_s01.testMethod())
  869. {
  870. return MFTestResults.Pass;
  871. }
  872. return MFTestResults.Fail;
  873. }
  874. [TestMethod]
  875. public MFTestResults Statements_char_in_string_ex01_Test()
  876. {
  877. Log.Comment("Optimization to foreach (char c in String) by treating String as a char array");
  878. if (Statements_TestClass_char_in_string_ex01.testMethod())
  879. {
  880. return MFTestResults.Pass;
  881. }
  882. return MFTestResults.Fail;
  883. }
  884. [TestMethod]
  885. public MFTestResults Statements_while_001_Test()
  886. {
  887. Log.Comment("while_001.sc");
  888. Log.Comment("while with a single statement");
  889. if (Statements_TestClass_while_001.testMethod())
  890. {
  891. return MFTestResults.Pass;
  892. }
  893. return MFTestResults.Fail;
  894. }
  895. [TestMethod]
  896. public MFTestResults Statements_while_002_Test()
  897. {
  898. Log.Comment("while_002.sc");
  899. Log.Comment("while with a compound statement");
  900. if (Statements_TestClass_while_002.testMethod())
  901. {
  902. return MFTestResults.Pass;
  903. }
  904. return MFTestResults.Fail;
  905. }
  906. [TestMethod]
  907. public MFTestResults Statements_while_003_Test()
  908. {
  909. Log.Comment("while_003.sc");
  910. Log.Comment("verify known false condition doesn't execute with single statement");
  911. if (Statements_TestClass_while_003.testMethod())
  912. {
  913. return MFTestResults.Pass;
  914. }
  915. return MFTestResults.Fail;
  916. }
  917. [TestMethod]
  918. public MFTestResults Statements_while_004_Test()
  919. {
  920. Log.Comment("while_004.sc");
  921. Log.Comment("verify known true condition executes with single statement");
  922. if (Statements_TestClass_while_004.testMethod())
  923. {
  924. return MFTestResults.Pass;
  925. }
  926. return MFTestResults.Fail;
  927. }
  928. [TestMethod]
  929. public MFTestResults Statements_while_005_Test()
  930. {
  931. Log.Comment("while_005.sc");
  932. Log.Comment("verify known false condition doesn't execute with compound statements");
  933. if (Statements_TestClass_while_005.testMethod())
  934. {
  935. return MFTestResults.Pass;
  936. }
  937. return MFTestResults.Fail;
  938. }
  939. [TestMethod]
  940. public MFTestResults Statements_while_006_Test()
  941. {
  942. Log.Comment("while_006.sc");
  943. Log.Comment("verify known true condition executes with compound statements");
  944. if (Statements_TestClass_while_006.testMethod())
  945. {
  946. return MFTestResults.Pass;
  947. }
  948. return MFTestResults.Fail;
  949. }
  950. [TestMethod]
  951. public MFTestResults Statements_break_001_Test()
  952. {
  953. Log.Comment("break_001.sc");
  954. Log.Comment("Make sure break works in all basic single statement loops");
  955. if (Statements_TestClass_break_001.testMethod())
  956. {
  957. return MFTestResults.Pass;
  958. }
  959. return MFTestResults.Fail;
  960. }
  961. [TestMethod]
  962. public MFTestResults Statements_break_002_Test()
  963. {
  964. Log.Comment("break_002.sc");
  965. Log.Comment("Make sure break works in all basic compound statement loops");
  966. if (Statements_TestClass_break_002.testMethod())
  967. {
  968. return MFTestResults.Pass;
  969. }
  970. return MFTestResults.Fail;
  971. }
  972. [TestMethod]
  973. public MFTestResults Statements_break_003_Test()
  974. {
  975. Log.Comment("break_003.sc");
  976. Log.Comment("Make sure break optional on end of switch");
  977. if (Statements_TestClass_break_003.testMethod())
  978. {
  979. return MFTestResults.Pass;
  980. }
  981. return MFTestResults.Fail;
  982. }
  983. [TestMethod]
  984. public MFTestResults Statements_break_006_Test()
  985. {
  986. Log.Comment("break_006.sc");
  987. Log.Comment("break in an if successfully breaks loop");
  988. if (Statements_TestClass_break_006.testMethod())
  989. {
  990. return MFTestResults.Pass;
  991. }
  992. return MFTestResults.Fail;
  993. }
  994. [TestMethod]
  995. public MFTestResults Statements_break_007_Test()
  996. {
  997. Log.Comment("break_007.sc");
  998. Log.Comment("break in a blocked if successfully breaks loop");
  999. if (Statements_TestClass_break_007.testMethod())
  1000. {
  1001. return MFTestResults.Pass;
  1002. }
  1003. return MFTestResults.Fail;
  1004. }
  1005. [TestMethod]
  1006. public MFTestResults Statements_break_010_Test()
  1007. {
  1008. Log.Comment("break_010.sc");
  1009. Log.Comment("Make sure break correctly when nested");
  1010. if (Statements_TestClass_break_010.testMethod())
  1011. {
  1012. return MFTestResults.Pass;
  1013. }
  1014. return MFTestResults.Fail;
  1015. }
  1016. [TestMethod]
  1017. public MFTestResults Statements_continue_001_Test()
  1018. {
  1019. Log.Comment("continue_001.sc");
  1020. Log.Comment("Make sure continue works in all basic single statement loops");
  1021. if (Statements_TestClass_continue_001.testMethod())
  1022. {
  1023. return MFTestResults.Pass;
  1024. }
  1025. return MFTestResults.Fail;
  1026. }
  1027. [TestMethod]
  1028. public MFTestResults Statements_continue_002_Test()
  1029. {
  1030. Log.Comment("continue_002.sc");
  1031. Log.Comment("Make sure continue works in all basic compound statement loops");
  1032. Log.Comment("Expected Output");
  1033. if (Statements_TestClass_continue_002.testMethod())
  1034. {
  1035. return MFTestResults.Pass;
  1036. }
  1037. return MFTestResults.Fail;
  1038. }
  1039. [TestMethod]
  1040. public MFTestResults Statements_continue_006_Test()
  1041. {
  1042. Log.Comment("continue_006.sc");
  1043. Log.Comment("continue in an if successfully continues loop");
  1044. if (Statements_TestClass_continue_006.testMethod())
  1045. {
  1046. return MFTestResults.Pass;
  1047. }
  1048. return MFTestResults.Fail;
  1049. }
  1050. [TestMethod]
  1051. public MFTestResults Statements_continue_007_Test()
  1052. {
  1053. Log.Comment("continue_007.sc");
  1054. Log.Comment("continue in a block if successfully continues loop");
  1055. if (Statements_TestClass_continue_007.testMethod())
  1056. {
  1057. return MFTestResults.Pass;
  1058. }
  1059. return MFTestResults.Fail;
  1060. }
  1061. [TestMethod]
  1062. public MFTestResults Statements_continue_010_Test()
  1063. {
  1064. Log.Comment("continue_010.sc");
  1065. Log.Comment("Make sure continue works correctly when nested");
  1066. if (Statements_TestClass_continue_010.testMethod())
  1067. {
  1068. return MFTestResults.Pass;
  1069. }
  1070. return MFTestResults.Fail;
  1071. }
  1072. [TestMethod]
  1073. public MFTestResults Statements_goto_001_Test()
  1074. {
  1075. Log.Comment("goto_001.sc");
  1076. Log.Comment("simple goto to adjust flow control");
  1077. if (Statements_TestClass_goto_001.testMethod())
  1078. {
  1079. return MFTestResults.Pass;
  1080. }
  1081. return MFTestResults.Fail;
  1082. }
  1083. [TestMethod]
  1084. public MFTestResults Statements_goto_008_Test()
  1085. {
  1086. Log.Comment("goto_008.sc");
  1087. Log.Comment("goto currect case");
  1088. if (Statements_TestClass_goto_008.testMethod())
  1089. {
  1090. return MFTestResults.Pass;
  1091. }
  1092. return MFTestResults.Fail;
  1093. }
  1094. [TestMethod]
  1095. public MFTestResults Statements_goto_009_Test()
  1096. {
  1097. Log.Comment("goto_009.sc");
  1098. Log.Comment("goto a different case");
  1099. Log.Comment("Expected Output");
  1100. if (Statements_TestClass_goto_009.testMethod())
  1101. {
  1102. return MFTestResults.Pass;
  1103. }
  1104. return MFTestResults.Fail;
  1105. }
  1106. [TestMethod]
  1107. public MFTestResults Statements_goto_010_Test()
  1108. {
  1109. Log.Comment("goto_010.sc");
  1110. Log.Comment("goto default correctly");
  1111. if (Statements_TestClass_goto_010.testMethod())
  1112. {
  1113. return MFTestResults.Pass;
  1114. }
  1115. return MFTestResults.Fail;
  1116. }
  1117. [TestMethod]
  1118. public MFTestResults Statements_goto_014_Test()
  1119. {
  1120. Log.Comment("goto_014.sc");
  1121. Log.Comment("simple gotos to test jumping to parent process.");
  1122. if (Statements_TestClass_goto_014.testMethod())
  1123. {
  1124. return MFTestResults.Pass;
  1125. }
  1126. return MFTestResults.Fail;
  1127. }
  1128. [TestMethod]
  1129. public MFTestResults Statements_goto_017_Test()
  1130. {
  1131. Log.Comment(" some gotos");
  1132. if (Statements_TestClass_goto_017.testMethod())
  1133. {
  1134. return MFTestResults.Pass;
  1135. }
  1136. return MFTestResults.Fail;
  1137. }
  1138. [TestMethod]
  1139. public MFTestResults Statements_goto_018_Test()
  1140. {
  1141. Log.Comment(" try/catch/finally with goto");
  1142. if (Statements_TestClass_goto_018.testMethod())
  1143. {
  1144. return MFTestResults.Pass;
  1145. }
  1146. return MFTestResults.Fail;
  1147. }
  1148. [TestMethod]
  1149. public MFTestResults Statements_return_001_Test()
  1150. {
  1151. Log.Comment("return_001.sc");
  1152. Log.Comment("simple void return on a void method");
  1153. if (Statements_TestClass_return_001.testMethod())
  1154. {
  1155. return MFTestResults.Pass;
  1156. }
  1157. return MFTestResults.Fail;
  1158. }
  1159. [TestMethod]
  1160. public MFTestResults Statements_return_004_Test()
  1161. {
  1162. Log.Comment("return_004.sc");
  1163. Log.Comment("simple return a normal type, assigning, and ignoring return value");
  1164. if (Statements_TestClass_return_004.testMethod())
  1165. {
  1166. return MFTestResults.Pass;
  1167. }
  1168. return MFTestResults.Fail;
  1169. }
  1170. [TestMethod]
  1171. public MFTestResults Statements_return_006_Test()
  1172. {
  1173. Log.Comment("return_006.sc");
  1174. Log.Comment("simple return a type mismatch that has an implicit conversion");
  1175. if (Statements_TestClass_return_006.testMethod())
  1176. {
  1177. return MFTestResults.Pass;
  1178. }
  1179. return MFTestResults.Fail;
  1180. }
  1181. [TestMethod]
  1182. public MFTestResults Statements_return_008_Test()
  1183. {
  1184. Log.Comment("return_008.sc");
  1185. Log.Comment("simple return a type mismatch that has an explicit convertion conversion,");
  1186. Log.Comment("applying the cast");
  1187. if (Statements_TestClass_return_008.testMethod())
  1188. {
  1189. return MFTestResults.Pass;
  1190. }
  1191. return MFTestResults.Fail;
  1192. }
  1193. [TestMethod]
  1194. public MFTestResults Statements_return_009_Test()
  1195. {
  1196. Log.Comment("return_009.sc");
  1197. Log.Comment("return of a struct");
  1198. if (Statements_TestClass_return_009.testMethod())
  1199. {
  1200. return MFTestResults.Pass;
  1201. }
  1202. return MFTestResults.Fail;
  1203. }
  1204. [TestMethod]
  1205. public MFTestResults Statements_return_010_Test()
  1206. {
  1207. Log.Comment("return_010.sc");
  1208. Log.Comment("return of a class");
  1209. if (Statements_TestClass_return_010.testMethod())
  1210. {
  1211. return MFTestResults.Pass;
  1212. }
  1213. return MFTestResults.Fail;
  1214. }
  1215. [TestMethod]
  1216. public MFTestResults Statements_return_013_Test()
  1217. {
  1218. Log.Comment("return_013.sc");
  1219. Log.Comment("simple falloff on a void method");
  1220. if (Statements_TestClass_return_013.testMethod())
  1221. {
  1222. return MFTestResults.Pass;
  1223. }
  1224. return MFTestResults.Fail;
  1225. }
  1226. [TestMethod]
  1227. public MFTestResults Statements_return_014_Test()
  1228. {
  1229. Log.Comment("return_014.sc");
  1230. Log.Comment("verify that a 'throw' is adequate for flow control analysis of return type");
  1231. if (Statements_TestClass_return_014.testMethod())
  1232. {
  1233. return MFTestResults.Pass;
  1234. }
  1235. return MFTestResults.Fail;
  1236. }
  1237. [TestMethod]
  1238. public MFTestResults Statements_throw_001_Test()
  1239. {
  1240. Log.Comment("throw_001.sc");
  1241. Log.Comment("simple throw");
  1242. if (Statements_TestClass_throw_001.testMethod())
  1243. {
  1244. return MFTestResults.Pass;
  1245. }
  1246. return MFTestResults.Fail;
  1247. }
  1248. [TestMethod]
  1249. public MFTestResults Statements_throw_005_Test()
  1250. {
  1251. Log.Comment("throw_005.sc");
  1252. Log.Comment("simple throw with output");
  1253. if (Statements_TestClass_throw_005.testMethod())
  1254. {
  1255. return MFTestResults.Pass;
  1256. }
  1257. return MFTestResults.Fail;
  1258. }
  1259. [TestMethod]
  1260. public MFTestResults Statements_trycatch_001_Test()
  1261. {
  1262. Log.Comment("trycatch_001.sc");
  1263. Log.Comment("simple throw");
  1264. if (Statements_TestClass_trycatch_001.testMethod())
  1265. {
  1266. return MFTestResults.Pass;
  1267. }
  1268. return MFTestResults.Fail;
  1269. }
  1270. [TestMethod]
  1271. public MFTestResults Statements_trycatch_006_Test()
  1272. {
  1273. Log.Comment("trycatch_006.sc");
  1274. Log.Comment("simple system generated System.Exception");
  1275. if (Statements_TestClass_trycatch_006.testMethod())
  1276. {
  1277. return MFTestResults.Pass;
  1278. }
  1279. return MFTestResults.Fail;
  1280. }
  1281. [TestMethod]
  1282. public MFTestResults Statements_trycatch_007_Test()
  1283. {
  1284. Log.Comment("trycatch_007.sc");
  1285. Log.Comment("simple re-throw");
  1286. if (Statements_TestClass_trycatch_007.testMethod())
  1287. {
  1288. return MFTestResults.Pass;
  1289. }
  1290. return MFTestResults.Fail;
  1291. }
  1292. [TestMethod]
  1293. public MFTestResults Statements_tryfinally_001_Test()
  1294. {
  1295. Log.Comment("tryfinally_001.sc");
  1296. Log.Comment("simple finally");
  1297. if (Statements_TestClass_tryfinally_001.testMethod())
  1298. {
  1299. return MFTestResults.Pass;
  1300. }
  1301. return MFTestResults.Fail;
  1302. }
  1303. [TestMethod]
  1304. public MFTestResults Statements_tryfinally_002_Test()
  1305. {
  1306. Log.Comment("tryfinally_002.sc");
  1307. Log.Comment("simple finally inside try/catch");
  1308. if (Statements_TestClass_tryfinally_002.testMethod())
  1309. {
  1310. return MFTestResults.Pass;
  1311. }
  1312. return MFTestResults.Fail;
  1313. }
  1314. [TestMethod]
  1315. public MFTestResults Statements_tryfinally_003_Test()
  1316. {
  1317. Log.Comment("tryfinally_003.sc");
  1318. Log.Comment("simple finally outside try/catch");
  1319. if (Statements_TestClass_tryfinally_003.testMethod())
  1320. {
  1321. return MFTestResults.Pass;
  1322. }
  1323. return MFTestResults.Fail;
  1324. }
  1325. [TestMethod]
  1326. public MFTestResults Statements_tryfinally_004_Test()
  1327. {
  1328. Log.Comment("tryfinally_004.sc");
  1329. Log.Comment("simple finally passed 'over' by a goto");
  1330. if (Statements_TestClass_tryfinally_004.testMethod())
  1331. {
  1332. return MFTestResults.Pass;
  1333. }
  1334. return MFTestResults.Fail;
  1335. }
  1336. [TestMethod]
  1337. public MFTestResults Statements_tryfinally_006_Test()
  1338. {
  1339. Log.Comment("tryfinally_006.sc");
  1340. Log.Comment("simple finally exited by throw");
  1341. if (Statements_TestClass_tryfinally_006.testMethod())
  1342. {
  1343. return MFTestResults.Pass;
  1344. }
  1345. return MFTestResults.Fail;
  1346. }
  1347. [TestMethod]
  1348. public MFTestResults Statements_tryfinally_007_Test()
  1349. {
  1350. Log.Comment("tryfinally_007.sc");
  1351. Log.Comment("simple finally exited by throw in a called method");
  1352. if (Statements_TestClass_tryfinally_007.testMethod())
  1353. {
  1354. return MFTestResults.Pass;
  1355. }
  1356. return MFTestResults.Fail;
  1357. }
  1358. [TestMethod]
  1359. public MFTestResults Statements_tryfinally_008_Test()
  1360. {
  1361. Log.Comment("tryfinally_008.sc");
  1362. Log.Comment("simple finally exited by return");
  1363. if (Statements_TestClass_tryfinally_008.testMethod())
  1364. {
  1365. return MFTestResults.Pass;
  1366. }
  1367. return MFTestResults.Fail;
  1368. }
  1369. [TestMethod]
  1370. public MFTestResults Statements_tryfinally_009_Test()
  1371. {
  1372. Log.Comment("tryfinally_009.sc");
  1373. Log.Comment("simple finally exited by continue");
  1374. if (Statements_TestClass_tryfinally_009.testMethod())
  1375. {
  1376. return MFTestResults.Pass;
  1377. }
  1378. return MFTestResults.Fail;
  1379. }
  1380. [TestMethod]
  1381. public MFTestResults Statements_tryfinally_010_Test()
  1382. {
  1383. Log.Comment("tryfinally_010.sc");
  1384. Log.Comment("simple finally exited by break");
  1385. if (Statements_TestClass_tryfinally_010.testMethod())
  1386. {
  1387. return MFTestResults.Pass;
  1388. }
  1389. return MFTestResults.Fail;
  1390. }
  1391. [TestMethod]
  1392. public MFTestResults Statements_tryfinally_011_Test()
  1393. {
  1394. Log.Comment("tryfinally_011.sc");
  1395. Log.Comment("simple finally exited by break (where break is outside try)");
  1396. if (Statements_TestClass_tryfinally_011.testMethod())
  1397. {
  1398. return MFTestResults.Pass;
  1399. }
  1400. return MFTestResults.Fail;
  1401. }
  1402. [TestMethod]
  1403. public MFTestResults Statements_tryfinally_012_Test()
  1404. {
  1405. Log.Comment("tryfinally_012.sc");
  1406. Log.Comment("simple finally exited by system System.Exception");
  1407. if (Statements_TestClass_tryfinally_012.testMethod())
  1408. {
  1409. return MFTestResults.Pass;
  1410. }
  1411. return MFTestResults.Fail;
  1412. }
  1413. [TestMethod]
  1414. public MFTestResults Statements_tryfinally_013_Test()
  1415. {
  1416. if (Statements_TestClass_tryfinally_013.testMethod())
  1417. {
  1418. return MFTestResults.Pass;
  1419. }
  1420. return MFTestResults.Fail;
  1421. }
  1422. [TestMethod]
  1423. public MFTestResults Statements_Using_001_Test()
  1424. {
  1425. Log.Comment("using_001.cs");
  1426. Log.Comment("Statements_TestClass_? the using statement.");
  1427. Log.Comment("Cast a class to IDisposable explicitly, use that in the using statement. (1.a)");
  1428. if (Statements_TestClass_Using_001.testMethod())
  1429. {
  1430. return MFTestResults.Pass;
  1431. }
  1432. return MFTestResults.Fail;
  1433. }
  1434. [TestMethod]
  1435. public MFTestResults Statements_Using_002_Test()
  1436. {
  1437. Log.Comment("using_002.cs");
  1438. Log.Comment("Statements_TestClass_? the using statement.");
  1439. Log.Comment("Use a class directly in using (1.b)");
  1440. if (Statements_TestClass_Using_002.testMethod())
  1441. {
  1442. return MFTestResults.Pass;
  1443. }
  1444. return MFTestResults.Fail;
  1445. }
  1446. [TestMethod]
  1447. public MFTestResults Statements_Using_003_Test()
  1448. {
  1449. Log.Comment("using_003.cs");
  1450. Log.Comment("Statements_TestClass_? the using statement.");
  1451. Log.Comment("Creation of class as part of using statement (1.c)");
  1452. if (Statements_TestClass_Using_003.testMethod())
  1453. {
  1454. return MFTestResults.Pass;
  1455. }
  1456. return MFTestResults.Fail;
  1457. }
  1458. [TestMethod]
  1459. public MFTestResults Statements_Using_005_Test()
  1460. {
  1461. Log.Comment("using_005.cs");
  1462. Log.Comment("Statements_TestClass_? the using statement.");
  1463. Log.Comment("A class that explicitly implements IDisposable. (1.e)");
  1464. if (Statements_TestClass_Using_005.testMethod())
  1465. {
  1466. return MFTestResults.Pass;
  1467. }
  1468. return MFTestResults.Fail;
  1469. }
  1470. [TestMethod]
  1471. public MFTestResults Statements_Using_009_Test()
  1472. {
  1473. Log.Comment("using_009.cs");
  1474. Log.Comment("Statements_TestClass_? the using statement.");
  1475. Log.Comment("Statements_TestClass_? the behavior if the used variable is nulled-out in the using block (4)");
  1476. if (Statements_TestClass_Using_009.testMethod())
  1477. {
  1478. return MFTestResults.Pass;
  1479. }
  1480. return MFTestResults.Fail;
  1481. }
  1482. [TestMethod]
  1483. public MFTestResults Statements_Using_010_Test()
  1484. {
  1485. Log.Comment("using_010.cs");
  1486. Log.Comment("Statements_TestClass_? the using statement.");
  1487. Log.Comment("Dispose() called during normal exit (5.a)");
  1488. if (Statements_TestClass_Using_010.testMethod())
  1489. {
  1490. return MFTestResults.Pass;
  1491. }
  1492. return MFTestResults.Fail;
  1493. }
  1494. [TestMethod]
  1495. public MFTestResults Statements_Using_011_Test()
  1496. {
  1497. Log.Comment("using_011.cs");
  1498. Log.Comment("Statements_TestClass_? the using statement.");
  1499. Log.Comment("Dispose() called after throw (5.b)");
  1500. Log.Comment("Expected Output");
  1501. if (Statements_TestClass_Using_011.testMethod())
  1502. {
  1503. return MFTestResults.Pass;
  1504. }
  1505. return MFTestResults.Fail;
  1506. }
  1507. [TestMethod]
  1508. public MFTestResults Statements_Using_012_Test()
  1509. {
  1510. Log.Comment("using_012.cs");
  1511. Log.Comment("Statements_TestClass_? the using statement.");
  1512. Log.Comment("Dispose() called for two objects during normal exit. (5.c)");
  1513. if (Statements_TestClass_Using_012.testMethod())
  1514. {
  1515. return MFTestResults.Pass;
  1516. }
  1517. return MFTestResults.Fail;
  1518. }
  1519. [TestMethod]
  1520. public MFTestResults Statements_Using_013_Test()
  1521. {
  1522. Log.Comment("using_013.cs");
  1523. Log.Comment("Statements_TestClass_? the using statement.");
  1524. Log.Comment("Dispose() called for first objects with System.Exception thrown before second block. (5.d)");
  1525. if (Statements_TestClass_Using_013.testMethod())
  1526. {
  1527. return MFTestResults.Pass;
  1528. }
  1529. return MFTestResults.Fail;
  1530. }
  1531. [TestMethod]
  1532. public MFTestResults Statements_Using_014_Test()
  1533. {
  1534. Log.Comment("using_014.cs");
  1535. Log.Comment("Statements_TestClass_? the using statement.");
  1536. Log.Comment("Dispose() called for first objects with System.Exception thrown after second block. (5.e)");
  1537. if (Statements_TestClass_Using_014.testMethod())
  1538. {
  1539. return MFTestResults.Pass;
  1540. }
  1541. return MFTestResults.Fail;
  1542. }
  1543. [TestMethod]
  1544. public MFTestResults Statements_Using_015_Test()
  1545. {
  1546. Log.Comment("using_015.cs");
  1547. Log.Comment("Statements_TestClass_? the using statement.");
  1548. Log.Comment("Dispose() called for both objects when System.Exception thrown inside second block. (5.f)");
  1549. if (Statements_TestClass_Using_015.testMethod())
  1550. {
  1551. return MFTestResults.Pass;
  1552. }
  1553. return MFTestResults.Fail;
  1554. }
  1555. [TestMethod]
  1556. public MFTestResults Statements_Using_017_Test()
  1557. {
  1558. Log.Comment("using_017.cs");
  1559. Log.Comment("Statements_TestClass_? the using statement.");
  1560. Log.Comment("Dispose() called for both objects when System.Exception thrown in compound case (5.h)");
  1561. if (Statements_TestClass_Using_017.testMethod())
  1562. {
  1563. return MFTestResults.Pass;
  1564. }
  1565. return MFTestResults.Fail;
  1566. }
  1567. [TestMethod]
  1568. public MFTestResults Statements_Using_018_Test()
  1569. {
  1570. Log.Comment("using_018.cs");
  1571. Log.Comment("Statements_TestClass_? the using statement.");
  1572. Log.Comment("Dispose() called for both objects in compound using. (5.g)");
  1573. if (Statements_TestClass_Using_018.testMethod())
  1574. {
  1575. return MFTestResults.Pass;
  1576. }
  1577. return MFTestResults.Fail;
  1578. }
  1579. [TestMethod]
  1580. public MFTestResults Statements_lock001_Test()
  1581. {
  1582. Log.Comment("The expression of a lock statement must denote a value of a reference-type");
  1583. if (Statements_TestClass_lock001.testMethod())
  1584. {
  1585. return MFTestResults.Pass;
  1586. }
  1587. return MFTestResults.Fail;
  1588. }
  1589. [TestMethod]
  1590. public MFTestResults Statements_lock003_Test()
  1591. {
  1592. Log.Comment("The System.Type object of a class can conveniently be used as the mutual-exclusion lock for static methods of the class");
  1593. if (Statements_TestClass_lock003.testMethod())
  1594. {
  1595. return MFTestResults.Pass;
  1596. }
  1597. return MFTestResults.Fail;
  1598. }
  1599. [TestMethod]
  1600. public MFTestResults Statements_lock004_Test()
  1601. {
  1602. Log.Comment("possible mistaken null statement when semi-column appears directly after lock()");
  1603. if (Statements_TestClass_lock004.testMethod())
  1604. {
  1605. return MFTestResults.Pass;
  1606. }
  1607. return MFTestResults.Fail;
  1608. }
  1609. [TestMethod]
  1610. public MFTestResults Statements_lock005_Test()
  1611. {
  1612. Log.Comment("this as the lock expression in a reference type");
  1613. if (Statements_TestClass_lock005.testMethod())
  1614. {
  1615. return MFTestResults.Pass;
  1616. }
  1617. return MFTestResults.Fail;
  1618. }
  1619. [TestMethod]
  1620. public MFTestResults Statements_lock007_Test()
  1621. {
  1622. Log.Comment("nested lock statements");
  1623. if (Statements_TestClass_lock007.testMethod())
  1624. {
  1625. return MFTestResults.Pass;
  1626. }
  1627. return MFTestResults.Fail;
  1628. }
  1629. [TestMethod]
  1630. public MFTestResults Statements_enum_002_Test()
  1631. {
  1632. Log.Comment(" enum: comparing constant casted to an enum type to a variable");
  1633. if (Statements_TestClass_enum_002.testMethod())
  1634. {
  1635. return MFTestResults.Pass;
  1636. }
  1637. return MFTestResults.Fail;
  1638. }
  1639. public class Res1 : IDisposable
  1640. {
  1641. public void Dispose()
  1642. {
  1643. Log.Comment("Res1.Dispose()");
  1644. }
  1645. public void Func()
  1646. {
  1647. Log.Comment("Res1.Func()");
  1648. }
  1649. public void Throw()
  1650. {
  1651. throw (new System.Exception("Res1"));
  1652. }
  1653. }
  1654. public class Res2 : IDisposable
  1655. {
  1656. public void Dispose()
  1657. {
  1658. Log.Comment("Res2.Dispose()");
  1659. }
  1660. public void Func()
  1661. {
  1662. Log.Comment("Res2.Func()");
  1663. }
  1664. public void Throw()
  1665. {
  1666. throw (new System.Exception("Res2"));
  1667. }
  1668. }
  1669. // IDispose implemented explicitly
  1670. public class ResExplicit : IDisposable
  1671. {
  1672. void IDisposable.Dispose()
  1673. {
  1674. Log.Comment("ResExplicit.Dispose()");
  1675. }
  1676. public void Func()
  1677. {
  1678. Log.Comment("ResExplicit.Func()");
  1679. }
  1680. public void Throw()
  1681. {
  1682. throw (new System.Exception("ResExplicit"));
  1683. }
  1684. }
  1685. // A class that doesn't implement IDisposable.
  1686. public class NonRes1
  1687. {
  1688. public void GarbageDisposal()
  1689. {
  1690. Log.Comment("NonRes1.GarbageDisposal()");
  1691. }
  1692. public void Func()
  1693. {
  1694. Log.Comment("NonRes1.Func()");
  1695. }
  1696. public void Throw()
  1697. {
  1698. throw (new System.Exception("NonRes1"));
  1699. }
  1700. }
  1701. // Doesn't implement IDisposable, but has a Dispose() function...
  1702. public class NonRes2
  1703. {
  1704. public void Dispose()
  1705. {
  1706. Log.Comment("NonRes2.Dispose()");
  1707. }
  1708. public void Func()
  1709. {
  1710. Log.Comment("NonRes2.Func()");
  1711. }
  1712. public void Throw()
  1713. {
  1714. throw (new System.Exception("NonRes2"));
  1715. }
  1716. }
  1717. //Compiled Test Cases
  1718. public class Statements_TestClass_Label_001
  1719. {
  1720. public static int Main_old(string[] args)
  1721. {
  1722. Label:
  1723. return (0);
  1724. }
  1725. public static bool testMethod()
  1726. {
  1727. return (Main_old(null) == 0);
  1728. }
  1729. }
  1730. public class Statements_TestClass_Label_002
  1731. {
  1732. public static int Main_old(string[] args)
  1733. {
  1734. goto Label;
  1735. return (1);
  1736. Label:
  1737. return (0);
  1738. }
  1739. public static bool testMethod()
  1740. {
  1741. return (Main_old(null) == 0);
  1742. }
  1743. }
  1744. public class Statements_TestClass_Label_004
  1745. {
  1746. public static int Main_old(string[] args)
  1747. {
  1748. Method();
  1749. return (0);
  1750. }
  1751. public static void Method()
  1752. {
  1753. goto Label;
  1754. Label: ;
  1755. }
  1756. public static bool testMethod()
  1757. {
  1758. return (Main_old(null) == 0);
  1759. }
  1760. }
  1761. public class Statements_TestClass_Decl_001
  1762. {
  1763. public static int Main_old(string[] args)
  1764. {
  1765. int i;
  1766. return (0);
  1767. }
  1768. public static bool testMethod()
  1769. {
  1770. return (Main_old(null) == 0);
  1771. }
  1772. }
  1773. public class Statements_TestClass_Decl_002
  1774. {
  1775. public static int Main_old(string[] args)
  1776. {
  1777. int i = 99;
  1778. if (i != 99)
  1779. return (1);
  1780. return (0);
  1781. }
  1782. public static bool testMethod()
  1783. {
  1784. return (Main_old(null) == 0);
  1785. }
  1786. }
  1787. public class Statements_TestClass_Decl_003
  1788. {
  1789. public static int Main_old(string[] args)
  1790. {
  1791. int i = 99;
  1792. int j = i + 1;
  1793. if (i != 99)
  1794. return (1);
  1795. if (j != 100)
  1796. return (1);
  1797. return (0);
  1798. }
  1799. public static bool testMethod()
  1800. {
  1801. return (Main_old(null) == 0);
  1802. }
  1803. }
  1804. public class Statements_TestClass_Decl_004
  1805. {
  1806. public static int Main_old(string[] args)
  1807. {
  1808. System.Exception r;
  1809. return (0);
  1810. }
  1811. public static bool testMethod()
  1812. {
  1813. return (Main_old(null) == 0);
  1814. }
  1815. }
  1816. public class Statements_TestClass_Decl_007
  1817. {
  1818. public static int Main_old(string[] args)
  1819. {
  1820. int i, j, k;
  1821. return (0);
  1822. }
  1823. public static bool testMethod()
  1824. {
  1825. return (Main_old(null) == 0);
  1826. }
  1827. }
  1828. public class Statements_TestClass_Decl_009
  1829. {
  1830. public static int Main_old(string[] args)
  1831. {
  1832. int i = 1, j = i + 1, k = i + j + 3;
  1833. if ((i != 1) || (j != 2) || (k != 6))
  1834. return (1);
  1835. return (0);
  1836. }
  1837. public static bool testMethod()
  1838. {
  1839. return (Main_old(null) == 0);
  1840. }
  1841. }
  1842. public class Statements_TestClass_Decl_010
  1843. {
  1844. public static int Main_old(string[] args)
  1845. {
  1846. int[] i;
  1847. return (0);
  1848. }
  1849. public static bool testMethod()
  1850. {
  1851. return (Main_old(null) == 0);
  1852. }
  1853. }
  1854. public class Statements_TestClass_Decl_012
  1855. {
  1856. public static int Main_old(string[] args)
  1857. {
  1858. int[] i = new int[30];
  1859. int j = i[23];
  1860. if (j != 0)
  1861. {
  1862. return (1);
  1863. }
  1864. return (0);
  1865. }
  1866. public static bool testMethod()
  1867. {
  1868. return (Main_old(null) == 0);
  1869. }
  1870. }
  1871. public class Statements_TestClass_Decl_014
  1872. {
  1873. public static int Main_old(string[] args)
  1874. {
  1875. int[] i = new int[] { 0, 1, 2, 3, 4 };
  1876. int j = i[2];
  1877. if (j != 2)
  1878. {
  1879. return (1);
  1880. }
  1881. return (0);
  1882. }
  1883. public static bool testMethod()
  1884. {
  1885. return (Main_old(null) == 0);
  1886. }
  1887. }
  1888. public class Foo
  1889. {
  1890. public Foo(int i)
  1891. {
  1892. m_i = i;
  1893. }
  1894. public int GetInt() { return (m_i); }
  1895. int m_i;
  1896. }
  1897. public class Statements_TestClass_Decl_016
  1898. {
  1899. public static int Main_old(string[] args)
  1900. {
  1901. Foo[] f = new Foo[30]; // 30 null'd foos
  1902. Foo foo = f[23];
  1903. for (int i = 0; i < f.Length; i++)
  1904. {
  1905. foo = f[i];
  1906. if (foo != null)
  1907. return (1);
  1908. f[i] = foo = new Foo(i);
  1909. if (foo.GetInt() != i)
  1910. {
  1911. Log.Comment("new Foo() didn't take");
  1912. return (1);
  1913. }
  1914. if (f[i].GetInt() != i)
  1915. {
  1916. Log.Comment("Array didn't get updated");
  1917. return (1);
  1918. }
  1919. if (f[i] != foo)
  1920. {
  1921. Log.Comment("Array element and foo are different");
  1922. return (i);
  1923. }
  1924. }
  1925. return (0);
  1926. }
  1927. public static bool testMethod()
  1928. {
  1929. return (Main_old(null) == 0);
  1930. }
  1931. }
  1932. public class Statements_TestClass_Block_001
  1933. {
  1934. public static int Main_old(string[] args)
  1935. {
  1936. int status = 0;
  1937. // arbitrary nesting
  1938. {
  1939. int i;
  1940. i = 0;
  1941. i++;
  1942. }
  1943. // empty nesting
  1944. {
  1945. {
  1946. {
  1947. {
  1948. {
  1949. {
  1950. {
  1951. {
  1952. {
  1953. {
  1954. {
  1955. {
  1956. {
  1957. {
  1958. {
  1959. {
  1960. {
  1961. {
  1962. {
  1963. {
  1964. {
  1965. {
  1966. {
  1967. {
  1968. {
  1969. {
  1970. {
  1971. {
  1972. {
  1973. {
  1974. {
  1975. {
  1976. {
  1977. {
  1978. {
  1979. {
  1980. {
  1981. {
  1982. {
  1983. {
  1984. {
  1985. {
  1986. {
  1987. {
  1988. {
  1989. {
  1990. {
  1991. {
  1992. {
  1993. {
  1994. {
  1995. {
  1996. {
  1997. {
  1998. {
  1999. {
  2000. {
  2001. {
  2002. {
  2003. {
  2004. {
  2005. {
  2006. {
  2007. {
  2008. {
  2009. {
  2010. {
  2011. {
  2012. {
  2013. {
  2014. int i;
  2015. i = 0;
  2016. i++;
  2017. }
  2018. }
  2019. }
  2020. }
  2021. }
  2022. }
  2023. }
  2024. }
  2025. }
  2026. }
  2027. }
  2028. }
  2029. }
  2030. }
  2031. }
  2032. }
  2033. }
  2034. }
  2035. }
  2036. }
  2037. }
  2038. }
  2039. }
  2040. }
  2041. }
  2042. }
  2043. }
  2044. }
  2045. }
  2046. }
  2047. }
  2048. }
  2049. }
  2050. }
  2051. }
  2052. }
  2053. }
  2054. }
  2055. }
  2056. }
  2057. }
  2058. }
  2059. }
  2060. }
  2061. }
  2062. }
  2063. }
  2064. }
  2065. }
  2066. }
  2067. }
  2068. }
  2069. }
  2070. }
  2071. }
  2072. }
  2073. }
  2074. }
  2075. }
  2076. }
  2077. }
  2078. }
  2079. }
  2080. }
  2081. }
  2082. }
  2083. }
  2084. }
  2085. }
  2086. }
  2087. // empty hanging clause
  2088. if (true)
  2089. {
  2090. }
  2091. else
  2092. {
  2093. status = 1;
  2094. }
  2095. while (false)
  2096. {
  2097. }
  2098. do
  2099. {
  2100. } while (false);
  2101. switch (status)
  2102. {
  2103. }
  2104. for (; false; )
  2105. {
  2106. }
  2107. Label: { }
  2108. return (status);
  2109. }
  2110. public static bool testMethod()
  2111. {
  2112. return (Main_old(null) == 0);
  2113. }
  2114. }
  2115. public class Statements_TestClass_Empty_001
  2116. {
  2117. public static int Main_old(string[] args)
  2118. {
  2119. int status = 0;
  2120. // empty series
  2121. ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
  2122. int i;
  2123. i = 0;
  2124. i++;
  2125. ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
  2126. // empty hanging clause
  2127. if (true)
  2128. ;
  2129. else
  2130. {
  2131. status = 1;
  2132. }
  2133. while (false)
  2134. ;
  2135. do ; while (false);
  2136. switch (status)
  2137. {
  2138. default: break;
  2139. }
  2140. for (; false; )
  2141. ;
  2142. Label: ;
  2143. return (status);
  2144. }
  2145. public static bool testMethod()
  2146. {
  2147. return (Main_old(null) == 0);
  2148. }
  2149. }
  2150. public class Statements_TestClass_Expr_002
  2151. {
  2152. public static int Main_old(string[] args)
  2153. {
  2154. bool b = false;
  2155. b = true || false || b;
  2156. if (!b)
  2157. return (1);
  2158. return (0);
  2159. }
  2160. public static bool testMethod()
  2161. {
  2162. return (Main_old(null) == 0);
  2163. }
  2164. }
  2165. public class Statements_TestClass_Expr_003
  2166. {
  2167. public static int Main_old(string[] args)
  2168. {
  2169. bool b = false;
  2170. bool b1;
  2171. bool b2;
  2172. b = b1 = b2 = true || false || b;
  2173. if (!b || !b1 || !b2)
  2174. return(1);
  2175. return(false ? 1 : 0);
  2176. }
  2177. public static bool testMethod()
  2178. {
  2179. return (Main_old(null) == 0);
  2180. }
  2181. }
  2182. public class Statements_TestClass_Expr_004
  2183. {
  2184. public static int Main_old(string[] args)
  2185. {
  2186. int i = 0;
  2187. Log.Comment("Adding 5");
  2188. i += 5; // i == 5
  2189. if (i != 5) return(1);
  2190. Log.Comment("Subtracting 3");
  2191. i -= 3; // i == 2
  2192. if (i != 2) return(1);
  2193. Log.Comment("Multiplying by 4");
  2194. i *= 4; // i == 8
  2195. if (i != 8) return(1);
  2196. Log.Comment("Dividing by 2");
  2197. i /= 2; // i == 4
  2198. if (i != 4) return(1);
  2199. Log.Comment("Left Shifting 3");
  2200. i <<= 3; // i == 32
  2201. if (i != 32) return(1);
  2202. Log.Comment("Right Shifting 2");
  2203. i >>= 2; // i == 8
  2204. if (i != 8) return(1);
  2205. Log.Comment("ANDing against logical not");
  2206. i &= ~i; // i = 0
  2207. if (i != 0) return(1);
  2208. Log.Comment("ORing by 0xBeaf");
  2209. i |= 48815; // i = 0xBeaf
  2210. if (i != 0xBeaf) return(1);
  2211. return(true ? 0 : 1);
  2212. }
  2213. public static bool testMethod()
  2214. {
  2215. return (Main_old(null) == 0);
  2216. }
  2217. }
  2218. public class Statements_TestClass_Expr_006
  2219. {
  2220. public static int Main_old(string[] args)
  2221. {
  2222. int b, c, d, e;
  2223. e = 1;
  2224. int a = b = c = d = e++ + 1;
  2225. b = a = d + e * 2;
  2226. if ((a == 6) && (a == b) && (c == 2) && (c == d) && (d == e))
  2227. return 0;
  2228. else
  2229. return 1;
  2230. }
  2231. public static bool testMethod()
  2232. {
  2233. return (Main_old(null) == 0);
  2234. }
  2235. }
  2236. public class Statements_TestClass_if_001
  2237. {
  2238. public static int Main_old(string[] args)
  2239. {
  2240. if (true)
  2241. return (0);
  2242. return (1);
  2243. }
  2244. public static bool testMethod()
  2245. {
  2246. return (Main_old(null) == 0);
  2247. }
  2248. }
  2249. public class Statements_TestClass_if_003
  2250. {
  2251. public static int Main_old(string[] args)
  2252. {
  2253. if (true)
  2254. {
  2255. int i = 0;
  2256. return (i);
  2257. }
  2258. return (1);
  2259. }
  2260. public static bool testMethod()
  2261. {
  2262. return (Main_old(null) == 0);
  2263. }
  2264. }
  2265. public class Statements_TestClass_if_005
  2266. {
  2267. public static int Main_old(string[] args)
  2268. {
  2269. int ret = 0;
  2270. if (true)
  2271. ret = ret;
  2272. else
  2273. ret = 1;
  2274. if (false)
  2275. ret = 1;
  2276. else
  2277. ret = ret;
  2278. return (ret);
  2279. }
  2280. public static bool testMethod()
  2281. {
  2282. return (Main_old(null) == 0);
  2283. }
  2284. }
  2285. public class Statements_TestClass_if_007
  2286. {
  2287. public static int Main_old(string[] args)
  2288. {
  2289. int ret = 0;
  2290. if (true)
  2291. {
  2292. int i = ret;
  2293. ret = i;
  2294. }
  2295. else
  2296. {
  2297. int i = 1;
  2298. ret = i;
  2299. }
  2300. if (false)
  2301. {
  2302. int i = 1;
  2303. ret = i;
  2304. }
  2305. else
  2306. {
  2307. int i = ret;
  2308. ret = i;
  2309. }
  2310. return (ret);
  2311. }
  2312. public static bool testMethod()
  2313. {
  2314. return (Main_old(null) == 0);
  2315. }
  2316. }
  2317. public class Statements_TestClass_if_009
  2318. {
  2319. public static int Main_old(string[] args)
  2320. {
  2321. int ret = 1; // default to fail
  2322. if (true)
  2323. if (false)
  2324. return (1);
  2325. else // if this else if associated with the 1st if, it won't execute.
  2326. ret = 0;
  2327. return (ret);
  2328. }
  2329. public static bool testMethod()
  2330. {
  2331. return (Main_old(null) == 0);
  2332. }
  2333. }
  2334. public class Statements_TestClass_switch_001
  2335. {
  2336. public static int Main_old(string[] args)
  2337. {
  2338. switch (true)
  2339. {
  2340. }
  2341. return (0);
  2342. }
  2343. public static bool testMethod()
  2344. {
  2345. return (Main_old(null) == 0);
  2346. }
  2347. }
  2348. public class Statements_TestClass_switch_002
  2349. {
  2350. public static int Main_old(string[] args)
  2351. {
  2352. int ret = 1;
  2353. switch (true)
  2354. {
  2355. default:
  2356. ret = 0;
  2357. break;
  2358. }
  2359. return (ret);
  2360. }
  2361. public static bool testMethod()
  2362. {
  2363. return (Main_old(null) == 0);
  2364. }
  2365. }
  2366. public class Statements_TestClass_switch_003
  2367. {
  2368. public static int Main_old(string[] args)
  2369. {
  2370. int ret = 1;
  2371. switch (true)
  2372. {
  2373. case true:
  2374. ret = 0;
  2375. break;
  2376. }
  2377. return (ret);
  2378. }
  2379. public static bool testMethod()
  2380. {
  2381. return (Main_old(null) == 0);
  2382. }
  2383. }
  2384. public class Statements_TestClass_switch_004
  2385. {
  2386. public static int Main_old(string[] args)
  2387. {
  2388. int ret = 1;
  2389. switch (true)
  2390. {
  2391. case true:
  2392. ret = 0;
  2393. break;
  2394. }
  2395. return (ret);
  2396. }
  2397. public static bool testMethod()
  2398. {
  2399. return (Main_old(null) == 0);
  2400. }
  2401. }
  2402. public class Statements_TestClass_switch_005
  2403. {
  2404. public static int Main_old(string[] args)
  2405. {
  2406. int ret = 1;
  2407. switch (true)
  2408. {
  2409. case true:
  2410. ret = 0;
  2411. break;
  2412. case false:
  2413. ret = 1;
  2414. break;
  2415. }
  2416. return (ret);
  2417. }
  2418. public static bool testMethod()
  2419. {
  2420. return (Main_old(null) == 0);
  2421. }
  2422. }
  2423. public class Statements_TestClass_switch_006
  2424. {
  2425. public static int Main_old(string[] args)
  2426. {
  2427. int ret = 1;
  2428. switch (false)
  2429. {
  2430. default:
  2431. ret = 0;
  2432. break;
  2433. case true:
  2434. ret = 1;
  2435. }
  2436. return (ret);
  2437. }
  2438. public static bool testMethod()
  2439. {
  2440. return (Main_old(null) == 0);
  2441. }
  2442. }
  2443. public class Statements_TestClass_switch_007
  2444. {
  2445. public static int Main_old(string[] args)
  2446. {
  2447. int ret = 1;
  2448. switch (23)
  2449. {
  2450. default:
  2451. ret = 0;
  2452. break;
  2453. case 1:
  2454. ret = 1;
  2455. break;
  2456. case -2:
  2457. ret = 1;
  2458. break;
  2459. }
  2460. return (ret);
  2461. }
  2462. public static bool testMethod()
  2463. {
  2464. return (Main_old(null) == 0);
  2465. }
  2466. }
  2467. public class Statements_TestClass_switch_010
  2468. {
  2469. public static int Main_old(string[] args)
  2470. {
  2471. int ret = 1;
  2472. int value = 23;
  2473. switch (value)
  2474. {
  2475. case kValue:
  2476. ret = 0;
  2477. break;
  2478. default:
  2479. ret = 1;
  2480. break;
  2481. }
  2482. return (ret);
  2483. }
  2484. const int kValue = 23;
  2485. public static bool testMethod()
  2486. {
  2487. return (Main_old(null) == 0);
  2488. }
  2489. }
  2490. public class Statements_TestClass_switch_012
  2491. {
  2492. public static int Main_old(string[] args)
  2493. {
  2494. int ret = 3;
  2495. for (int i = 0; i < 3; i++)
  2496. {
  2497. switch (i)
  2498. {
  2499. case 1:
  2500. case 0:
  2501. case 2:
  2502. ret--;
  2503. break;
  2504. default:
  2505. return (1);
  2506. }
  2507. }
  2508. return (ret);
  2509. }
  2510. public static bool testMethod()
  2511. {
  2512. return (Main_old(null) == 0);
  2513. }
  2514. }
  2515. public class Statements_TestClass_switch_013
  2516. {
  2517. public static int Main_old(string[] args)
  2518. {
  2519. int ret = 6;
  2520. switch (ret)
  2521. {
  2522. case 0:
  2523. ret--; // 2
  2524. Log.Comment("case 0: ");
  2525. Log.Comment(ret.ToString());
  2526. goto case 9999;
  2527. case 2:
  2528. ret--; // 4
  2529. Log.Comment("case 2: ");
  2530. Log.Comment(ret.ToString());
  2531. goto case 255;
  2532. case 6: // start here
  2533. ret--; // 5
  2534. Log.Comment("case 5: ");
  2535. Log.Comment(ret.ToString());
  2536. goto case 2;
  2537. case 9999:
  2538. ret--; // 1
  2539. Log.Comment("case 9999: ");
  2540. Log.Comment(ret.ToString());
  2541. goto default;
  2542. case 0xff:
  2543. ret--; // 3
  2544. Log.Comment("case 0xff: ");
  2545. Log.Comment(ret.ToString());
  2546. goto case 0;
  2547. default:
  2548. ret--;
  2549. Log.Comment("Default: ");
  2550. Log.Comment(ret.ToString());
  2551. if (ret > 0)
  2552. {
  2553. goto case -1;
  2554. }
  2555. break;
  2556. case -1:
  2557. ret = 999;
  2558. Log.Comment("case -1: ");
  2559. Log.Comment(ret.ToString());
  2560. break;
  2561. }
  2562. return (ret);
  2563. }
  2564. public static bool testMethod()
  2565. {
  2566. return (Main_old(null) == 0);
  2567. }
  2568. }
  2569. public class Statements_TestClass_switch_015
  2570. {
  2571. public static int Main_old(string[] args)
  2572. {
  2573. int ret = 0;
  2574. ret = DoByte();
  2575. return (ret);
  2576. }
  2577. private static int DoByte()
  2578. {
  2579. int ret = 2;
  2580. byte b = 2;
  2581. switch (b)
  2582. {
  2583. case 1:
  2584. case 2:
  2585. ret--;
  2586. break;
  2587. case 3:
  2588. break;
  2589. default:
  2590. break;
  2591. }
  2592. switch (b)
  2593. {
  2594. case 1:
  2595. case 3:
  2596. break;
  2597. default:
  2598. ret--;
  2599. break;
  2600. }
  2601. if (ret > 0)
  2602. Log.Comment("byte failed");
  2603. return (ret);
  2604. }
  2605. public static bool testMethod()
  2606. {
  2607. return (Main_old(null) == 0);
  2608. }
  2609. }
  2610. public class Statements_TestClass_switch_016
  2611. {
  2612. public static int Main_old(string[] args)
  2613. {
  2614. int ret = 0;
  2615. ret = DoChar();
  2616. return (ret);
  2617. }
  2618. private static int DoChar()
  2619. {
  2620. int ret = 2;
  2621. char c = '2';
  2622. switch (c)
  2623. {
  2624. case '1':
  2625. case '2':
  2626. ret--;
  2627. break;
  2628. case '3':
  2629. break;
  2630. default:
  2631. break;
  2632. }
  2633. switch (c)
  2634. {
  2635. case '1':
  2636. case '3':
  2637. break;
  2638. default:
  2639. ret--;
  2640. break;
  2641. }
  2642. if (ret > 0)
  2643. Log.Comment("char failed");
  2644. return (ret);
  2645. }
  2646. public static bool testMethod()
  2647. {
  2648. return (Main_old(null) == 0);
  2649. }
  2650. }
  2651. public class Statements_TestClass_switch_017
  2652. {
  2653. public static int Main_old(string[] args)
  2654. {
  2655. int ret = 0;
  2656. ret = DoShort();
  2657. return (ret);
  2658. }
  2659. private static int DoShort()
  2660. {
  2661. int ret = 2;
  2662. short s = 0x7fff;
  2663. switch (s)
  2664. {
  2665. case 1:
  2666. case 32767:
  2667. ret--;
  2668. break;
  2669. case -1:
  2670. break;
  2671. default:
  2672. break;
  2673. }
  2674. switch (s)
  2675. {
  2676. case 1:
  2677. case -1:
  2678. break;
  2679. default:
  2680. ret--;
  2681. break;
  2682. }
  2683. if (ret > 0)
  2684. Log.Comment("short failed");
  2685. return (ret);
  2686. }
  2687. public static bool testMethod()
  2688. {
  2689. return (Main_old(null) == 0);
  2690. }
  2691. }
  2692. public class Statements_TestClass_switch_018
  2693. {
  2694. public static int Main_old(string[] args)
  2695. {
  2696. int ret = 0;
  2697. ret = DoInt();
  2698. return (ret);
  2699. }
  2700. private static int DoInt()
  2701. {
  2702. int ret = 2;
  2703. int i = 0x7fffffff;
  2704. switch (i)
  2705. {
  2706. case 1:
  2707. case 2147483647:
  2708. ret--;
  2709. break;
  2710. case -1:
  2711. break;
  2712. default:
  2713. break;
  2714. }
  2715. switch (i)
  2716. {
  2717. case 1:
  2718. case -1:
  2719. break;
  2720. default:
  2721. ret--;
  2722. break;
  2723. }
  2724. if (ret > 0)
  2725. Log.Comment("int failed");
  2726. return (ret);
  2727. }
  2728. public static bool testMethod()
  2729. {
  2730. return (Main_old(null) == 0);
  2731. }
  2732. }
  2733. public class Statements_TestClass_switch_019
  2734. {
  2735. public static int Main_old(string[] args)
  2736. {
  2737. int ret = 0;
  2738. ret = DoLong();
  2739. return (ret);
  2740. }
  2741. private static int DoLong()
  2742. {
  2743. int ret = 2;
  2744. long l = 0x7fffffffffffffffL;
  2745. switch (l)
  2746. {
  2747. case 1L:
  2748. case 9223372036854775807L:
  2749. ret--;
  2750. break;
  2751. case -1L:
  2752. break;
  2753. default:
  2754. break;
  2755. }
  2756. switch (l)
  2757. {
  2758. case 1L:
  2759. case -1L:
  2760. break;
  2761. default:
  2762. ret--;
  2763. break;
  2764. }
  2765. if (ret > 0)
  2766. Log.Comment("long failed");
  2767. return (ret);
  2768. }
  2769. public static bool testMethod()
  2770. {
  2771. return (Main_old(null) == 0);
  2772. }
  2773. }
  2774. public class Statements_TestClass_switch_023
  2775. {
  2776. enum eTypes
  2777. {
  2778. kFirst,
  2779. kSecond,
  2780. kThird,
  2781. };
  2782. public static int Main_old(string[] args)
  2783. {
  2784. int ret = 0;
  2785. ret = DoEnum();
  2786. return (ret);
  2787. }
  2788. private static int DoEnum()
  2789. {
  2790. int ret = 2;
  2791. eTypes e = eTypes.kSecond;
  2792. switch (e)
  2793. {
  2794. case eTypes.kThird:
  2795. case eTypes.kSecond:
  2796. ret--;
  2797. break;
  2798. case (eTypes)(-1):
  2799. break;
  2800. default:
  2801. break;
  2802. }
  2803. switch (e)
  2804. {
  2805. case (eTypes)100:
  2806. case (eTypes)(-1):
  2807. break;
  2808. default:
  2809. ret--;
  2810. break;
  2811. }
  2812. if (ret > 0)
  2813. Log.Comment("enum failed");
  2814. return (ret);
  2815. }
  2816. public static bool testMethod()
  2817. {
  2818. return (Main_old(null) == 0);
  2819. }
  2820. }
  2821. public class Statements_TestClass_switch_030
  2822. {
  2823. public static int Main_old(string[] args)
  2824. {
  2825. int i = 5;
  2826. switch (i)
  2827. {
  2828. case (int)5.0f:
  2829. return 0;
  2830. default:
  2831. return 1;
  2832. }
  2833. }
  2834. public static bool testMethod()
  2835. {
  2836. return (Main_old(null) == 0);
  2837. }
  2838. }
  2839. public class Statements_TestClass_switch_031
  2840. {
  2841. public static int Main_old(string[] args)
  2842. {
  2843. int i = 5;
  2844. switch (i)
  2845. {
  2846. case 1:
  2847. case 2:
  2848. case 3:
  2849. return 1;
  2850. case 1001:
  2851. case 1002:
  2852. case 1003:
  2853. return 2;
  2854. }
  2855. return 0;
  2856. }
  2857. public static bool testMethod()
  2858. {
  2859. return (Main_old(null) == 0);
  2860. }
  2861. }
  2862. public class Statements_TestClass_switch_032
  2863. {
  2864. public static int Main_old(string[] args)
  2865. {
  2866. string s = "hello";
  2867. switch (s)
  2868. {
  2869. default:
  2870. return 1;
  2871. case null:
  2872. return 1;
  2873. case "hello":
  2874. return 0;
  2875. }
  2876. return 1;
  2877. }
  2878. public static bool testMethod()
  2879. {
  2880. return (Main_old(null) == 0);
  2881. }
  2882. }
  2883. public class Statements_TestClass_switch_033
  2884. {
  2885. public static int Main_old(string[] args)
  2886. {
  2887. string s = "hello";
  2888. switch (s)
  2889. {
  2890. case null:
  2891. return 1;
  2892. default:
  2893. return 1;
  2894. case "hello":
  2895. return 0;
  2896. }
  2897. return 1;
  2898. }
  2899. public static bool testMethod()
  2900. {
  2901. return (Main_old(null) == 0);
  2902. }
  2903. }
  2904. public class Statements_TestClass_switch_034
  2905. {
  2906. public static implicit operator int(Statements_TestClass_switch_034 val)
  2907. {
  2908. return 1;
  2909. }
  2910. public static implicit operator float(Statements_TestClass_switch_034 val)
  2911. {
  2912. return 2.1f;
  2913. }
  2914. public static int Main_old(string[] args)
  2915. {
  2916. Statements_TestClass_switch_034 t = new Statements_TestClass_switch_034();
  2917. switch (t)
  2918. {
  2919. case 1:
  2920. Log.Comment("a");
  2921. return 0;
  2922. default:
  2923. return 1;
  2924. }
  2925. }
  2926. public static bool testMethod()
  2927. {
  2928. return (Main_old(null) == 0);
  2929. }
  2930. }
  2931. class Statements_TestClass_switch_035
  2932. {
  2933. public sbyte x;
  2934. public Statements_TestClass_switch_035(sbyte i)
  2935. {
  2936. x = i;
  2937. }
  2938. public static implicit operator sbyte(Statements_TestClass_switch_035 C)
  2939. {
  2940. return C.x;
  2941. }
  2942. public static int Main_old()
  2943. {
  2944. Statements_TestClass_switch_035 C = new Statements_TestClass_switch_035(12);
  2945. switch (C)
  2946. {
  2947. case 12: return 0;
  2948. default: return 1;
  2949. }
  2950. }
  2951. public static bool testMethod()
  2952. {
  2953. return (Main_old() == 0);
  2954. }
  2955. }
  2956. class Statements_TestClass_switch_036
  2957. {
  2958. public byte x;
  2959. public Statements_TestClass_switch_036(byte i)
  2960. {
  2961. x = i;
  2962. }
  2963. public static implicit operator byte(Statements_TestClass_switch_036 C)
  2964. {
  2965. return C.x;
  2966. }
  2967. public static int Main_old()
  2968. {
  2969. Statements_TestClass_switch_036 C = new Statements_TestClass_switch_036(12);
  2970. switch (C)
  2971. {
  2972. case 12: return 0;
  2973. default: return 1;
  2974. }
  2975. }
  2976. public static bool testMethod()
  2977. {
  2978. return (Main_old() == 0);
  2979. }
  2980. }
  2981. class Statements_TestClass_switch_037
  2982. {
  2983. public short x;
  2984. public Statements_TestClass_switch_037(short i)
  2985. {
  2986. x = i;
  2987. }
  2988. public static implicit operator short(Statements_TestClass_switch_037 C)
  2989. {
  2990. return C.x;
  2991. }
  2992. public static int Main_old()
  2993. {
  2994. Statements_TestClass_switch_037 C = new Statements_TestClass_switch_037(12);
  2995. switch (C)
  2996. {
  2997. case 12: return 0;
  2998. default: return 1;
  2999. }
  3000. }
  3001. public static bool testMethod()
  3002. {
  3003. return (Main_old() == 0);
  3004. }
  3005. }
  3006. class Statements_TestClass_switch_038
  3007. {
  3008. public ushort x;
  3009. public Statements_TestClass_switch_038(ushort i)
  3010. {
  3011. x = i;
  3012. }
  3013. public static implicit operator ushort(Statements_TestClass_switch_038 C)
  3014. {
  3015. return C.x;
  3016. }
  3017. public static int Main_old()
  3018. {
  3019. Statements_TestClass_switch_038 C = new Statements_TestClass_switch_038(12);
  3020. switch (C)
  3021. {
  3022. case 12: return 0;
  3023. default: return 1;
  3024. }
  3025. }
  3026. public static bool testMethod()
  3027. {
  3028. return (Main_old() == 0);
  3029. }
  3030. }
  3031. class Statements_TestClass_switch_039
  3032. {
  3033. public int x;
  3034. public Statements_TestClass_switch_039(int i)
  3035. {
  3036. x = i;
  3037. }
  3038. public static implicit operator int(Statements_TestClass_switch_039 C)
  3039. {
  3040. return C.x;
  3041. }
  3042. public static int Main_old()
  3043. {
  3044. Statements_TestClass_switch_039 C = new Statements_TestClass_switch_039(12);
  3045. switch (C)
  3046. {
  3047. case 12: return 0;
  3048. default: return 1;
  3049. }
  3050. }
  3051. public static bool testMethod()
  3052. {
  3053. return (Main_old() == 0);
  3054. }
  3055. }
  3056. class Statements_TestClass_switch_040
  3057. {
  3058. public uint x;
  3059. public Statements_TestClass_switch_040(uint i)
  3060. {
  3061. x = i;
  3062. }
  3063. public static implicit operator uint(Statements_TestClass_switch_040 C)
  3064. {
  3065. return C.x;
  3066. }
  3067. public static int Main_old()
  3068. {
  3069. Statements_TestClass_switch_040 C = new Statements_TestClass_switch_040(12);
  3070. switch (C)
  3071. {
  3072. case 12: return 0;
  3073. default: return 1;
  3074. }
  3075. }
  3076. public static bool testMethod()
  3077. {
  3078. return (Main_old() == 0);
  3079. }
  3080. }
  3081. class Statements_TestClass_switch_041
  3082. {
  3083. public long x;
  3084. public Statements_TestClass_switch_041(long i)
  3085. {
  3086. x = i;
  3087. }
  3088. public static implicit operator long(Statements_TestClass_switch_041 C)
  3089. {
  3090. return C.x;
  3091. }
  3092. public static int Main_old()
  3093. {
  3094. Statements_TestClass_switch_041 C = new Statements_TestClass_switch_041(12);
  3095. switch (C)
  3096. {
  3097. case 12: return 0;
  3098. default: return 1;
  3099. }
  3100. }
  3101. public static bool testMethod()
  3102. {
  3103. return (Main_old() == 0);
  3104. }
  3105. }
  3106. class Statements_TestClass_switch_042
  3107. {
  3108. public ulong x;
  3109. public Statements_TestClass_switch_042(ulong i)
  3110. {
  3111. x = i;
  3112. }
  3113. public static implicit operator ulong(Statements_TestClass_switch_042 C)
  3114. {
  3115. return C.x;
  3116. }
  3117. public static int Main_old()
  3118. {
  3119. Statements_TestClass_switch_042 C = new Statements_TestClass_switch_042(12);
  3120. switch (C)
  3121. {
  3122. case 12: return 0;
  3123. default: return 1;
  3124. }
  3125. }
  3126. public static bool testMethod()
  3127. {
  3128. return (Main_old() == 0);
  3129. }
  3130. }
  3131. class Statements_TestClass_switch_044
  3132. {
  3133. public static implicit operator string(Statements_TestClass_switch_044 C)
  3134. {
  3135. return "true";
  3136. }
  3137. public static int Main_old()
  3138. {
  3139. Statements_TestClass_switch_044 C = new Statements_TestClass_switch_044();
  3140. switch (C)
  3141. {
  3142. case "true": return 0;
  3143. default: return 1;
  3144. }
  3145. }
  3146. public static bool testMethod()
  3147. {
  3148. return (Main_old() == 0);
  3149. }
  3150. }
  3151. class X { }
  3152. class Statements_TestClass_switch_047
  3153. {
  3154. public static implicit operator int(Statements_TestClass_switch_047 C)
  3155. {
  3156. return 1;
  3157. }
  3158. public static implicit operator X(Statements_TestClass_switch_047 C)
  3159. {
  3160. return new X();
  3161. }
  3162. public static int Main_old()
  3163. {
  3164. Statements_TestClass_switch_047 C = new Statements_TestClass_switch_047();
  3165. switch (C)
  3166. {
  3167. case 1: return 0;
  3168. default: return 1;
  3169. }
  3170. }
  3171. public static bool testMethod()
  3172. {
  3173. return (Main_old() == 0);
  3174. }
  3175. }
  3176. class Statements_TestClass_switch_049
  3177. {
  3178. public static int Main_old()
  3179. {
  3180. int i = 6;
  3181. switch (i) { } // CS1522
  3182. return 0;
  3183. }
  3184. public static bool testMethod()
  3185. {
  3186. return (Main_old() == 0);
  3187. }
  3188. }
  3189. public class Statements_TestClass_switch_string_001
  3190. {
  3191. public static int Main_old(string[] args)
  3192. {
  3193. string s = null;
  3194. switch (s)
  3195. {
  3196. case null:
  3197. Log.Comment("null");
  3198. return 0;
  3199. default:
  3200. return 1;
  3201. }
  3202. }
  3203. public static bool testMethod()
  3204. {
  3205. return (Main_old(null) == 0);
  3206. }
  3207. }
  3208. public class Statements_TestClass_dowhile_001
  3209. {
  3210. public static int Main_old(string[] args)
  3211. {
  3212. int i = 0;
  3213. int j = 10;
  3214. // post decrement test as well
  3215. do
  3216. i++;
  3217. while (--j > 0);
  3218. if (i == 10)
  3219. return (0);
  3220. return (1);
  3221. }
  3222. public static bool testMethod()
  3223. {
  3224. return (Main_old(null) == 0);
  3225. }
  3226. }
  3227. public class Statements_TestClass_dowhile_002
  3228. {
  3229. public static int Main_old(string[] args)
  3230. {
  3231. int i = 0;
  3232. int j = 10;
  3233. // post decrement test as well
  3234. do
  3235. {
  3236. j--;
  3237. i++;
  3238. } while (j > 0);
  3239. if (i == 10)
  3240. return (0);
  3241. return (1);
  3242. }
  3243. public static bool testMethod()
  3244. {
  3245. return (Main_old(null) == 0);
  3246. }
  3247. }
  3248. public class Statements_TestClass_dowhile_003
  3249. {
  3250. public static int Main_old(string[] args)
  3251. {
  3252. bool bFalse = false;
  3253. int ret = 1;
  3254. do
  3255. ret--;
  3256. while (bFalse);
  3257. return (ret);
  3258. }
  3259. public static bool testMethod()
  3260. {
  3261. return (Main_old(null) == 0);
  3262. }
  3263. }
  3264. public class Statements_TestClass_dowhile_004
  3265. {
  3266. public static int Main_old(string[] args)
  3267. {
  3268. bool bTrue = true;
  3269. do
  3270. return (0);
  3271. while (bTrue);
  3272. return (1);
  3273. }
  3274. public static bool testMethod()
  3275. {
  3276. return (Main_old(null) == 0);
  3277. }
  3278. }
  3279. public class Statements_TestClass_dowhile_005
  3280. {
  3281. public static int Main_old(string[] args)
  3282. {
  3283. bool bFalse = false;
  3284. int ret = 1;
  3285. do
  3286. {
  3287. Log.Comment("Hello World");
  3288. ret--;
  3289. } while (bFalse);
  3290. return (ret);
  3291. }
  3292. public static bool testMethod()
  3293. {
  3294. return (Main_old(null) == 0);
  3295. }
  3296. }
  3297. public class Statements_TestClass_dowhile_006
  3298. {
  3299. public static int Main_old(string[] args)
  3300. {
  3301. bool bTrue = true;
  3302. do
  3303. {
  3304. Log.Comment("Hello World");
  3305. return (0);
  3306. } while (bTrue);
  3307. return (1);
  3308. }
  3309. public static bool testMethod()
  3310. {
  3311. return (Main_old(null) == 0);
  3312. }
  3313. }
  3314. public class Statements_TestClass_for_001
  3315. {
  3316. public static int Main_old(string[] args)
  3317. {
  3318. for (; ; )
  3319. return (0);
  3320. return (1);
  3321. }
  3322. public static bool testMethod()
  3323. {
  3324. return (Main_old(null) == 0);
  3325. }
  3326. }
  3327. public class Statements_TestClass_for_003
  3328. {
  3329. public static int Main_old(string[] args)
  3330. {
  3331. int i = 0;
  3332. int ret = 10;
  3333. for (; i < 10; i++)
  3334. ret--;
  3335. return (ret);
  3336. }
  3337. public static bool testMethod()
  3338. {
  3339. return (Main_old(null) == 0);
  3340. }
  3341. }
  3342. public class Statements_TestClass_for_004
  3343. {
  3344. public static int Main_old(string[] args)
  3345. {
  3346. for (int i = 0; i < 10; )
  3347. i++;
  3348. return (0);
  3349. }
  3350. public static bool testMethod()
  3351. {
  3352. return (Main_old(null) == 0);
  3353. }
  3354. }
  3355. public class Statements_TestClass_for_006
  3356. {
  3357. public static int Main_old(string[] args)
  3358. {
  3359. int ret = 10;
  3360. for (int i = 0; i < 10; i++)
  3361. ret--;
  3362. return (ret);
  3363. }
  3364. public static bool testMethod()
  3365. {
  3366. return (Main_old(null) == 0);
  3367. }
  3368. }
  3369. public class Statements_TestClass_for_007
  3370. {
  3371. public static int Main_old(string[] args)
  3372. {
  3373. int ret1 = 10;
  3374. int ret2 = -10;
  3375. for (int i = 0; i < 10; i++)
  3376. {
  3377. ret1--;
  3378. ret2++;
  3379. }
  3380. return (ret1 | ret2); // bit or
  3381. }
  3382. public static bool testMethod()
  3383. {
  3384. return (Main_old(null) == 0);
  3385. }
  3386. }
  3387. public class Statements_TestClass_for_008
  3388. {
  3389. public static int Main_old(string[] args)
  3390. {
  3391. int ret1 = 10;
  3392. int ret2 = 0;
  3393. for (int i = 0, j = -10; i < 10; i++)
  3394. {
  3395. ret1--;
  3396. j++;
  3397. ret2 = j;
  3398. }
  3399. return (ret1 | ret2); // bit or
  3400. }
  3401. public static bool testMethod()
  3402. {
  3403. return (Main_old(null) == 0);
  3404. }
  3405. }
  3406. public class Statements_TestClass_for_009
  3407. {
  3408. public static int Main_old(string[] args)
  3409. {
  3410. int ret = 10;
  3411. int i, j, k;
  3412. for (i = 0, j = i + 1, k = j + 1; i < 10; i++)
  3413. {
  3414. ret--;
  3415. k++;
  3416. j++;
  3417. }
  3418. if (i + 1 != j)
  3419. {
  3420. Log.Comment("Failure: i + 1 != j");
  3421. return (1);
  3422. }
  3423. if (j + 1 != k)
  3424. {
  3425. Log.Comment("Failure: j + 1 != k");
  3426. return (1);
  3427. }
  3428. return (ret);
  3429. }
  3430. public static bool testMethod()
  3431. {
  3432. return (Main_old(null) == 0);
  3433. }
  3434. }
  3435. public class Statements_TestClass_for_010
  3436. {
  3437. public static int Main_old(string[] args)
  3438. {
  3439. int ret = 10;
  3440. int i, j = 1, k = 2;
  3441. for (i = 0; i < 10; i++, j++, k++)
  3442. {
  3443. ret--;
  3444. }
  3445. if (i + 1 != j)
  3446. {
  3447. Log.Comment("Failure: i + 1 != j");
  3448. return (1);
  3449. }
  3450. if (j + 1 != k)
  3451. {
  3452. Log.Comment("Failure: j + 1 != k");
  3453. return (1);
  3454. }
  3455. return (ret);
  3456. }
  3457. public static bool testMethod()
  3458. {
  3459. return (Main_old(null) == 0);
  3460. }
  3461. }
  3462. public class Statements_TestClass_for_011
  3463. {
  3464. public static int Main_old(string[] args)
  3465. {
  3466. int ret = 10;
  3467. int i, j, k = 2;
  3468. for (i = 0, j = i + 1; i < 10; i++, k++)
  3469. {
  3470. ret--;
  3471. j++;
  3472. }
  3473. if (i + 1 != j)
  3474. {
  3475. Log.Comment("Failure: i + 1 != j");
  3476. return (1);
  3477. }
  3478. if (j + 1 != k)
  3479. {
  3480. Log.Comment("Failure: j + 1 != k");
  3481. return (1);
  3482. }
  3483. return (ret);
  3484. }
  3485. public static bool testMethod()
  3486. {
  3487. return (Main_old(null) == 0);
  3488. }
  3489. }
  3490. public class Statements_TestClass_for_013
  3491. {
  3492. public static int Main_old(string[] args)
  3493. {
  3494. int ret = 0;
  3495. for (; false; ret++)
  3496. ;
  3497. return (ret);
  3498. }
  3499. public static bool testMethod()
  3500. {
  3501. return (Main_old(null) == 0);
  3502. }
  3503. }
  3504. public class Statements_TestClass_for_014
  3505. {
  3506. public static int Main_old(string[] args)
  3507. {
  3508. int ret = 10;
  3509. for (Initializer(); Conditional(); Iterator())
  3510. ret = Body(ret);
  3511. return (ret);
  3512. }
  3513. public static int Initializer()
  3514. {
  3515. m_i = 0;
  3516. return (0);
  3517. }
  3518. public static bool Conditional()
  3519. {
  3520. return (m_i < 10);
  3521. }
  3522. public static void Iterator()
  3523. {
  3524. m_i++;
  3525. }
  3526. public static int Body(int ret)
  3527. {
  3528. return (--ret);
  3529. }
  3530. private static int m_i;
  3531. public static bool testMethod()
  3532. {
  3533. return (Main_old(null) == 0);
  3534. }
  3535. }
  3536. public class Statements_TestClass_char_in_string_s01
  3537. {
  3538. public static int Main_old()
  3539. {
  3540. String Str = new String('\0', 1024);
  3541. int i = 0;
  3542. foreach (char C in Str)
  3543. {
  3544. i++;
  3545. if (C != '\0')
  3546. return 1;
  3547. }
  3548. return 0;
  3549. }
  3550. public static bool testMethod()
  3551. {
  3552. return (Main_old() == 0);
  3553. }
  3554. }
  3555. public class Statements_TestClass_char_in_string_ex01
  3556. {
  3557. public static int Main_old()
  3558. {
  3559. String Str = null;
  3560. try
  3561. {
  3562. foreach (char C in Str)
  3563. {
  3564. return 1;
  3565. Log.Comment("Fail");
  3566. }
  3567. }
  3568. catch (System.Exception)
  3569. {
  3570. return 0;
  3571. }
  3572. return 1;
  3573. }
  3574. public static bool testMethod()
  3575. {
  3576. return (Main_old() == 0);
  3577. }
  3578. }
  3579. public class Statements_TestClass_while_001
  3580. {
  3581. public static int Main_old(string[] args)
  3582. {
  3583. int i = 0;
  3584. int j = 10;
  3585. // post decrement test as well
  3586. while (j-- > 0)
  3587. i++;
  3588. if (i == 10)
  3589. return (0);
  3590. return (1);
  3591. }
  3592. public static bool testMethod()
  3593. {
  3594. return (Main_old(null) == 0);
  3595. }
  3596. }
  3597. public class Statements_TestClass_while_002
  3598. {
  3599. public static int Main_old(string[] args)
  3600. {
  3601. int i = 0;
  3602. int j = 10;
  3603. // post decrement test as well
  3604. while (j > 0)
  3605. {
  3606. j--;
  3607. i++;
  3608. }
  3609. if (i == 10)
  3610. return (0);
  3611. return (1);
  3612. }
  3613. public static bool testMethod()
  3614. {
  3615. return (Main_old(null) == 0);
  3616. }
  3617. }
  3618. public class Statements_TestClass_while_003
  3619. {
  3620. public static int Main_old(string[] args)
  3621. {
  3622. bool bFalse = false;
  3623. while (bFalse)
  3624. return (1);
  3625. return (0);
  3626. }
  3627. public static bool testMethod()
  3628. {
  3629. return (Main_old(null) == 0);
  3630. }
  3631. }
  3632. public class Statements_TestClass_while_004
  3633. {
  3634. public static int Main_old(string[] args)
  3635. {
  3636. bool bTrue = true;
  3637. while (bTrue)
  3638. return (0);
  3639. return (1);
  3640. }
  3641. public static bool testMethod()
  3642. {
  3643. return (Main_old(null) == 0);
  3644. }
  3645. }
  3646. public class Statements_TestClass_while_005
  3647. {
  3648. public static int Main_old(string[] args)
  3649. {
  3650. bool bFalse = false;
  3651. while (bFalse)
  3652. {
  3653. Log.Comment("Hello World");
  3654. return (1);
  3655. }
  3656. return (0);
  3657. }
  3658. public static bool testMethod()
  3659. {
  3660. return (Main_old(null) == 0);
  3661. }
  3662. }
  3663. public class Statements_TestClass_while_006
  3664. {
  3665. public static int Main_old(string[] args)
  3666. {
  3667. bool bTrue = true;
  3668. while (bTrue)
  3669. {
  3670. Log.Comment("Hello World");
  3671. return (0);
  3672. }
  3673. return (1);
  3674. }
  3675. public static bool testMethod()
  3676. {
  3677. return (Main_old(null) == 0);
  3678. }
  3679. }
  3680. public class Statements_TestClass_break_001
  3681. {
  3682. public static int Main_old(string[] args)
  3683. {
  3684. while (true)
  3685. break;
  3686. do
  3687. break;
  3688. while (true);
  3689. for (; true; )
  3690. break;
  3691. int[] iArr = new int[20];
  3692. foreach (int i in iArr)
  3693. break;
  3694. return (0);
  3695. }
  3696. public static bool testMethod()
  3697. {
  3698. return (Main_old(null) == 0);
  3699. }
  3700. }
  3701. public class Statements_TestClass_break_002
  3702. {
  3703. public static int Main_old(string[] args)
  3704. {
  3705. int ret = 0;
  3706. while (true)
  3707. {
  3708. break;
  3709. ret++;
  3710. }
  3711. do
  3712. {
  3713. break;
  3714. ret++;
  3715. } while (true);
  3716. for (; true; )
  3717. {
  3718. break;
  3719. ret++;
  3720. }
  3721. int[] iArr = new int[20];
  3722. foreach (int i in iArr)
  3723. {
  3724. break;
  3725. ret++;
  3726. }
  3727. return (ret);
  3728. }
  3729. public static bool testMethod()
  3730. {
  3731. return (Main_old(null) == 0);
  3732. }
  3733. }
  3734. public class Statements_TestClass_break_003
  3735. {
  3736. public static int Main_old(string[] args)
  3737. {
  3738. int ret = 1;
  3739. switch (ret)
  3740. {
  3741. case 1:
  3742. ret = 0;
  3743. break;
  3744. }
  3745. return (ret);
  3746. }
  3747. public static bool testMethod()
  3748. {
  3749. return (Main_old(null) == 0);
  3750. }
  3751. }
  3752. public class Statements_TestClass_break_006
  3753. {
  3754. public static int Main_old(string[] args)
  3755. {
  3756. int ret = 0;
  3757. while (true)
  3758. {
  3759. if (ret == 0)
  3760. break;
  3761. ret = 1;
  3762. }
  3763. return (ret);
  3764. }
  3765. public static bool testMethod()
  3766. {
  3767. return (Main_old(null) == 0);
  3768. }
  3769. }
  3770. public class Statements_TestClass_break_007
  3771. {
  3772. public static int Main_old(string[] args)
  3773. {
  3774. int ret = 0;
  3775. while (true)
  3776. {
  3777. if (ret == 0)
  3778. {
  3779. break;
  3780. ret = 1;
  3781. }
  3782. ret = 1;
  3783. }
  3784. return (ret);
  3785. }
  3786. public static bool testMethod()
  3787. {
  3788. return (Main_old(null) == 0);
  3789. }
  3790. }
  3791. public class Statements_TestClass_break_010
  3792. {
  3793. public static int Main_old(string[] args)
  3794. {
  3795. int ret = 3;
  3796. while (true)
  3797. {
  3798. do
  3799. {
  3800. for (ret--; true; ret--)
  3801. {
  3802. break;
  3803. }
  3804. ret--;
  3805. break;
  3806. } while (true);
  3807. ret--;
  3808. break;
  3809. }
  3810. return (ret);
  3811. }
  3812. public static bool testMethod()
  3813. {
  3814. return (Main_old(null) == 0);
  3815. }
  3816. }
  3817. public class Statements_TestClass_continue_001
  3818. {
  3819. public static int Main_old(string[] args)
  3820. {
  3821. int i = 5;
  3822. int ret = 0;
  3823. Log.Comment("Doing while");
  3824. while (--i != 0)
  3825. continue;
  3826. if (i != 0)
  3827. return (1);
  3828. Log.Comment("Doing do/while");
  3829. i = 5;
  3830. do
  3831. continue;
  3832. while (--i != 0);
  3833. if (i != 0)
  3834. return (1);
  3835. Log.Comment("Doing for");
  3836. for (i = 5; i != 0; i--)
  3837. continue;
  3838. int[] iArr = new int[20];
  3839. foreach (int i2 in iArr)
  3840. continue;
  3841. return (ret);
  3842. }
  3843. public static bool testMethod()
  3844. {
  3845. return (Main_old(null) == 0);
  3846. }
  3847. }
  3848. public class Statements_TestClass_continue_002
  3849. {
  3850. public static int Main_old(string[] args)
  3851. {
  3852. int i = 1;
  3853. int ret = 6;
  3854. Log.Comment(ret.ToString());
  3855. while (i-- > 0)
  3856. {
  3857. ret--;
  3858. continue;
  3859. ret--;
  3860. }
  3861. Log.Comment(ret.ToString());
  3862. i = 1;
  3863. do
  3864. {
  3865. ret--;
  3866. continue;
  3867. ret--;
  3868. } while (--i > 0);
  3869. Log.Comment(ret.ToString());
  3870. for (i = 1; i > 0; i--)
  3871. {
  3872. ret--;
  3873. continue;
  3874. ret--;
  3875. }
  3876. int[] iArr = new int[3];
  3877. i = 0;
  3878. Log.Comment(ret.ToString());
  3879. foreach (int i2 in iArr)
  3880. {
  3881. ret--;
  3882. continue;
  3883. ret--;
  3884. }
  3885. Log.Comment(ret.ToString());
  3886. return (ret);
  3887. }
  3888. public static bool testMethod()
  3889. {
  3890. return (Main_old(null) == 0);
  3891. }
  3892. }
  3893. public class Statements_TestClass_continue_006
  3894. {
  3895. public static int Main_old(string[] args)
  3896. {
  3897. int ret = 10;
  3898. while (ret > 0)
  3899. {
  3900. if (--ret >= 0)
  3901. continue;
  3902. return (1);
  3903. }
  3904. return (ret);
  3905. }
  3906. public static bool testMethod()
  3907. {
  3908. return (Main_old(null) == 0);
  3909. }
  3910. }
  3911. public class Statements_TestClass_continue_007
  3912. {
  3913. public static int Main_old(string[] args)
  3914. {
  3915. int ret = 1;
  3916. while (ret != 0)
  3917. {
  3918. if (ret == 1)
  3919. {
  3920. ret = 0;
  3921. continue;
  3922. ret = 1;
  3923. }
  3924. ret = 1;
  3925. }
  3926. return (ret);
  3927. }
  3928. public static bool testMethod()
  3929. {
  3930. return (Main_old(null) == 0);
  3931. }
  3932. }
  3933. public class Statements_TestClass_continue_010
  3934. {
  3935. public static int Main_old(string[] args)
  3936. {
  3937. int ret = 125;
  3938. int iWhile = 5, iDo = 5, iFor = 6;
  3939. while (iWhile-- > 0)
  3940. {
  3941. if (iDo != 5)
  3942. return (1);
  3943. do
  3944. {
  3945. if (iFor != 6)
  3946. return (1);
  3947. for (iFor--; iFor > 0; iFor--)
  3948. {
  3949. ret--;
  3950. continue;
  3951. return (1);
  3952. }
  3953. iFor = 6;
  3954. iDo--;
  3955. continue;
  3956. return (1);
  3957. } while (iDo > 0);
  3958. iDo = 5;
  3959. continue;
  3960. return (1);
  3961. }
  3962. return (ret);
  3963. }
  3964. public static bool testMethod()
  3965. {
  3966. return (Main_old(null) == 0);
  3967. }
  3968. }
  3969. public class Statements_TestClass_goto_001
  3970. {
  3971. public static int Main_old(string[] args)
  3972. {
  3973. goto Label2; // jump ahead
  3974. return (1);
  3975. Label1:
  3976. goto Label3; // end it
  3977. return (1);
  3978. Label2:
  3979. goto Label1; // jump backwards
  3980. return (1);
  3981. Label3:
  3982. return (0);
  3983. }
  3984. public static bool testMethod()
  3985. {
  3986. return (Main_old(null) == 0);
  3987. }
  3988. }
  3989. public class Statements_TestClass_goto_008
  3990. {
  3991. public static int Main_old(string[] args)
  3992. {
  3993. int s = 23;
  3994. int ret = 5;
  3995. switch (s)
  3996. {
  3997. case 21:
  3998. break;
  3999. case 23:
  4000. if (--ret > 0)
  4001. goto case 23;
  4002. break;
  4003. }
  4004. return (ret);
  4005. }
  4006. public static bool testMethod()
  4007. {
  4008. return (Main_old(null) == 0);
  4009. }
  4010. }
  4011. public class Statements_TestClass_goto_009
  4012. {
  4013. public static int Main_old(string[] args)
  4014. {
  4015. int ret = 6;
  4016. switch (32)
  4017. {
  4018. case 1:
  4019. if (--ret > 0)
  4020. {
  4021. Log.Comment("Case 1:" + ret.ToString());
  4022. goto case 32;
  4023. }
  4024. break;
  4025. case 32:
  4026. if (--ret > 0)
  4027. {
  4028. Log.Comment("Case 32:" + ret.ToString());
  4029. goto case 1;
  4030. }
  4031. break;
  4032. }
  4033. return (ret);
  4034. }
  4035. public static bool testMethod()
  4036. {
  4037. return (Main_old(null) == 0);
  4038. }
  4039. }
  4040. public class Statements_TestClass_goto_010
  4041. {
  4042. public static int Main_old(string[] args)
  4043. {
  4044. int s = 23;
  4045. int ret = 5;
  4046. switch (s)
  4047. {
  4048. case 21:
  4049. break;
  4050. default:
  4051. if (--ret > 0)
  4052. goto default;
  4053. break;
  4054. case 23:
  4055. goto default;
  4056. }
  4057. return (ret);
  4058. }
  4059. public static bool testMethod()
  4060. {
  4061. return (Main_old(null) == 0);
  4062. }
  4063. }
  4064. public class Statements_TestClass_goto_014
  4065. {
  4066. public static int Main_old(string[] args)
  4067. {
  4068. bool bLoopOnce = true;
  4069. int i = 0;
  4070. Top:
  4071. for (i = 0; i < 10; i++)
  4072. {
  4073. if (i > 5)
  4074. return (1);
  4075. if (i == 5)
  4076. goto LeaveFor;
  4077. }
  4078. LeaveFor:
  4079. i = 0;
  4080. do
  4081. {
  4082. if (++i > 5)
  4083. return (1);
  4084. if (i == 5)
  4085. {
  4086. goto LeaveDo;
  4087. }
  4088. } while (i < 10);
  4089. LeaveDo:
  4090. i = 0;
  4091. while (i < 10)
  4092. {
  4093. if (++i > 5)
  4094. return (1);
  4095. if (i == 5)
  4096. goto LeaveWhile;
  4097. }
  4098. LeaveWhile:
  4099. if (bLoopOnce)
  4100. {
  4101. bLoopOnce = !bLoopOnce;
  4102. while (true)
  4103. {
  4104. do
  4105. {
  4106. for (; ; )
  4107. {
  4108. goto Top;
  4109. }
  4110. } while (true);
  4111. }
  4112. }
  4113. return (0);
  4114. }
  4115. public static bool testMethod()
  4116. {
  4117. return (Main_old(null) == 0);
  4118. }
  4119. }
  4120. public class Statements_TestClass_goto_017
  4121. {
  4122. public static int Main_old(string[] args)
  4123. {
  4124. string target = "label1";
  4125. label1:
  4126. label2:
  4127. if (target == "label1")
  4128. {
  4129. target = "label2";
  4130. goto label1;
  4131. }
  4132. else if (target == "label2")
  4133. {
  4134. target = "exit";
  4135. goto label2;
  4136. }
  4137. return 0;
  4138. }
  4139. public static bool testMethod()
  4140. {
  4141. return (Main_old(null) == 0);
  4142. }
  4143. }
  4144. public class Statements_TestClass_goto_018
  4145. {
  4146. public static int Main_old(string[] args)
  4147. {
  4148. string target = "label1";
  4149. label1:
  4150. try
  4151. {
  4152. if (target == "label1")
  4153. {
  4154. target = "exit";
  4155. goto label1;
  4156. }
  4157. }
  4158. catch
  4159. {
  4160. }
  4161. finally
  4162. {
  4163. }
  4164. return 0;
  4165. }
  4166. public static bool testMethod()
  4167. {
  4168. return (Main_old(null) == 0);
  4169. }
  4170. }
  4171. public class Statements_TestClass_return_001
  4172. {
  4173. public static int Main_old(string[] args)
  4174. {
  4175. Statements_TestClass_return_001.sMethod();
  4176. Statements_TestClass_return_001 t = new Statements_TestClass_return_001();
  4177. t.Method();
  4178. return (0);
  4179. }
  4180. private static void sMethod()
  4181. {
  4182. return;
  4183. }
  4184. private void Method()
  4185. {
  4186. return;
  4187. }
  4188. public static bool testMethod()
  4189. {
  4190. return (Main_old(null) == 0);
  4191. }
  4192. }
  4193. public class Statements_TestClass_return_004
  4194. {
  4195. public static int Main_old(string[] args)
  4196. {
  4197. int i;
  4198. i = Statements_TestClass_return_004.sMethod();
  4199. Statements_TestClass_return_004.sMethod();
  4200. Statements_TestClass_return_004 t = new Statements_TestClass_return_004();
  4201. i = t.Method();
  4202. t.Method();
  4203. return(i == 0 ? 0 : 1);
  4204. }
  4205. private static int sMethod()
  4206. {
  4207. return (1);
  4208. }
  4209. private int Method()
  4210. {
  4211. return (0);
  4212. }
  4213. public static bool testMethod()
  4214. {
  4215. return (Main_old(null) == 0);
  4216. }
  4217. }
  4218. public class Statements_TestClass_return_006
  4219. {
  4220. public static int Main_old(string[] args)
  4221. {
  4222. int i;
  4223. i = Statements_TestClass_return_006.sMethod();
  4224. if (i != 0)
  4225. return(1);
  4226. Statements_TestClass_return_006 t = new Statements_TestClass_return_006();
  4227. i = t.Method();
  4228. return(i == 0 ? 0 : 1);
  4229. }
  4230. private static int sMethod()
  4231. {
  4232. short s = 0;
  4233. return (s);
  4234. }
  4235. private int Method()
  4236. {
  4237. short s = 0;
  4238. return (s);
  4239. }
  4240. public static bool testMethod()
  4241. {
  4242. return (Main_old(null) == 0);
  4243. }
  4244. }
  4245. public class Statements_TestClass_return_008
  4246. {
  4247. public static int Main_old(string[] args)
  4248. {
  4249. short s;
  4250. s = Statements_TestClass_return_008.sMethod();
  4251. if (s != 0)
  4252. return(1);
  4253. Statements_TestClass_return_008 t = new Statements_TestClass_return_008();
  4254. s = t.Method();
  4255. return(s == 0 ? 0 : 1);
  4256. }
  4257. private static short sMethod()
  4258. {
  4259. int i = 0;
  4260. return ((short)i);
  4261. }
  4262. private short Method()
  4263. {
  4264. int i = 0;
  4265. return ((short)i);
  4266. }
  4267. public static bool testMethod()
  4268. {
  4269. return (Main_old(null) == 0);
  4270. }
  4271. }
  4272. struct S
  4273. {
  4274. public int i;
  4275. public string s;
  4276. }
  4277. public class Statements_TestClass_return_009
  4278. {
  4279. public static int Main_old(string[] args)
  4280. {
  4281. S s;
  4282. s = Statements_TestClass_return_009.sMethod();
  4283. if (s.i.ToString().CompareTo(s.s) != 0) {
  4284. return(1);
  4285. }
  4286. Statements_TestClass_return_009.sMethod();
  4287. Statements_TestClass_return_009 t = new Statements_TestClass_return_009();
  4288. s = t.Method();
  4289. t.Method();
  4290. if (s.i.ToString().CompareTo(s.s) != 0) {
  4291. return(1);
  4292. }
  4293. return(s.i == 0 ? 0 : 1);
  4294. }
  4295. private static S sMethod()
  4296. {
  4297. S s;
  4298. s.i = 1;
  4299. s.s = s.i.ToString();
  4300. return (s);
  4301. }
  4302. private S Method()
  4303. {
  4304. S s;
  4305. s.i = 0;
  4306. s.s = s.i.ToString();
  4307. return (s);
  4308. }
  4309. public static bool testMethod()
  4310. {
  4311. return (Main_old(null) == 0);
  4312. }
  4313. }
  4314. class C
  4315. {
  4316. public int i;
  4317. public string s;
  4318. }
  4319. public class Statements_TestClass_return_010
  4320. {
  4321. public static int Main_old(string[] args)
  4322. {
  4323. C c;
  4324. c = Statements_TestClass_return_010.sMethod();
  4325. if (c.i.ToString().CompareTo(c.s) != 0) {
  4326. return(1);
  4327. }
  4328. Statements_TestClass_return_010.sMethod();
  4329. Statements_TestClass_return_010 t = new Statements_TestClass_return_010();
  4330. c = t.Method();
  4331. t.Method();
  4332. if (c.i.ToString().CompareTo(c.s) != 0) {
  4333. return(1);
  4334. }
  4335. return(c.i == 0 ? 0 : 1);
  4336. }
  4337. private static C sMethod()
  4338. {
  4339. C c = new C();
  4340. c.i = 1;
  4341. c.s = c.i.ToString();
  4342. return (c);
  4343. }
  4344. private C Method()
  4345. {
  4346. C c = new C();
  4347. c.i = 0;
  4348. c.s = c.i.ToString();
  4349. return (c);
  4350. }
  4351. public static bool testMethod()
  4352. {
  4353. return (Main_old(null) == 0);
  4354. }
  4355. }
  4356. public class Statements_TestClass_return_013
  4357. {
  4358. public static int Main_old(string[] args)
  4359. {
  4360. Statements_TestClass_return_013.sMethod();
  4361. Statements_TestClass_return_013 t = new Statements_TestClass_return_013();
  4362. t.Method();
  4363. return (0);
  4364. }
  4365. private static void sMethod()
  4366. {
  4367. }
  4368. private void Method()
  4369. {
  4370. }
  4371. public static bool testMethod()
  4372. {
  4373. return (Main_old(null) == 0);
  4374. }
  4375. }
  4376. public class Statements_TestClass_return_014
  4377. {
  4378. public static int Main_old(string[] args)
  4379. {
  4380. int i;
  4381. i = Statements_TestClass_return_014.sMethod(1);
  4382. Statements_TestClass_return_014.sMethod(2);
  4383. Statements_TestClass_return_014 t = new Statements_TestClass_return_014();
  4384. i = t.Method(3);
  4385. t.Method(4);
  4386. return(i == 0 ? 0 : 1);
  4387. }
  4388. private static int sMethod(int i)
  4389. {
  4390. if (i > 0)
  4391. return (1);
  4392. throw new System.Exception();
  4393. }
  4394. private int Method(int i)
  4395. {
  4396. if (i == 0)
  4397. {
  4398. return (0);
  4399. }
  4400. else
  4401. {
  4402. if (i > 0)
  4403. {
  4404. switch (i)
  4405. {
  4406. case 1:
  4407. return (0);
  4408. case 3:
  4409. while (i > 0)
  4410. {
  4411. return (0);
  4412. }
  4413. for (; i < 0; )
  4414. {
  4415. return (1);
  4416. }
  4417. throw new System.Exception();
  4418. default:
  4419. return (0);
  4420. }
  4421. }
  4422. else
  4423. {
  4424. return (0);
  4425. }
  4426. }
  4427. }
  4428. public static bool testMethod()
  4429. {
  4430. return (Main_old(null) == 0);
  4431. }
  4432. }
  4433. public class Statements_TestClass_throw_001
  4434. {
  4435. public static int Main_old(string[] args)
  4436. {
  4437. int i;
  4438. i = Statements_TestClass_throw_001.sMethod();
  4439. if (i > 0)
  4440. return(1);
  4441. Statements_TestClass_throw_001.sMethod();
  4442. Statements_TestClass_throw_001 t = new Statements_TestClass_throw_001();
  4443. i = t.Method();
  4444. t.Method();
  4445. return(i == 0 ? 0 : 1);
  4446. }
  4447. private static int sMethod()
  4448. {
  4449. try
  4450. {
  4451. throw new System.Exception();
  4452. }
  4453. catch (System.Exception e)
  4454. {
  4455. return (0);
  4456. }
  4457. return (1);
  4458. }
  4459. private int Method()
  4460. {
  4461. try
  4462. {
  4463. throw new System.Exception();
  4464. }
  4465. catch (System.Exception e)
  4466. {
  4467. return (0);
  4468. }
  4469. return (1);
  4470. }
  4471. public static bool testMethod()
  4472. {
  4473. return (Main_old(null) == 0);
  4474. }
  4475. }
  4476. public class Statements_TestClass_throw_005
  4477. {
  4478. public static int Main_old(string[] args)
  4479. {
  4480. int i;
  4481. i = Statements_TestClass_throw_005.sMethod();
  4482. return(i == 0 ? 0 : 1);
  4483. }
  4484. private static int sMethod()
  4485. {
  4486. int i = 1;
  4487. try
  4488. {
  4489. System.Exception e = new System.Exception();
  4490. throw (e);
  4491. }
  4492. catch (System.Exception e)
  4493. {
  4494. Log.Comment(e.ToString());
  4495. return (0);
  4496. }
  4497. return (i);
  4498. }
  4499. public static bool testMethod()
  4500. {
  4501. return (Main_old(null) == 0);
  4502. }
  4503. }
  4504. public class Statements_TestClass_trycatch_001
  4505. {
  4506. public static int Main_old(string[] args)
  4507. {
  4508. int i;
  4509. Statements_TestClass_trycatch_001 t = new Statements_TestClass_trycatch_001();
  4510. i = t.Method();
  4511. return(i == 0 ? 0 : 1);
  4512. }
  4513. private int Method()
  4514. {
  4515. try
  4516. {
  4517. throw new System.Exception();
  4518. }
  4519. catch (System.Exception e)
  4520. {
  4521. return (0);
  4522. }
  4523. return (1);
  4524. }
  4525. public static bool testMethod()
  4526. {
  4527. return (Main_old(null) == 0);
  4528. }
  4529. }
  4530. public class Statements_TestClass_trycatch_006
  4531. {
  4532. public static int Main_old(string[] args)
  4533. {
  4534. int i;
  4535. Statements_TestClass_trycatch_006 t = new Statements_TestClass_trycatch_006();
  4536. i = t.Method(0);
  4537. return(i == 0 ? 0 : 1);
  4538. }
  4539. private int Method(int i)
  4540. {
  4541. try
  4542. {
  4543. int x = 1 / i;
  4544. Log.Comment(x.ToString()); // prevent it being optimized away
  4545. }
  4546. catch (System.Exception e)
  4547. {
  4548. return (0);
  4549. }
  4550. return (1);
  4551. }
  4552. public static bool testMethod()
  4553. {
  4554. return (Main_old(null) == 0);
  4555. }
  4556. }
  4557. public class Statements_TestClass_trycatch_007
  4558. {
  4559. public static int Main_old(string[] args)
  4560. {
  4561. int i;
  4562. Statements_TestClass_trycatch_007 t = new Statements_TestClass_trycatch_007();
  4563. i = t.Method();
  4564. int tt = i == 0 ? 0 : 1;
  4565. Log.Comment("Value is" + tt);
  4566. return(i == 0 ? 0 : 1);
  4567. }
  4568. private int Method()
  4569. {
  4570. try
  4571. {
  4572. try
  4573. {
  4574. Thrower();
  4575. //throw new System.Exception();
  4576. }
  4577. catch (System.Exception e)
  4578. {
  4579. Log.Comment("Rethrow");
  4580. throw;
  4581. }
  4582. }
  4583. catch (System.Exception e)
  4584. {
  4585. Log.Comment("Recatch");
  4586. return (0);
  4587. }
  4588. return (1);
  4589. }
  4590. private void Thrower()
  4591. {
  4592. throw new System.Exception();
  4593. }
  4594. public static bool testMethod()
  4595. {
  4596. return (Main_old(null) == 0);
  4597. }
  4598. }
  4599. public class Statements_TestClass_tryfinally_001
  4600. {
  4601. public static int Main_old(string[] args)
  4602. {
  4603. int i;
  4604. Statements_TestClass_tryfinally_001 t = new Statements_TestClass_tryfinally_001();
  4605. i = t.Method(2);
  4606. return(i == 0 ? 0 : 1);
  4607. }
  4608. private int Method(int i)
  4609. {
  4610. try
  4611. {
  4612. i--;
  4613. }
  4614. finally
  4615. {
  4616. i--;
  4617. }
  4618. return (i);
  4619. }
  4620. public static bool testMethod()
  4621. {
  4622. return (Main_old(null) == 0);
  4623. }
  4624. }
  4625. public class Statements_TestClass_tryfinally_002
  4626. {
  4627. public static int Main_old(string[] args)
  4628. {
  4629. int i;
  4630. Statements_TestClass_tryfinally_002 t = new Statements_TestClass_tryfinally_002();
  4631. i = t.Method(1);
  4632. return(i == 0 ? 0 : 1);
  4633. }
  4634. private int Method(int i)
  4635. {
  4636. try
  4637. {
  4638. try
  4639. {
  4640. throw new System.Exception();
  4641. }
  4642. finally
  4643. {
  4644. i--;
  4645. }
  4646. }
  4647. catch
  4648. {
  4649. }
  4650. return (i);
  4651. }
  4652. public static bool testMethod()
  4653. {
  4654. return (Main_old(null) == 0);
  4655. }
  4656. }
  4657. public class Statements_TestClass_tryfinally_003
  4658. {
  4659. public static int Main_old(string[] args)
  4660. {
  4661. int i;
  4662. Statements_TestClass_tryfinally_003 t = new Statements_TestClass_tryfinally_003();
  4663. i = t.Method(1);
  4664. return(i == 0 ? 0 : 1);
  4665. }
  4666. private int Method(int i)
  4667. {
  4668. try
  4669. {
  4670. try
  4671. {
  4672. throw new System.Exception();
  4673. }
  4674. catch
  4675. {
  4676. }
  4677. }
  4678. finally
  4679. {
  4680. i--;
  4681. }
  4682. return (i);
  4683. }
  4684. public static bool testMethod()
  4685. {
  4686. return (Main_old(null) == 0);
  4687. }
  4688. }
  4689. public class Statements_TestClass_tryfinally_004
  4690. {
  4691. public static int Main_old(string[] args)
  4692. {
  4693. int i;
  4694. Statements_TestClass_tryfinally_004 t = new Statements_TestClass_tryfinally_004();
  4695. i = t.Method(1);
  4696. return(i == 0 ? 0 : 1);
  4697. }
  4698. private int Method(int i)
  4699. {
  4700. try
  4701. {
  4702. goto TheEnd;
  4703. }
  4704. finally
  4705. {
  4706. i--;
  4707. }
  4708. TheEnd:
  4709. return (i);
  4710. }
  4711. public static bool testMethod()
  4712. {
  4713. return (Main_old(null) == 0);
  4714. }
  4715. }
  4716. public class Statements_TestClass_tryfinally_006
  4717. {
  4718. public static int Main_old(string[] args)
  4719. {
  4720. int i = 0;
  4721. Statements_TestClass_tryfinally_006 t = new Statements_TestClass_tryfinally_006();
  4722. try {
  4723. i = t.Method(1);
  4724. } catch {}
  4725. return(i == 0 ? 0 : 1);
  4726. }
  4727. private int Method(int i)
  4728. {
  4729. try
  4730. {
  4731. throw new System.Exception();
  4732. }
  4733. finally
  4734. {
  4735. i--;
  4736. }
  4737. return (i);
  4738. }
  4739. public static bool testMethod()
  4740. {
  4741. return (Main_old(null) == 0);
  4742. }
  4743. }
  4744. public class Statements_TestClass_tryfinally_007
  4745. {
  4746. public static int Main_old(string[] args)
  4747. {
  4748. int i = 0;
  4749. Statements_TestClass_tryfinally_007 t = new Statements_TestClass_tryfinally_007();
  4750. try {
  4751. i = t.Method(1);
  4752. } catch {}
  4753. return(i == 0 ? 0 : 1);
  4754. }
  4755. private int Method(int i)
  4756. {
  4757. try
  4758. {
  4759. DeepMethod(i);
  4760. }
  4761. finally
  4762. {
  4763. i--;
  4764. }
  4765. return (i);
  4766. }
  4767. private int DeepMethod(int i)
  4768. {
  4769. throw new System.Exception();
  4770. }
  4771. public static bool testMethod()
  4772. {
  4773. return (Main_old(null) == 0);
  4774. }
  4775. }
  4776. public class Statements_TestClass_tryfinally_008
  4777. {
  4778. public static int Main_old(string[] args)
  4779. {
  4780. int i = 1;
  4781. Statements_TestClass_tryfinally_008 t = new Statements_TestClass_tryfinally_008();
  4782. try {
  4783. i = t.Method(0);
  4784. } catch {}
  4785. return(i == 0 ? 0 : 1);
  4786. }
  4787. private int Method(int i)
  4788. {
  4789. try
  4790. {
  4791. return (i);
  4792. }
  4793. finally
  4794. {
  4795. i++;
  4796. }
  4797. return (i);
  4798. }
  4799. public static bool testMethod()
  4800. {
  4801. return (Main_old(null) == 0);
  4802. }
  4803. }
  4804. public class Statements_TestClass_tryfinally_009
  4805. {
  4806. public static int Main_old(string[] args)
  4807. {
  4808. int i = 1;
  4809. Statements_TestClass_tryfinally_009 t = new Statements_TestClass_tryfinally_009();
  4810. try {
  4811. i = t.Method(1);
  4812. } catch {}
  4813. return(i == 0 ? 0 : 1);
  4814. }
  4815. private int Method(int i)
  4816. {
  4817. bool b = true;
  4818. while (b)
  4819. {
  4820. try
  4821. {
  4822. b = false;
  4823. continue;
  4824. }
  4825. finally
  4826. {
  4827. i--;
  4828. }
  4829. }
  4830. return (i);
  4831. }
  4832. public static bool testMethod()
  4833. {
  4834. return (Main_old(null) == 0);
  4835. }
  4836. }
  4837. public class Statements_TestClass_tryfinally_010
  4838. {
  4839. public static int Main_old(string[] args)
  4840. {
  4841. int i = 1;
  4842. Statements_TestClass_tryfinally_010 t = new Statements_TestClass_tryfinally_010();
  4843. try {
  4844. i = t.Method(1);
  4845. } catch {}
  4846. return(i == 0 ? 0 : 1);
  4847. }
  4848. private int Method(int i)
  4849. {
  4850. while (true)
  4851. {
  4852. try
  4853. {
  4854. break;
  4855. }
  4856. finally
  4857. {
  4858. i--;
  4859. }
  4860. }
  4861. return (i);
  4862. }
  4863. public static bool testMethod()
  4864. {
  4865. return (Main_old(null) == 0);
  4866. }
  4867. }
  4868. public class Statements_TestClass_tryfinally_011
  4869. {
  4870. public static int Main_old(string[] args)
  4871. {
  4872. int i = 1;
  4873. Statements_TestClass_tryfinally_011 t = new Statements_TestClass_tryfinally_011();
  4874. try {
  4875. i = t.Method(0);
  4876. } catch {}
  4877. return(i == 0 ? 0 : 1);
  4878. }
  4879. private int Method(int i)
  4880. {
  4881. while (true)
  4882. {
  4883. break;
  4884. try
  4885. {
  4886. break;
  4887. }
  4888. finally
  4889. {
  4890. i++;
  4891. }
  4892. }
  4893. return (i);
  4894. }
  4895. public static bool testMethod()
  4896. {
  4897. return (Main_old(null) == 0);
  4898. }
  4899. }
  4900. public class Statements_TestClass_tryfinally_012
  4901. {
  4902. public static int Main_old(string[] args)
  4903. {
  4904. int i = 0;
  4905. bool bCatch = false;
  4906. Statements_TestClass_tryfinally_012 t = new Statements_TestClass_tryfinally_012();
  4907. try {
  4908. i = t.Method(1);
  4909. } catch { bCatch = true; }
  4910. if (!bCatch)
  4911. i = 1;
  4912. return(i == 0 ? 0 : 1);
  4913. }
  4914. private int Method(int i)
  4915. {
  4916. try
  4917. {
  4918. Log.Comment((10 / (i - 1)).ToString());
  4919. }
  4920. finally
  4921. {
  4922. i--;
  4923. }
  4924. return (i);
  4925. }
  4926. public static bool testMethod()
  4927. {
  4928. return (Main_old(null) == 0);
  4929. }
  4930. }
  4931. class Statements_TestClass_tryfinally_013
  4932. {
  4933. static void Main_old(string[] args)
  4934. {
  4935. before_try:
  4936. try
  4937. {
  4938. }
  4939. catch (Exception)
  4940. {
  4941. goto before_try;
  4942. }
  4943. finally
  4944. {
  4945. before_inner_try:
  4946. try
  4947. {
  4948. }
  4949. catch (Exception)
  4950. {
  4951. goto before_inner_try;
  4952. }
  4953. finally
  4954. {
  4955. }
  4956. }
  4957. }
  4958. public static bool testMethod()
  4959. {
  4960. Main_old(null);
  4961. return true;
  4962. }
  4963. }
  4964. // two normal classes...
  4965. public class Statements_TestClass_Using_001
  4966. {
  4967. public static void Main_old()
  4968. {
  4969. Res1 res1 = new Res1();
  4970. IDisposable id = (IDisposable)res1;
  4971. using (id)
  4972. {
  4973. res1.Func();
  4974. }
  4975. }
  4976. public static bool testMethod()
  4977. {
  4978. Main_old();
  4979. return true;
  4980. }
  4981. }
  4982. // two normal classes...
  4983. public class Statements_TestClass_Using_002
  4984. {
  4985. public static void Main_old()
  4986. {
  4987. Res1 res1 = new Res1();
  4988. using (res1)
  4989. {
  4990. res1.Func();
  4991. }
  4992. }
  4993. public static bool testMethod()
  4994. {
  4995. Main_old();
  4996. return true;
  4997. }
  4998. }
  4999. // two normal classes...
  5000. public class Statements_TestClass_Using_003
  5001. {
  5002. public static void Main_old()
  5003. {
  5004. using (Res1 res1 = new Res1())
  5005. {
  5006. res1.Func();
  5007. }
  5008. }
  5009. public static bool testMethod()
  5010. {
  5011. Main_old();
  5012. return true;
  5013. }
  5014. }
  5015. // two normal classes...
  5016. public class Statements_TestClass_Using_005
  5017. {
  5018. public static void Main_old()
  5019. {
  5020. using (ResExplicit resExplicit = new ResExplicit())
  5021. {
  5022. resExplicit.Func();
  5023. }
  5024. }
  5025. public static bool testMethod()
  5026. {
  5027. Main_old();
  5028. return true;
  5029. }
  5030. }
  5031. // two normal classes...
  5032. public class Statements_TestClass_Using_009
  5033. {
  5034. public static void Main_old()
  5035. {
  5036. Res1 res1 = new Res1();
  5037. using (res1)
  5038. {
  5039. res1.Func();
  5040. res1 = null;
  5041. }
  5042. }
  5043. public static bool testMethod()
  5044. {
  5045. Main_old();
  5046. return true;
  5047. }
  5048. }
  5049. // two normal classes...
  5050. public class Statements_TestClass_Using_010
  5051. {
  5052. public static void Main_old()
  5053. {
  5054. using (Res1 res1 = new Res1())
  5055. {
  5056. res1.Func();
  5057. }
  5058. }
  5059. public static bool testMethod()
  5060. {
  5061. Main_old();
  5062. return true;
  5063. }
  5064. }
  5065. // two normal classes...
  5066. public class Statements_TestClass_Using_011
  5067. {
  5068. public static void Main_old()
  5069. {
  5070. try
  5071. {
  5072. using (Res1 res1 = new Res1())
  5073. {
  5074. res1.Throw();
  5075. }
  5076. }
  5077. catch
  5078. {
  5079. Log.Comment("System.Exception caught");
  5080. }
  5081. }
  5082. public static bool testMethod()
  5083. {
  5084. Main_old();
  5085. return true;
  5086. }
  5087. }
  5088. // two normal classes...
  5089. public class Statements_TestClass_Using_012
  5090. {
  5091. public static void Main_old()
  5092. {
  5093. using (Res1 res1 = new Res1())
  5094. {
  5095. res1.Func();
  5096. using (Res2 res2 = new Res2())
  5097. {
  5098. res2.Func();
  5099. }
  5100. }
  5101. }
  5102. public static bool testMethod()
  5103. {
  5104. Main_old();
  5105. return true;
  5106. }
  5107. }
  5108. // two normal classes...
  5109. public class Statements_TestClass_Using_013
  5110. {
  5111. public static void Main_old()
  5112. {
  5113. try
  5114. {
  5115. using (Res1 res1 = new Res1())
  5116. {
  5117. res1.Func();
  5118. res1.Throw();
  5119. using (Res2 res2 = new Res2())
  5120. {
  5121. res2.Func();
  5122. }
  5123. }
  5124. }
  5125. catch
  5126. {
  5127. Log.Comment("System.Exception caught");
  5128. }
  5129. }
  5130. public static bool testMethod()
  5131. {
  5132. Main_old();
  5133. return true;
  5134. }
  5135. }
  5136. // two normal classes...
  5137. public class Statements_TestClass_Using_014
  5138. {
  5139. public static void Main_old()
  5140. {
  5141. try
  5142. {
  5143. using (Res1 res1 = new Res1())
  5144. {
  5145. res1.Func();
  5146. using (Res2 res2 = new Res2())
  5147. {
  5148. res2.Func();
  5149. }
  5150. res1.Throw();
  5151. }
  5152. }
  5153. catch
  5154. {
  5155. Log.Comment("System.Exception caught");
  5156. }
  5157. }
  5158. public static bool testMethod()
  5159. {
  5160. Main_old();
  5161. return true;
  5162. }
  5163. }
  5164. // two normal classes...
  5165. public class Statements_TestClass_Using_015
  5166. {
  5167. public static void Main_old()
  5168. {
  5169. try
  5170. {
  5171. using (Res1 res1 = new Res1())
  5172. {
  5173. res1.Func();
  5174. using (Res2 res2 = new Res2())
  5175. {
  5176. res2.Func();
  5177. res1.Throw();
  5178. }
  5179. }
  5180. }
  5181. catch
  5182. {
  5183. Log.Comment("System.Exception caught");
  5184. }
  5185. }
  5186. public static bool testMethod()
  5187. {
  5188. Main_old();
  5189. return true;
  5190. }
  5191. }
  5192. // two normal classes...
  5193. public class Statements_TestClass_Using_017
  5194. {
  5195. public static void Main_old()
  5196. {
  5197. try
  5198. {
  5199. using (Res1 res1 = new Res1(),
  5200. res1a = new Res1())
  5201. {
  5202. res1.Func();
  5203. res1.Func();
  5204. res1.Throw();
  5205. }
  5206. }
  5207. catch
  5208. {
  5209. Log.Comment("System.Exception caught");
  5210. }
  5211. }
  5212. public static bool testMethod()
  5213. {
  5214. Main_old();
  5215. return true;
  5216. }
  5217. }
  5218. // two normal classes...
  5219. public class Statements_TestClass_Using_018
  5220. {
  5221. public static void Main_old()
  5222. {
  5223. using (Res1 res1 = new Res1(),
  5224. res1a = new Res1())
  5225. {
  5226. res1.Func();
  5227. res1a.Func();
  5228. }
  5229. }
  5230. public static bool testMethod()
  5231. {
  5232. Main_old();
  5233. return true;
  5234. }
  5235. }
  5236. class Statements_TestClass_lock001
  5237. {
  5238. public static int Main_old()
  5239. {
  5240. Statements_TestClass_lock001 C = new Statements_TestClass_lock001();
  5241. lock (C)
  5242. {
  5243. return 0;
  5244. }
  5245. }
  5246. public static bool testMethod()
  5247. {
  5248. return (Main_old() == 0);
  5249. }
  5250. }
  5251. class Statements_TestClass_lock003
  5252. {
  5253. public static int Main_old()
  5254. {
  5255. lock (typeof(Statements_TestClass_lock003))
  5256. {
  5257. return 0;
  5258. }
  5259. }
  5260. public static bool testMethod()
  5261. {
  5262. return (Main_old() == 0);
  5263. }
  5264. }
  5265. class Statements_TestClass_lock004
  5266. {
  5267. public static int Main_old()
  5268. {
  5269. lock (typeof(Statements_TestClass_lock004)) ;
  5270. {
  5271. return 0;
  5272. }
  5273. }
  5274. public static bool testMethod()
  5275. {
  5276. return (Main_old() == 0);
  5277. }
  5278. }
  5279. class Statements_TestClass_lock005
  5280. {
  5281. public void TryMe()
  5282. {
  5283. lock (this) { }
  5284. }
  5285. public static int Main_old()
  5286. {
  5287. return 0;
  5288. }
  5289. public static bool testMethod()
  5290. {
  5291. return (Main_old() == 0);
  5292. }
  5293. }
  5294. class Statements_TestClass_lock007
  5295. {
  5296. public static int Main_old()
  5297. {
  5298. lock (typeof(Statements_TestClass_lock007))
  5299. {
  5300. Statements_TestClass_lock007 C = new Statements_TestClass_lock007();
  5301. lock (C)
  5302. {
  5303. return 0;
  5304. }
  5305. }
  5306. }
  5307. public static bool testMethod()
  5308. {
  5309. return (Main_old() == 0);
  5310. }
  5311. }
  5312. public class Statements_TestClass_enum_002
  5313. {
  5314. private const int CONST = 2;
  5315. public static int Main_old(string[] args)
  5316. {
  5317. int i = 2;
  5318. if (i < (int)(MyEnum)CONST)
  5319. return 1;
  5320. if (i == (int)(MyEnum)0)
  5321. return 1;
  5322. return 0;
  5323. }
  5324. public static bool testMethod()
  5325. {
  5326. return (Main_old(null) == 0);
  5327. }
  5328. }
  5329. public enum MyEnum
  5330. {
  5331. aaa,
  5332. bbb,
  5333. ccc
  5334. }
  5335. }
  5336. }