Commit d9675748 authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud

Enhance tests.

parent 16c38afd
......@@ -154,30 +154,65 @@ void dtkVisualizationMetaTypeTestCase::testVariantFromValue(void)
vtkDataSet *data = vtkImageData::New();
v = dtk::variantFromValue(data);
QVERIFY(v.userType() == QMetaType::type("vtkImageData*"));
auto dd = v.value<vtkDataSet *>();
QVERIFY(dd);
auto ee = v.value<vtkImageData *>();
QVERIFY(ee);
v = dtk::variantFromValue(ee);
dd = v.value<vtkDataSet *>();
QVERIFY(dd);
data->Delete();
}
{
vtkDataSet *data = vtkPolyData::New();
v = dtk::variantFromValue(data);
QVERIFY(v.userType() == QMetaType::type("vtkPolyData*"));
auto dd = v.value<vtkDataSet *>();
QVERIFY(dd);
auto ee = v.value<vtkPolyData *>();
QVERIFY(ee);
v = dtk::variantFromValue(ee);
dd = v.value<vtkDataSet *>();
QVERIFY(dd);
data->Delete();
}
{
vtkDataSet *data = vtkRectilinearGrid::New();
v = dtk::variantFromValue(data);
QVERIFY(v.userType() == QMetaType::type("vtkRectilinearGrid*"));
auto dd = v.value<vtkDataSet *>();
QVERIFY(dd);
auto ee = v.value<vtkRectilinearGrid *>();
QVERIFY(ee);
v = dtk::variantFromValue(ee);
dd = v.value<vtkDataSet *>();
QVERIFY(dd);
data->Delete();
}
{
vtkDataSet *data = vtkStructuredGrid::New();
v = dtk::variantFromValue(data);
QVERIFY(v.userType() == QMetaType::type("vtkStructuredGrid*"));
auto dd = v.value<vtkDataSet *>();
QVERIFY(dd);
auto ee = v.value<vtkStructuredGrid *>();
QVERIFY(ee);
v = dtk::variantFromValue(ee);
dd = v.value<vtkDataSet *>();
QVERIFY(dd);
data->Delete();
}
{
vtkDataSet *data = vtkUnstructuredGrid::New();
v = dtk::variantFromValue(data);
QVERIFY(v.userType() == QMetaType::type("vtkUnstructuredGrid*"));
auto dd = v.value<vtkDataSet *>();
QVERIFY(dd);
auto ee = v.value<vtkUnstructuredGrid *>();
QVERIFY(ee);
v = dtk::variantFromValue(ee);
dd = v.value<vtkDataSet *>();
QVERIFY(dd);
data->Delete();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment