Debug and new tests:

- Fix HalfMove memory leak
- Fix integer overflow
- Update combined tests
This commit is contained in:
Loic Guegan 2022-01-26 15:02:15 +01:00
parent f4f436870f
commit a1f2467a87
4 changed files with 1367 additions and 1 deletions

View file

@ -5,6 +5,7 @@ namespace pgnp {
HalfMove::HalfMove() : count(-1), isBlack(false), MainLine(NULL) {}
HalfMove::~HalfMove() {
delete MainLine;
for (auto *move : variations) {
delete move;
}

View file

@ -45,7 +45,7 @@ void PGN::ParseNextGame() {
if (IS_EOF) {
throw NoGameFound();
}
int loc = NextNonBlank(LastGameEndLoc);
long loc = NextNonBlank(LastGameEndLoc);
if (IS_EOF) {
throw NoGameFound();
}