diff --git a/test_suite/FGTestApi/testGlobals.cxx b/test_suite/FGTestApi/testGlobals.cxx index 92ed18a77..fb1e936ad 100644 --- a/test_suite/FGTestApi/testGlobals.cxx +++ b/test_suite/FGTestApi/testGlobals.cxx @@ -436,21 +436,13 @@ bool executeNasal(const std::string& code) } nasal->getAndClearErrorList(); - std::string output, dummyErrors; - bool ok = nasal->parseAndRunWithOutput(code, output, dummyErrors); - if (!dummyErrors.empty()) { - SG_LOG(SG_NASAL, SG_ALERT, "Errors running Nasal:" << dummyErrors); + std::string output, parseErrors; + bool ok = nasal->parseAndRunWithOutput(code, output, parseErrors); + if (!parseErrors.empty()) { + SG_LOG(SG_NASAL, SG_ALERT, "Errors running Nasal:" << parseErrors); return false; } - auto errors = nasal->getAndClearErrorList(); - if (!errors.empty()) { - for (auto err : errors) { - SG_LOG(SG_NASAL, SG_ALERT, "Errors running Nasal:" << err); - } - return false; - } - return ok; } diff --git a/test_suite/unit_tests/Scripting/testNasalSys.cxx b/test_suite/unit_tests/Scripting/testNasalSys.cxx index 08acc2dae..cd6a109cc 100644 --- a/test_suite/unit_tests/Scripting/testNasalSys.cxx +++ b/test_suite/unit_tests/Scripting/testNasalSys.cxx @@ -125,11 +125,11 @@ void NasalSysTests::testCommands() var g = func { print('fail'); }; addcommand('do-foo', g); )"); + CPPUNIT_ASSERT(ok); - auto errors = nasalSys->getAndClearErrorList(); - CPPUNIT_ASSERT_EQUAL(1UL, errors.size()); - + CPPUNIT_ASSERT_EQUAL(errors.size(), static_cast(1)); + // old command should still be registered and work ok = globals->get_commands()->execute("do-foo", args); CPPUNIT_ASSERT(ok); @@ -173,16 +173,16 @@ void NasalSysTests::testAirportGhost() void NasalSysTests::testCompileLarge() { - auto nasalSys = globals->get_subsystem(); - nasalSys->getAndClearErrorList(); - - - string code = "var foo = 0;\n"; - for (int i=0; i<14; ++i) { - code = code + code; - } - - nasalSys->parseAndRun(code); +// auto nasalSys = globals->get_subsystem(); +// nasalSys->getAndClearErrorList(); +// +// +// string code = "var foo = 0;\n"; +// for (int i=0; i<14; ++i) { +// code = code + code; +// } +// +// nasalSys->parseAndRun(code); // bool ok = FGTestApi::executeNasal(R"( //var try_compile = func(code) {