@@ -5,16 +5,18 @@ namespace Python.EmbeddingTest
55{
66 public class PyInitializeTest
77 {
8+ /// <summary>
9+ /// Tests issue with multiple simple Initialize/Shutdowns.
10+ /// Fixed by #343
11+ /// </summary>
812 [ Test ]
9- public static void LoadSpecificArgs ( )
13+ public static void StartAndStopTwice ( )
1014 {
11- var args = new [ ] { "test1" , "test2" } ;
12- using ( new PythonEngine ( args ) )
13- using ( var argv = new PyList ( Runtime . Runtime . PySys_GetObject ( "argv" ) ) )
14- {
15- Assert . AreEqual ( args [ 0 ] , argv [ 0 ] . ToString ( ) ) ;
16- Assert . AreEqual ( args [ 1 ] , argv [ 1 ] . ToString ( ) ) ;
17- }
15+ PythonEngine . Initialize ( ) ;
16+ PythonEngine . Shutdown ( ) ;
17+
18+ PythonEngine . Initialize ( ) ;
19+ PythonEngine . Shutdown ( ) ;
1820 }
1921
2022 [ Test ]
@@ -28,17 +30,24 @@ public static void LoadDefaultArgs()
2830 }
2931
3032 [ Test ]
31- public static void StartAndStopTwice ( )
33+ public static void LoadSpecificArgs ( )
3234 {
33- PythonEngine . Initialize ( ) ;
34- PythonEngine . Shutdown ( ) ;
35-
36- PythonEngine . Initialize ( ) ;
37- PythonEngine . Shutdown ( ) ;
35+ var args = new [ ] { "test1" , "test2" } ;
36+ using ( new PythonEngine ( args ) )
37+ using ( var argv = new PyList ( Runtime . Runtime . PySys_GetObject ( "argv" ) ) )
38+ {
39+ Assert . AreEqual ( args [ 0 ] , argv [ 0 ] . ToString ( ) ) ;
40+ Assert . AreEqual ( args [ 1 ] , argv [ 1 ] . ToString ( ) ) ;
41+ }
3842 }
3943
44+ /// <summary>
45+ /// Failing test demonstrating current issue with OverflowException (#376)
46+ /// and ArgumentException issue after that one is fixed.
47+ /// More complex version of StartAndStopTwice test
48+ /// </summary>
4049 [ Test ]
41- [ Ignore ( "System.OverflowException : Arithmetic operation resulted in an overflow" ) ]
50+ [ Ignore ( "GH#376: System.OverflowException : Arithmetic operation resulted in an overflow" ) ]
4251 //[Ignore("System.ArgumentException : Cannot pass a GCHandle across AppDomains")]
4352 public void ReInitialize ( )
4453 {
0 commit comments