The International Simutrans Forum

Development => Bug Reports => Topic started by: prissi on August 14, 2026, 08:41:05 PM

Title: r12153 cannot run the test scripts any more when with screen
Post by: prissi on August 14, 2026, 08:41:05 PM
I have occasionally run the test scripts by copying them into User_dir/simutrans/addons/pak/scenario/tests ...
However, it does not run any more, even with english language.

On my slow laptop, it freezes in fast forward mode because there is an error message repeating forever
Script: Error:  <error>
Script: Error:  <st>Error: [wrong number of parameters: 6 provided (instead 4) in call to C:\SImutrans\script/scenario_base.nut:is_work_allowed_here]</st>
Script: Error:  CALLSTACK
Script: Error:  </error>

It then fails at the traffic light test:
Script: Error:  <st>Error: [Assertion failed, 'sign_x@2,3,0 == null' was not true]</st>
Script: Error:  CALLSTACK
Script: Error:  <em>* FUNCTION [ASSERT_EQUAL()] <br>* addons/pak\scenario/tests/\test_helpers.nut
Script: Error:  * line [27]
Script: Error:  </em>
Script: Error:  - - LOCALS
Script: Error:  - - - [err] INSTANCE
Script: Error:  - - - [exp] NULL
Script: Error:  - - - [act] INSTANCE
Script: Error:  - - - [this] TABLE (504 entries)
Script: Error:  <em>* FUNCTION [test_sign_build_trafficlight()] <br>* addons/pak\scenario/tests/\tests/test_sign.nut
Script: Error:  * line [342]
Script: Error:  </em>
Script: Error:  - - LOCALS
Script: Error:  - - - [trafficlight] INSTANCE
Script: Error:  - - - [rail] INSTANCE
Script: Error:  - - - [road] INSTANCE
Script: Error:  - - - [remover] INSTANCE
Script: Error:  - - - [wayremover] INSTANCE
Script: Error:  - - - [public_pl] INSTANCE
Script: Error:  - - - [pl] INSTANCE
Script: Error:  - - - [this] TABLE (504 entries)
Script: Error:  <em>* FUNCTION [run_all_tests()] <br>* addons/pak\scenario/tests/scenario.nut
Script: Error:  * line [43]
Script: Error:  </em>
Script: Error:  - - LOCALS
Script: Error:  - - - [num_tests_done] 119
Script: Error:  - - - [error_msg] NULL
Script: Error:  - - - [num_tests] 271
Script: Error:  - - - [func_name] "test_sign_build_trafficlight"
Script: Error:  - - - [test_func] CLOSURE
Script: Error:  - - - [i] 119
Script: Error:  - - - [this] TABLE (504 entries)
Script: Error:  <em>* FUNCTION [start()] <br>* addons/pak\scenario/tests/scenario.nut
Script: Error:  * line [95]
Script: Error:  </em>
Script: Error:  - - LOCALS
Script: Error:  - - - [this] TABLE (504 entries)
Script: Error:  </error>
Title: Re: r12153 cannot run the test scripts any more when with screen
Post by: victor_18993 on August 15, 2026, 08:55:13 AM
I was able to reproduce the error.
The
wrong number of parameters: 6 provided (instead 4) message is not caused by r12150 or r12153. The problem is that the current executable is being used together with an older
script/scenario_base.nut.
The
is_work_allowed_here() callback gained additional parameters some time ago. The current engine passes five parameters, while the
scenario_base.nut shown in the error is an older version which still expects only three. Replacing/updating the
script/ directory with the current one should fix this particular error.
With the current executable and the current
script/ files I get the full 271/271 tests passing. I can also reproduce your exact error simply by putting the old
scenario_base.nut back, including the repeated messages that make fast-forward appear to freeze.
While investigating this, I did find a separate real issue in trunk:
new_scenario_template.nut was never updated when the
name parameter was later added to
is_work_allowed_here(). The engine and
scenario_base.nut expect five parameters, while the template still has four. I have reproduced that independently with a scenario created from the current template and prepared a small fix for it.
I could not reproduce the second traffic-light assertion from your report. If it is still present after updating the
script/ directory, I think it would be better to investigate that separately.