Tests: add unit tests for:

* TopoShape::getElementTypeAndIndex
* ComplexGeoData::getTypeAndIndex

and fix crashes there when passing a null pointer
This commit is contained in:
wmayer
2023-08-25 15:54:48 +02:00
committed by wwmayer
parent 66fb1c7777
commit 2c2347f746
8 changed files with 116 additions and 2 deletions

View File

@@ -300,7 +300,7 @@ std::pair<std::string, unsigned long> TopoShape::getElementTypeAndIndex(const ch
boost::regex ex("^(Face|Edge|Vertex)([1-9][0-9]*)$");
boost::cmatch what;
if (boost::regex_match(Name, what, ex)) {
if (Name && boost::regex_match(Name, what, ex)) {
element = what[1].str();
index = std::atoi(what[2].str().c_str());
}