From 5b3bc26bdbf862de39e1dea3680e8d98e3ac0c11 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 15 Aug 2019 11:53:40 +0200 Subject: [PATCH] Fixed tests not passing due to 1-indexed system vs 0-indexed thinking --- .../UserDataCollections/UserDataCollectionRangeIterator.hpp | 2 +- tests/integration/UserDataTests.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UserData/UserDataCollections/UserDataCollectionRangeIterator.hpp b/src/UserData/UserDataCollections/UserDataCollectionRangeIterator.hpp index 7fe1767..f9f9045 100644 --- a/src/UserData/UserDataCollections/UserDataCollectionRangeIterator.hpp +++ b/src/UserData/UserDataCollections/UserDataCollectionRangeIterator.hpp @@ -14,7 +14,7 @@ namespace Porygon::UserData{ UserDataCollectionRangeIterator(size_t start, size_t end){ _start = start; _end = end; - _current = start; + _current = _start; } const Evaluation::EvalValue* GetCurrent() final{ diff --git a/tests/integration/UserDataTests.cpp b/tests/integration/UserDataTests.cpp index 2c91d07..6a84ee0 100644 --- a/tests/integration/UserDataTests.cpp +++ b/tests/integration/UserDataTests.cpp @@ -191,7 +191,7 @@ end auto obj = new UserDataTestObject(); auto parameter = new UserDataValue(HashedString::ConstHash("testObject"), obj); auto result = script->CallFunction(u"testFunc", {parameter}); - REQUIRE(result->EvaluateInteger() == 6); + REQUIRE(result->EvaluateInteger() == 10); delete obj; delete parameter; delete script;