revise/refacor Type Label section parsing and Atoms section parsing

- do not ignore numeric type in Type Label sections
- refuse invalid numeric types that will overflow arrays
- check for duplicate numeric type entries or non-unique labels
- better error messages
- use Tokenizer class instead of sscanf()
This commit is contained in:
Axel Kohlmeyer
2022-09-04 01:01:36 -04:00
parent 389c87ab7e
commit ad8a931fe4
5 changed files with 77 additions and 73 deletions

View File

@ -316,7 +316,7 @@ TEST_F(SetTest, SpinPackage)
constexpr double vx = 0.1;
constexpr double vy = 0.5;
constexpr double vz = -0.1;
constexpr double norm = 1.0 / sqrt(vx * vx + vy * vy + vz * vz);
const double norm = 1.0 / sqrt(vx * vx + vy * vy + vz * vz);
ASSERT_EQ(atom->sp[0][0], vx * norm);
ASSERT_EQ(atom->sp[0][1], vy * norm);
ASSERT_EQ(atom->sp[0][2], vz * norm);