Skip to content

Commit

Permalink
test: hopefully fix quick-assign zq tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 committed Aug 20, 2023
1 parent aee731b commit 2a31427
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/new_subscr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
#ifdef IS_PLAYER
extern int32_t directItem;
extern sprite_list Lwpns;

#define ALLOW_NULL_WIDGET replay_version_check(0,19)
#else
#define ALLOW_NULL_WIDGET is_zq_replay_test
extern bool is_zq_replay_test;
#endif


Expand Down Expand Up @@ -3329,13 +3334,15 @@ SubscrWidget* SubscrWidget::fromOld(subscreen_object const& old)
return new SW_SelectedText(old);
case ssoITEM:
{
if(!ALLOW_NULL_WIDGET) break;
SubscrWidget* ret = new SubscrWidget(old);
ret->w = 16;
ret->h = 16;
return ret;
}
case ssoICON:
{
if(!ALLOW_NULL_WIDGET) break;
SubscrWidget* ret = new SubscrWidget(old);
ret->w = 8;
ret->h = 8;
Expand Down Expand Up @@ -3441,6 +3448,10 @@ SubscrWidget* SubscrWidget::newType(byte ty)
case widgSELECTEDTEXT:
widg = new SW_SelectedText();
break;
case widgNULL:
if(!ALLOW_NULL_WIDGET) break;
widg = new SubscrWidget();
break;
}
return widg;
}
Expand Down
2 changes: 2 additions & 0 deletions src/zq/zquest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ extern CConsoleLoggerEx zscript_coloured_console;

uint8_t console_is_open = 0;
uint8_t __isZQuest = 1; //Shared functionscan reference this. -Z
bool is_zq_replay_test = false;

#include "base/util.h"

Expand Down Expand Up @@ -27471,6 +27472,7 @@ int32_t main(int32_t argc,char **argv)
int quick_assign_arg = used_switch(argc, argv, "-quick-assign");
if (quick_assign_arg > 0)
{
is_zq_replay_test = true;
set_headless_mode();

int load_ret = load_quest(argv[quick_assign_arg + 1], false);
Expand Down
1 change: 0 additions & 1 deletion tests/test_zquest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def run_replay(self, output_dir, args):
return output.returncode, ReplayTestResults(**test_results_json)

def test_zquest_compile_and_quick_assign(self):
return #TEMPORARY newsubscr2 BRANCH
# TODO: set this via CLI
include_paths = [
str(root_dir / 'tests/scripts'),
Expand Down

0 comments on commit 2a31427

Please sign in to comment.