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 19:23:18 +02:00
committed by wwmayer
parent f6d1fe1ab3
commit 423cc42ac8
8 changed files with 116 additions and 2 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ std::pair<std::string, unsigned long> ComplexGeoData::getTypeAndIndex(const char
boost::regex ex("^([^0-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());
}