ls1-MarDyn is a massively parallel Molecular Dynamics (MD) code for large systems. Its main target is the simulation of thermodynamics and nanofluidics. ls1-MarDyn is designed with a focus on performance and easy extensibility.
Describe the bug
The XML parser's getNodeValue() returns the wrong number of attributes., i.e., returns 1 even if an attribute with the specified name is not present.
Here a minimal reproducer:
#include <iostream>
#include "xmlfile.h"
#include <string>
int main(int argc, char *argv[]) {
using namespace std;
XMLfile xmlconfig;
xmlconfig.initstring("<test attr=\"hello\">Its me</test>");
string attr;
auto ret = xmlconfig.getNodeValue("test@attr", attr);
cout << "Num attributes: " << ret << endl;
ret = xmlconfig.getNodeValue("test@attr_missing", attr);
cout << "Num missing attributes: " << ret << endl;
return 0;
}
./reproducer
Num attributes: 1
Num missing attributes: 1
Describe the bug The XML parser's
getNodeValue()
returns the wrong number of attributes., i.e., returns 1 even if an attribute with the specified name is not present.Here a minimal reproducer: