diff --git a/src/ox/std/test/byteswap_test.cpp b/src/ox/std/test/byteswap_test.cpp index fc679c800..096739f2a 100644 --- a/src/ox/std/test/byteswap_test.cpp +++ b/src/ox/std/test/byteswap_test.cpp @@ -5,9 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include -#include #include using namespace std; @@ -15,11 +13,11 @@ using namespace ox::std; template int testBigEndianAdapt(string str) { - auto i = (T) stoul(str, nullptr, 16); + auto i = (T) stoull(str, nullptr, 16); return !(bigEndianAdapt(bigEndianAdapt(i)) == i); } -map> tests = { +map tests = { { { "bigEndianAdapt", testBigEndianAdapt }, { "bigEndianAdapt", testBigEndianAdapt }, @@ -28,12 +26,13 @@ map> tests = { }; int main(int argc, const char **args) { + int retval = -1; if (argc > 1) { auto testName = args[1]; - auto testArg = args[2]; + string testArg = args[2]; if (tests.find(testName) != tests.end()) { - return tests[testName](testArg); + retval = tests[testName](testArg); } } - return -1; + return retval; }