Skip to content
Snippets Groups Projects
Commit 971cb6be authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny: Committed by Vakhtang Tsulaia
Browse files

Update unit test for UnidentifiedShape

parent e332ee67
No related branches found
No related tags found
1 merge request!339Fix UnidentifiedShape I/O
Pipeline #7710289 passed
......@@ -441,8 +441,9 @@ int main(int argc, char *argv[])
// Add a test "UnidentifiedShape" shape node
const std::string nameUnidentifiedShape = "LAr::Example";
GeoUnidentifiedShape* sUnidentifiedShape = new GeoUnidentifiedShape("LArCustomShape",nameUnidentifiedShape);
const std::string shapeUnidName = "LArCustomShape";
const std::string shapeUnidAscii = "LAr::Example";
GeoUnidentifiedShape* sUnidentifiedShape = new GeoUnidentifiedShape(shapeUnidName, shapeUnidAscii);
const GeoLogVol* lUnidentifiedShape = new GeoLogVol("UnidentifiedShape", sUnidentifiedShape, steel);
GeoPhysVol *pUnidentifiedShape = new GeoPhysVol(lUnidentifiedShape);
GeoNameTag *nUnidentifiedShape = new GeoNameTag("UnidentifiedShape");
......
......@@ -55,7 +55,7 @@ add_test(NAME test_IO_SharedSerialTransformers
COMMAND test_io_shared_serialtransformers)
# I/O Unit tests
add_executable(test_io_unidentifiedshape tests/test_io_UnidentifiedShape.cpp)
target_link_libraries( test_io_unidentifiedshape GeoModelCore::GeoModelHelpers GeoModelCore::GeoModelKernel GeoModelIO::GeoModelIOHelpers)
add_executable(test_io_shapes_unidentifiedshape tests/test_io_UnidentifiedShape.cpp)
target_link_libraries( test_io_shapes_unidentifiedshape GeoModelIO::GeoModelDBManager GeoModelCore::GeoModelHelpers GeoModelCore::GeoModelKernel GeoModelIO::GeoModelIOHelpers)
add_test(NAME test_IO_Shapes_UnidentifiedShape
COMMAND test_io_unidentifiedshape)
COMMAND test_io_shapes_unidentifiedshape)
......@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
// Add a test "UnidentifiedShape" shape node
const std::string shapeDataAscii = "LAr::Example";
const std::string shapeDataName = "LArCustomShape";
GeoUnidentifiedShape *sUnidentifiedShape = new GeoUnidentifiedShape(shapeDataAscii, shapeDataName);
GeoUnidentifiedShape *sUnidentifiedShape = new GeoUnidentifiedShape(shapeDataName, shapeDataAscii);
const GeoLogVol *lUnidentifiedShape = new GeoLogVol("UnidentifiedShape", sUnidentifiedShape, matAluminum);
GeoPhysVol *pUnidentifiedShape = new GeoPhysVol(lUnidentifiedShape);
GeoNameTag *nUnidentifiedShape = new GeoNameTag("UnidentifiedShape");
......@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
world->add(pUnidentifiedShape);
// write to the test DB
std::string testDB = "test_io_unidentifiedshape";
std::string testDB = "test_io_unidentifiedshape.db";
unsigned loglevel = 2;
const bool forceDelete = true;
GeoModelIO::IO::saveToDB(world, testDB, loglevel, forceDelete);
......@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
const std::string restoredShapeDataAscii = shape->asciiData();
const std::string restoredShapeDataName = shape->name();
bool test = false;
bool test = true;
if (restoredShapeDataAscii != shapeDataAscii)
{
std::cout << "\nERROR!!! The restored 'AsciiData' is different from the stored version!!!" << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment