Skip to content

Commit 7c28631

Browse files
committed
Test for brett's failing mesh
1 parent b3336ca commit 7c28631

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

src/Core/Python/Tests/PythonInterpreterTests.cc

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ class FieldConversionTests : public testing::Test
133133
return loadFieldFromFile(TestResources::rootDir() / "Fields/test_image_node.fld");
134134
}
135135

136-
//static FieldHandle CreatePointCloudScalar()
137-
//{
138-
// return loadFieldFromFile(TestResources::rootDir() / "Fields/point_cloud/scalar/pts_scalar.fld");
139-
//}
136+
static FieldHandle CreateTriSurfFromCVRTI()
137+
{
138+
return loadFieldFromFile(TestResources::rootDir() / "Fields/CVRTI_cappedTorso/CappedTorso_192.fld");
139+
}
140140

141141
static std::vector<FieldHandle> fileExamples()
142142
{
@@ -332,6 +332,32 @@ TEST_F(FieldConversionTests, RoundTripTetVolNode)
332332
EXPECT_EQ("GenericField<TetVolMesh<TetLinearLgn<Point>>,TetLinearLgn<double>,vector<double>>", info.get_field_type_id());
333333
}
334334

335+
336+
TEST_F(FieldConversionTests, RoundTripTriSurfCVRTI)
337+
{
338+
auto expected = CreateTriSurfFromCVRTI();
339+
auto pyField = convertFieldToPython(expected);
340+
EXPECT_EQ(10, len(pyField.items()));
341+
342+
FieldExtractor converter(pyField);
343+
344+
ASSERT_TRUE(converter.check());
345+
346+
auto actual = converter();
347+
ASSERT_TRUE(actual != nullptr);
348+
auto actualField = boost::dynamic_pointer_cast<Field>(actual);
349+
ASSERT_TRUE(actualField != nullptr);
350+
351+
FieldInformation info(actualField);
352+
EXPECT_TRUE(info.is_trisurf());
353+
EXPECT_TRUE(info.is_double());
354+
EXPECT_TRUE(info.is_scalar());
355+
EXPECT_TRUE(info.is_linear());
356+
EXPECT_EQ("TriSurfMesh<TriLinearLgn<Point>>", info.get_mesh_type_id());
357+
EXPECT_EQ("TriSurfMesh", info.get_mesh_type());
358+
EXPECT_EQ("GenericField<TriSurfMesh<TriLinearLgn<Point>>,TriLinearLgn<double>,vector<double>>", info.get_field_type_id());
359+
}
360+
335361
TEST_F(FieldConversionTests, RoundTripTetVolCell)
336362
{
337363
auto expected = CreateTetMeshScalarOnElem();

0 commit comments

Comments
 (0)