Skip to content

Explicitly cast CollectionPtr

UnitTestReadWriteMeshJSON.cxx will not compile on Ubuntu 14.04 (gcc 4.8.4), because gcc cannot implicitly cast CollectionPtr to an integer. This mod fixes that by comparing the CollectionPtr to a null pointer (to get a boolean which the compiler can cast to an int). FYI the error message is pasted below.

/media/ssd/sim/cmb_core/gitlab/SMTK/smtk/mesh/testing/cxx/UnitTestReadWriteMeshJSON.cxx: In function ‘void {anonymous}::verify_writing_and_loading_collection()’:
/media/ssd/sim/cmb_core/gitlab/SMTK/smtk/mesh/testing/cxx/UnitTestReadWriteMeshJSON.cxx:107:67: error: cannot convert ‘smtk::mesh::CollectionPtr {aka std::tr1::shared_ptr<smtk::mesh::Collection>}’ to ‘int’ for argument ‘1’ to ‘int test(int, const string&)’
        "Collection UUID can't change when being loaded from JSON");

Merge request reports