Skip to content

Commit 94fd5c4

Browse files
committed
Fix some tests on Windows. Closes #1459
1 parent ce219f7 commit 94fd5c4

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

src/Core/Python/Tests/PythonInterpreterTests.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@
3838
#include <Testing/Utils/MatrixTestUtilities.h>
3939
#include <Testing/Utils/SCIRunUnitTests.h>
4040
#include <Testing/Utils/SCIRunFieldSamples.h>
41+
#include <Core/Python/PythonInterpreter.h>
4142

4243
using namespace SCIRun;
44+
using namespace SCIRun::Core;
4345
using namespace Core::Python;
4446
using namespace Testing;
4547
using namespace TestUtils;
@@ -49,7 +51,8 @@ class FieldConversionTests : public testing::Test
4951
protected:
5052
virtual void SetUp() override
5153
{
52-
Py_Initialize();
54+
PythonInterpreter::Instance().initialize(false, "Core_Python_Tests", boost::filesystem::current_path().string());
55+
PythonInterpreter::Instance().run_string("import SCIRunPythonAPI; from SCIRunPythonAPI import *");
5356
}
5457

5558
static FieldHandle roundTripThroughMatlabConverter(FieldHandle field)

src/ExampleNets/regression/EnvironmentStringBundle.srn5

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
22
<!DOCTYPE boost_serialization>
33
<boost_serialization signature="serialization::archive" version="12">
4-
<networkFile class_id="0" tracking_level="0" version="3">
4+
<networkFile class_id="0" tracking_level="0" version="5">
55
<networkInfo class_id="1" tracking_level="0" version="0">
66
<modules class_id="2" tracking_level="0" version="0">
77
<count>4</count>
@@ -130,7 +130,7 @@
130130
<name>ReceivedValue</name>
131131
<value>
132132
<which>2</which>
133-
<value>test_string_for_scirun</value>
133+
<value>C:\Users\Dan</value>
134134
</value>
135135
</second>
136136
</item>
@@ -161,7 +161,7 @@
161161
<item class_id="13" tracking_level="0" version="0">
162162
<moduleId1_>GetStringsFromBundle:1</moduleId1_>
163163
<port1_ class_id="14" tracking_level="0" version="0">
164-
<name>string1</name>
164+
<name>string2</name>
165165
<id>0</id>
166166
</port1_>
167167
<moduleId2_>PrintDatatype:0</moduleId2_>
@@ -202,29 +202,29 @@
202202
<item class_id="16" tracking_level="0" version="0">
203203
<first>GetStringsFromBundle:1</first>
204204
<second class_id="17" tracking_level="0" version="0">
205-
<first>2.04000000000000000e+02</first>
206-
<second>-9.80000000000000000e+01</second>
205+
<first>2.04000000000000000e+002</first>
206+
<second>-9.80000000000000000e+001</second>
207207
</second>
208208
</item>
209209
<item>
210210
<first>InsertEnvironmentIntoBundle:0</first>
211211
<second>
212-
<first>8.90000000000000000e+01</first>
213-
<second>-2.62000000000000000e+02</second>
212+
<first>8.90000000000000000e+001</first>
213+
<second>-2.62000000000000000e+002</second>
214214
</second>
215215
</item>
216216
<item>
217217
<first>PrintDatatype:0</first>
218218
<second>
219-
<first>1.49000000000000000e+02</first>
220-
<second>1.28000000000000000e+02</second>
219+
<first>1.49000000000000000e+002</first>
220+
<second>1.28000000000000000e+002</second>
221221
</second>
222222
</item>
223223
<item>
224224
<first>ReportBundleInfo:0</first>
225225
<second>
226-
<first>-1.55000000000000000e+02</first>
227-
<second>-9.90000000000000000e+01</second>
226+
<first>-1.55000000000000000e+002</first>
227+
<second>-9.90000000000000000e+001</second>
228228
</second>
229229
</item>
230230
</modulePositions>
@@ -256,6 +256,19 @@
256256
<second>0</second>
257257
</item>
258258
</moduleTags>
259+
<disabledModules class_id="21" tracking_level="0" version="0">
260+
<count>0</count>
261+
<item_version>0</item_version>
262+
</disabledModules>
263+
<disabledConnections>
264+
<count>0</count>
265+
<item_version>0</item_version>
266+
</disabledConnections>
267+
<moduleTagLabels class_id="22" tracking_level="0" version="0">
268+
<count>0</count>
269+
<item_version>0</item_version>
270+
</moduleTagLabels>
271+
<loadTagGroups>0</loadTagGroups>
259272
</networkFile>
260273
</boost_serialization>
261274

0 commit comments

Comments
 (0)