From 8f772a2948445872585917d6d481ff7cfc991c6b Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Sat, 5 Mar 2022 23:03:22 +0000 Subject: [PATCH] More ambitious test cases added --- .../_Console_Ideal/actionextension-G.txt | 1 + .../_Console_Ideal/actionextension.txt | 1 + .../_Console_Ideal/classcopytest-G.txt | 1 + .../_Console_Ideal/classcopytest.txt | 1 + .../_Console_Ideal/classordertest-G.txt | 1 + .../_Console_Ideal/classordertest.txt | 1 + .../_Console_Ideal/dictflagtest-G.txt | 1 + .../_Console_Ideal/dictflagtest.txt | 1 + .../_Console_Ideal/glulxercise-G.txt | 1 + .../_Console_Ideal/ifelsedirecttest-G.txt | 1 + .../_Console_Ideal/ifelsedirecttest.txt | 1 + .../_Console_Ideal/internaldirecttest-G.txt | 1 + .../_Console_Ideal/internaldirecttest.txt | 1 + .../_Console_Ideal/minimal_test-G.txt | 1 + .../_Console_Ideal/minimal_test_z3.txt | 1 + .../_Console_Ideal/minimal_test_z4.txt | 1 + .../_Console_Ideal/minimal_test_z5.txt | 1 + .../_Console_Ideal/minimal_test_z6.txt | 1 + .../_Console_Ideal/minimal_test_z6_bigmem.txt | 1 + .../_Console_Ideal/minimal_test_z7.txt | 1 + .../_Console_Ideal/minimal_test_z7_bigmem.txt | 1 + .../_Console_Ideal/minimal_test_z8.txt | 1 + .../_Console_Ideal/replacerecursetest-G.txt | 1 + .../_Console_Ideal/replacerecursetest.txt | 1 + .../_Console_Ideal/static_text_test-G.txt | 258 + .../_Console_Ideal/staticarraytest-G.txt | 1 + .../_Console_Ideal/staticarraytest.txt | 1 + .../_Console_Ideal/undefdirectivetest-G.txt | 1 + .../_Console_Ideal/undefdirectivetest.txt | 1 + .../Test Cases/_Scripts/glulxercise-G.txt | 2 + .../large_opcode_text_test.txt | 0 .../max_abbrevs_test_96_ma_96.txt | 0 .../max_abbrevs_test_96_mds_0.txt | 0 .../max_adjectives_256_gv2.txt | 0 .../max_common_props_test_280_ips_284-G.txt | 0 ...max_dynamic_strings_test_at63_mds_64-G.txt | 0 .../max_dynamic_strings_test_at95_ma_0.txt | 0 .../max_dynamic_strings_test_at95_mds_96.txt | 0 .../max_dynamic_strings_test_str63.txt | 0 .../max_dynamic_strings_test_str64_ma_31.txt | 0 ...ax_dynamic_strings_test_str64_mds_65-G.txt | 0 .../max_static_data_test_mqs_8001-G.txt | 0 .../max_static_data_test_mqs_8001.txt | 0 .../_Settings/minimal_test_z3.txt} | 0 .../Test Cases/_Settings/minimal_test_z4.txt | 1 + .../Test Cases/_Settings/minimal_test_z5.txt | 1 + .../Test Cases/_Settings/minimal_test_z6.txt | 1 + .../_Settings/minimal_test_z6_bigmem.txt | 1 + .../Test Cases/_Settings/minimal_test_z7.txt | 1 + .../_Settings/minimal_test_z7_bigmem.txt | 1 + .../Test Cases/_Settings/minimal_test_z8.txt | 1 + .../_Transcript_Ideal/actionextension-G.txt | 57 + .../_Transcript_Ideal/actionextension.txt | 57 + .../_Transcript_Ideal/classcopytest-G.txt | 36 + .../_Transcript_Ideal/classcopytest.txt | 36 + .../_Transcript_Ideal/classordertest-G.txt | 53 + .../_Transcript_Ideal/classordertest.txt | 53 + .../_Transcript_Ideal/dictflagtest-G.txt | 50 + .../_Transcript_Ideal/dictflagtest.txt | 45 + .../_Transcript_Ideal/ifelsedirecttest-G.txt | 27 + .../_Transcript_Ideal/ifelsedirecttest.txt | 26 + .../internaldirecttest-G.txt | 31 + .../_Transcript_Ideal/internaldirecttest.txt | 30 + .../_Transcript_Ideal/minimal_test-G.txt | 0 .../_Transcript_Ideal/minimal_test_z3.txt | 0 .../_Transcript_Ideal/minimal_test_z4.txt | 0 .../_Transcript_Ideal/minimal_test_z5.txt | 0 .../_Transcript_Ideal/minimal_test_z6.txt | 0 .../minimal_test_z6_bigmem.txt | 0 .../_Transcript_Ideal/minimal_test_z7.txt | 0 .../minimal_test_z7_bigmem.txt | 0 .../_Transcript_Ideal/minimal_test_z8.txt | 0 .../replacerecursetest-G.txt | 32 + .../_Transcript_Ideal/replacerecursetest.txt | 31 + .../_Transcript_Ideal/static_text_test-G.txt | 0 .../_Transcript_Ideal/staticarraytest-G.txt | 106 + .../_Transcript_Ideal/staticarraytest.txt | 106 + .../undefdirectivetest-G.txt | 13 + .../_Transcript_Ideal/undefdirectivetest.txt | 12 + .../_md5_Ideal/actionextension-G.txt | 1 + .../Test Cases/_md5_Ideal/actionextension.txt | 1 + .../Test Cases/_md5_Ideal/classcopytest-G.txt | 1 + .../Test Cases/_md5_Ideal/classcopytest.txt | 1 + .../_md5_Ideal/classordertest-G.txt | 1 + .../Test Cases/_md5_Ideal/classordertest.txt | 1 + .../Test Cases/_md5_Ideal/dictflagtest-G.txt | 1 + .../Test Cases/_md5_Ideal/dictflagtest.txt | 1 + .../Test Cases/_md5_Ideal/glulxercise-G.txt | 1 + .../_md5_Ideal/ifelsedirecttest-G.txt | 1 + .../_md5_Ideal/ifelsedirecttest.txt | 1 + .../_md5_Ideal/internaldirecttest-G.txt | 1 + .../_md5_Ideal/internaldirecttest.txt | 1 + .../Test Cases/_md5_Ideal/minimal_test-G.txt | 1 + .../Test Cases/_md5_Ideal/minimal_test_z3.txt | 1 + .../Test Cases/_md5_Ideal/minimal_test_z4.txt | 1 + .../Test Cases/_md5_Ideal/minimal_test_z5.txt | 1 + .../Test Cases/_md5_Ideal/minimal_test_z6.txt | 1 + .../_md5_Ideal/minimal_test_z6_bigmem.txt | 1 + .../Test Cases/_md5_Ideal/minimal_test_z7.txt | 1 + .../_md5_Ideal/minimal_test_z7_bigmem.txt | 1 + .../Test Cases/_md5_Ideal/minimal_test_z8.txt | 1 + .../_md5_Ideal/replacerecursetest-G.txt | 1 + .../_md5_Ideal/replacerecursetest.txt | 1 + .../_md5_Ideal/staticarraytest-G.txt | 1 + .../Test Cases/_md5_Ideal/staticarraytest.txt | 1 + .../_md5_Ideal/undefdirectivetest-G.txt | 1 + .../_md5_Ideal/undefdirectivetest.txt | 1 + .../Tests/Test Cases/actionextension-G.inf | 292 + inform6/Tests/Test Cases/actionextension.inf | 292 + inform6/Tests/Test Cases/classcopytest-G.inf | 205 + inform6/Tests/Test Cases/classcopytest.inf | 205 + inform6/Tests/Test Cases/classordertest-G.inf | 262 + inform6/Tests/Test Cases/classordertest.inf | 262 + inform6/Tests/Test Cases/dictflagtest-G.inf | 326 + inform6/Tests/Test Cases/dictflagtest.inf | 326 + inform6/Tests/Test Cases/glulxercise-G.inf | 10548 ++++++++++++++++ .../Tests/Test Cases/ifelsedirecttest-G.inf | 360 + inform6/Tests/Test Cases/ifelsedirecttest.inf | 360 + .../Tests/Test Cases/internaldirecttest-G.inf | 345 + .../Tests/Test Cases/internaldirecttest.inf | 345 + inform6/Tests/Test Cases/minimal_test-G.inf | 4 + inform6/Tests/Test Cases/minimal_test_z3.inf | 4 + inform6/Tests/Test Cases/minimal_test_z4.inf | 4 + inform6/Tests/Test Cases/minimal_test_z5.inf | 4 + inform6/Tests/Test Cases/minimal_test_z6.inf | 4 + .../Test Cases/minimal_test_z6_bigmem.inf | 4 + inform6/Tests/Test Cases/minimal_test_z7.inf | 4 + .../Test Cases/minimal_test_z7_bigmem.inf | 4 + inform6/Tests/Test Cases/minimal_test_z8.inf | 4 + .../Tests/Test Cases/replacerecursetest-G.inf | 238 + .../Tests/Test Cases/replacerecursetest.inf | 238 + .../Tests/Test Cases/static_text_test-G.inf | 259 + .../Tests/Test Cases/staticarraytest-G.inf | 350 + inform6/Tests/Test Cases/staticarraytest.inf | 350 + .../Tests/Test Cases/undefdirectivetest-G.inf | 234 + .../Tests/Test Cases/undefdirectivetest.inf | 234 + .../max_abbrevs_test_100_ma96.txt | 0 .../max_abbrevs_test_64_ma_63.txt | 0 .../max_abbrevs_test_96_ma_95.txt | 0 .../max_common_props_test_280_ips_283-G.txt | 0 .../_Settings/max_common_props_test_z3.txt | 1 + ...max_dynamic_strings_test_at64_mds_64-G.txt | 0 .../max_dynamic_strings_test_at95_ma_1.txt | 0 .../max_dynamic_strings_test_at95_mds_95.txt | 0 ...max_dynamic_strings_test_at99_mds_99-G.txt | 0 ...ax_dynamic_strings_test_str64_mds_64-G.txt | 0 .../max_switch_case_values_se_0.txt | 0 inform6/Tests/inform6.intest | 15 +- 148 files changed, 17204 insertions(+), 3 deletions(-) create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/actionextension-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/actionextension.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/classcopytest-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/classcopytest.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/classordertest-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/classordertest.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/dictflagtest-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/dictflagtest.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/glulxercise-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/ifelsedirecttest-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/ifelsedirecttest.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/internaldirecttest-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/internaldirecttest.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z3.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z4.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z5.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z6.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z6_bigmem.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z7.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z7_bigmem.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z8.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/replacerecursetest-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/replacerecursetest.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/static_text_test-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/staticarraytest-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/staticarraytest.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/undefdirectivetest-G.txt create mode 100644 inform6/Tests/Test Cases/_Console_Ideal/undefdirectivetest.txt create mode 100755 inform6/Tests/Test Cases/_Scripts/glulxercise-G.txt rename inform6/Tests/Test Cases/{Settings => _Settings}/large_opcode_text_test.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_abbrevs_test_96_ma_96.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_abbrevs_test_96_mds_0.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_adjectives_256_gv2.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_common_props_test_280_ips_284-G.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_dynamic_strings_test_at63_mds_64-G.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_dynamic_strings_test_at95_ma_0.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_dynamic_strings_test_at95_mds_96.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_dynamic_strings_test_str63.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_dynamic_strings_test_str64_ma_31.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_dynamic_strings_test_str64_mds_65-G.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_static_data_test_mqs_8001-G.txt (100%) rename inform6/Tests/Test Cases/{Settings => _Settings}/max_static_data_test_mqs_8001.txt (100%) rename inform6/Tests/{Test Errors/Settings/max_common_props_test_z3.txt => Test Cases/_Settings/minimal_test_z3.txt} (100%) create mode 100644 inform6/Tests/Test Cases/_Settings/minimal_test_z4.txt create mode 100644 inform6/Tests/Test Cases/_Settings/minimal_test_z5.txt create mode 100644 inform6/Tests/Test Cases/_Settings/minimal_test_z6.txt create mode 100644 inform6/Tests/Test Cases/_Settings/minimal_test_z6_bigmem.txt create mode 100644 inform6/Tests/Test Cases/_Settings/minimal_test_z7.txt create mode 100644 inform6/Tests/Test Cases/_Settings/minimal_test_z7_bigmem.txt create mode 100644 inform6/Tests/Test Cases/_Settings/minimal_test_z8.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/actionextension-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/actionextension.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/classcopytest-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/classcopytest.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/classordertest-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/classordertest.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/dictflagtest-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/dictflagtest.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/ifelsedirecttest-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/ifelsedirecttest.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/internaldirecttest-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/internaldirecttest.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z3.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z4.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z5.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z6.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z6_bigmem.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z7.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z7_bigmem.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z8.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/replacerecursetest-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/replacerecursetest.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/static_text_test-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/staticarraytest-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/staticarraytest.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/undefdirectivetest-G.txt create mode 100644 inform6/Tests/Test Cases/_Transcript_Ideal/undefdirectivetest.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/actionextension-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/actionextension.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/classcopytest-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/classcopytest.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/classordertest-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/classordertest.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/dictflagtest-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/dictflagtest.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/glulxercise-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/ifelsedirecttest-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/ifelsedirecttest.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/internaldirecttest-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/internaldirecttest.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z3.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z4.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z5.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z6.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z6_bigmem.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z7.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z7_bigmem.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z8.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/replacerecursetest-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/replacerecursetest.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/staticarraytest-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/staticarraytest.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/undefdirectivetest-G.txt create mode 100644 inform6/Tests/Test Cases/_md5_Ideal/undefdirectivetest.txt create mode 100755 inform6/Tests/Test Cases/actionextension-G.inf create mode 100755 inform6/Tests/Test Cases/actionextension.inf create mode 100755 inform6/Tests/Test Cases/classcopytest-G.inf create mode 100755 inform6/Tests/Test Cases/classcopytest.inf create mode 100755 inform6/Tests/Test Cases/classordertest-G.inf create mode 100755 inform6/Tests/Test Cases/classordertest.inf create mode 100755 inform6/Tests/Test Cases/dictflagtest-G.inf create mode 100755 inform6/Tests/Test Cases/dictflagtest.inf create mode 100755 inform6/Tests/Test Cases/glulxercise-G.inf create mode 100755 inform6/Tests/Test Cases/ifelsedirecttest-G.inf create mode 100755 inform6/Tests/Test Cases/ifelsedirecttest.inf create mode 100755 inform6/Tests/Test Cases/internaldirecttest-G.inf create mode 100755 inform6/Tests/Test Cases/internaldirecttest.inf create mode 100755 inform6/Tests/Test Cases/minimal_test-G.inf create mode 100755 inform6/Tests/Test Cases/minimal_test_z3.inf create mode 100755 inform6/Tests/Test Cases/minimal_test_z4.inf create mode 100755 inform6/Tests/Test Cases/minimal_test_z5.inf create mode 100755 inform6/Tests/Test Cases/minimal_test_z6.inf create mode 100755 inform6/Tests/Test Cases/minimal_test_z6_bigmem.inf create mode 100755 inform6/Tests/Test Cases/minimal_test_z7.inf create mode 100755 inform6/Tests/Test Cases/minimal_test_z7_bigmem.inf create mode 100755 inform6/Tests/Test Cases/minimal_test_z8.inf create mode 100755 inform6/Tests/Test Cases/replacerecursetest-G.inf create mode 100755 inform6/Tests/Test Cases/replacerecursetest.inf create mode 100755 inform6/Tests/Test Cases/static_text_test-G.inf create mode 100755 inform6/Tests/Test Cases/staticarraytest-G.inf create mode 100755 inform6/Tests/Test Cases/staticarraytest.inf create mode 100755 inform6/Tests/Test Cases/undefdirectivetest-G.inf create mode 100755 inform6/Tests/Test Cases/undefdirectivetest.inf rename inform6/Tests/Test Errors/{Settings => _Settings}/max_abbrevs_test_100_ma96.txt (100%) rename inform6/Tests/Test Errors/{Settings => _Settings}/max_abbrevs_test_64_ma_63.txt (100%) rename inform6/Tests/Test Errors/{Settings => _Settings}/max_abbrevs_test_96_ma_95.txt (100%) rename inform6/Tests/Test Errors/{Settings => _Settings}/max_common_props_test_280_ips_283-G.txt (100%) create mode 100644 inform6/Tests/Test Errors/_Settings/max_common_props_test_z3.txt rename inform6/Tests/Test Errors/{Settings => _Settings}/max_dynamic_strings_test_at64_mds_64-G.txt (100%) rename inform6/Tests/Test Errors/{Settings => _Settings}/max_dynamic_strings_test_at95_ma_1.txt (100%) rename inform6/Tests/Test Errors/{Settings => _Settings}/max_dynamic_strings_test_at95_mds_95.txt (100%) rename inform6/Tests/Test Errors/{Settings => _Settings}/max_dynamic_strings_test_at99_mds_99-G.txt (100%) rename inform6/Tests/Test Errors/{Settings => _Settings}/max_dynamic_strings_test_str64_mds_64-G.txt (100%) rename inform6/Tests/Test Errors/{Settings => _Settings}/max_switch_case_values_se_0.txt (100%) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/actionextension-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/actionextension-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/actionextension-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/actionextension.txt b/inform6/Tests/Test Cases/_Console_Ideal/actionextension.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/actionextension.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/classcopytest-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/classcopytest-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/classcopytest-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/classcopytest.txt b/inform6/Tests/Test Cases/_Console_Ideal/classcopytest.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/classcopytest.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/classordertest-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/classordertest-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/classordertest-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/classordertest.txt b/inform6/Tests/Test Cases/_Console_Ideal/classordertest.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/classordertest.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/dictflagtest-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/dictflagtest-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/dictflagtest-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/dictflagtest.txt b/inform6/Tests/Test Cases/_Console_Ideal/dictflagtest.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/dictflagtest.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/glulxercise-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/glulxercise-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/glulxercise-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/ifelsedirecttest-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/ifelsedirecttest-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/ifelsedirecttest-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/ifelsedirecttest.txt b/inform6/Tests/Test Cases/_Console_Ideal/ifelsedirecttest.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/ifelsedirecttest.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/internaldirecttest-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/internaldirecttest-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/internaldirecttest-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/internaldirecttest.txt b/inform6/Tests/Test Cases/_Console_Ideal/internaldirecttest.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/internaldirecttest.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z3.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z3.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z3.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z4.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z4.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z4.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z5.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z5.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z5.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z6.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z6.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z6.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z6_bigmem.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z6_bigmem.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z6_bigmem.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z7.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z7.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z7.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z7_bigmem.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z7_bigmem.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z7_bigmem.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z8.txt b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z8.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/minimal_test_z8.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/replacerecursetest-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/replacerecursetest-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/replacerecursetest-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/replacerecursetest.txt b/inform6/Tests/Test Cases/_Console_Ideal/replacerecursetest.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/replacerecursetest.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/static_text_test-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/static_text_test-G.txt new file mode 100644 index 000000000..3858a3d51 --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/static_text_test-G.txt @@ -0,0 +1,258 @@ +Inform 6.36 (24th January 2022) +line 4: Warning: Defined constant "str_0" declared but not used +line 5: Warning: Defined constant "str_1" declared but not used +line 6: Warning: Defined constant "str_2" declared but not used +line 7: Warning: Defined constant "str_3" declared but not used +line 8: Warning: Defined constant "str_4" declared but not used +line 9: Warning: Defined constant "str_5" declared but not used +line 10: Warning: Defined constant "str_6" declared but not used +line 11: Warning: Defined constant "str_7" declared but not used +line 12: Warning: Defined constant "str_8" declared but not used +line 13: Warning: Defined constant "str_9" declared but not used +line 14: Warning: Defined constant "str_10" declared but not used +line 15: Warning: Defined constant "str_11" declared but not used +line 16: Warning: Defined constant "str_12" declared but not used +line 17: Warning: Defined constant "str_13" declared but not used +line 18: Warning: Defined constant "str_14" declared but not used +line 19: Warning: Defined constant "str_15" declared but not used +line 20: Warning: Defined constant "str_16" declared but not used +line 21: Warning: Defined constant "str_17" declared but not used +line 22: Warning: Defined constant "str_18" declared but not used +line 23: Warning: Defined constant "str_19" declared but not used +line 24: Warning: Defined constant "str_20" declared but not used +line 25: Warning: Defined constant "str_21" declared but not used +line 26: Warning: Defined constant "str_22" declared but not used +line 27: Warning: Defined constant "str_23" declared but not used +line 28: Warning: Defined constant "str_24" declared but not used +line 29: Warning: Defined constant "str_25" declared but not used +line 30: Warning: Defined constant "str_26" declared but not used +line 31: Warning: Defined constant "str_27" declared but not used +line 32: Warning: Defined constant "str_28" declared but not used +line 33: Warning: Defined constant "str_29" declared but not used +line 34: Warning: Defined constant "str_30" declared but not used +line 35: Warning: Defined constant "str_31" declared but not used +line 36: Warning: Defined constant "str_32" declared but not used +line 37: Warning: Defined constant "str_33" declared but not used +line 38: Warning: Defined constant "str_34" declared but not used +line 39: Warning: Defined constant "str_35" declared but not used +line 40: Warning: Defined constant "str_36" declared but not used +line 41: Warning: Defined constant "str_37" declared but not used +line 42: Warning: Defined constant "str_38" declared but not used +line 43: Warning: Defined constant "str_39" declared but not used +line 44: Warning: Defined constant "str_40" declared but not used +line 45: Warning: Defined constant "str_41" declared but not used +line 46: Warning: Defined constant "str_42" declared but not used +line 47: Warning: Defined constant "str_43" declared but not used +line 48: Warning: Defined constant "str_44" declared but not used +line 49: Warning: Defined constant "str_45" declared but not used +line 50: Warning: Defined constant "str_46" declared but not used +line 51: Warning: Defined constant "str_47" declared but not used +line 52: Warning: Defined constant "str_48" declared but not used +line 53: Warning: Defined constant "str_49" declared but not used +line 54: Warning: Defined constant "str_50" declared but not used +line 55: Warning: Defined constant "str_51" declared but not used +line 56: Warning: Defined constant "str_52" declared but not used +line 57: Warning: Defined constant "str_53" declared but not used +line 58: Warning: Defined constant "str_54" declared but not used +line 59: Warning: Defined constant "str_55" declared but not used +line 60: Warning: Defined constant "str_56" declared but not used +line 61: Warning: Defined constant "str_57" declared but not used +line 62: Warning: Defined constant "str_58" declared but not used +line 63: Warning: Defined constant "str_59" declared but not used +line 64: Warning: Defined constant "str_60" declared but not used +line 65: Warning: Defined constant "str_61" declared but not used +line 66: Warning: Defined constant "str_62" declared but not used +line 67: Warning: Defined constant "str_63" declared but not used +line 68: Warning: Defined constant "str_64" declared but not used +line 69: Warning: Defined constant "str_65" declared but not used +line 70: Warning: Defined constant "str_66" declared but not used +line 71: Warning: Defined constant "str_67" declared but not used +line 72: Warning: Defined constant "str_68" declared but not used +line 73: Warning: Defined constant "str_69" declared but not used +line 74: Warning: Defined constant "str_70" declared but not used +line 75: Warning: Defined constant "str_71" declared but not used +line 76: Warning: Defined constant "str_72" declared but not used +line 77: Warning: Defined constant "str_73" declared but not used +line 78: Warning: Defined constant "str_74" declared but not used +line 79: Warning: Defined constant "str_75" declared but not used +line 80: Warning: Defined constant "str_76" declared but not used +line 81: Warning: Defined constant "str_77" declared but not used +line 82: Warning: Defined constant "str_78" declared but not used +line 83: Warning: Defined constant "str_79" declared but not used +line 84: Warning: Defined constant "str_80" declared but not used +line 85: Warning: Defined constant "str_81" declared but not used +line 86: Warning: Defined constant "str_82" declared but not used +line 87: Warning: Defined constant "str_83" declared but not used +line 88: Warning: Defined constant "str_84" declared but not used +line 89: Warning: Defined constant "str_85" declared but not used +line 90: Warning: Defined constant "str_86" declared but not used +line 91: Warning: Defined constant "str_87" declared but not used +line 92: Warning: Defined constant "str_88" declared but not used +line 93: Warning: Defined constant "str_89" declared but not used +line 94: Warning: Defined constant "str_90" declared but not used +line 95: Warning: Defined constant "str_91" declared but not used +line 96: Warning: Defined constant "str_92" declared but not used +line 97: Warning: Defined constant "str_93" declared but not used +line 98: Warning: Defined constant "str_94" declared but not used +line 99: Warning: Defined constant "str_95" declared but not used +line 100: Warning: Defined constant "str_96" declared but not used +line 101: Warning: Defined constant "str_97" declared but not used +line 102: Warning: Defined constant "str_98" declared but not used +line 103: Warning: Defined constant "str_99" declared but not used +line 104: Warning: Defined constant "str_100" declared but not used +line 105: Warning: Defined constant "str_101" declared but not used +line 106: Warning: Defined constant "str_102" declared but not used +line 107: Warning: Defined constant "str_103" declared but not used +line 108: Warning: Defined constant "str_104" declared but not used +line 109: Warning: Defined constant "str_105" declared but not used +line 110: Warning: Defined constant "str_106" declared but not used +line 111: Warning: Defined constant "str_107" declared but not used +line 112: Warning: Defined constant "str_108" declared but not used +line 113: Warning: Defined constant "str_109" declared but not used +line 114: Warning: Defined constant "str_110" declared but not used +line 115: Warning: Defined constant "str_111" declared but not used +line 116: Warning: Defined constant "str_112" declared but not used +line 117: Warning: Defined constant "str_113" declared but not used +line 118: Warning: Defined constant "str_114" declared but not used +line 119: Warning: Defined constant "str_115" declared but not used +line 120: Warning: Defined constant "str_116" declared but not used +line 121: Warning: Defined constant "str_117" declared but not used +line 122: Warning: Defined constant "str_118" declared but not used +line 123: Warning: Defined constant "str_119" declared but not used +line 124: Warning: Defined constant "str_120" declared but not used +line 125: Warning: Defined constant "str_121" declared but not used +line 126: Warning: Defined constant "str_122" declared but not used +line 127: Warning: Defined constant "str_123" declared but not used +line 128: Warning: Defined constant "str_124" declared but not used +line 129: Warning: Defined constant "str_125" declared but not used +line 130: Warning: Defined constant "str_126" declared but not used +line 131: Warning: Defined constant "str_127" declared but not used +line 132: Warning: Defined constant "str_128" declared but not used +line 133: Warning: Defined constant "str_129" declared but not used +line 134: Warning: Defined constant "str_130" declared but not used +line 135: Warning: Defined constant "str_131" declared but not used +line 136: Warning: Defined constant "str_132" declared but not used +line 137: Warning: Defined constant "str_133" declared but not used +line 138: Warning: Defined constant "str_134" declared but not used +line 139: Warning: Defined constant "str_135" declared but not used +line 140: Warning: Defined constant "str_136" declared but not used +line 141: Warning: Defined constant "str_137" declared but not used +line 142: Warning: Defined constant "str_138" declared but not used +line 143: Warning: Defined constant "str_139" declared but not used +line 144: Warning: Defined constant "str_140" declared but not used +line 145: Warning: Defined constant "str_141" declared but not used +line 146: Warning: Defined constant "str_142" declared but not used +line 147: Warning: Defined constant "str_143" declared but not used +line 148: Warning: Defined constant "str_144" declared but not used +line 149: Warning: Defined constant "str_145" declared but not used +line 150: Warning: Defined constant "str_146" declared but not used +line 151: Warning: Defined constant "str_147" declared but not used +line 152: Warning: Defined constant "str_148" declared but not used +line 153: Warning: Defined constant "str_149" declared but not used +line 154: Warning: Defined constant "str_150" declared but not used +line 155: Warning: Defined constant "str_151" declared but not used +line 156: Warning: Defined constant "str_152" declared but not used +line 157: Warning: Defined constant "str_153" declared but not used +line 158: Warning: Defined constant "str_154" declared but not used +line 159: Warning: Defined constant "str_155" declared but not used +line 160: Warning: Defined constant "str_156" declared but not used +line 161: Warning: Defined constant "str_157" declared but not used +line 162: Warning: Defined constant "str_158" declared but not used +line 163: Warning: Defined constant "str_159" declared but not used +line 164: Warning: Defined constant "str_160" declared but not used +line 165: Warning: Defined constant "str_161" declared but not used +line 166: Warning: Defined constant "str_162" declared but not used +line 167: Warning: Defined constant "str_163" declared but not used +line 168: Warning: Defined constant "str_164" declared but not used +line 169: Warning: Defined constant "str_165" declared but not used +line 170: Warning: Defined constant "str_166" declared but not used +line 171: Warning: Defined constant "str_167" declared but not used +line 172: Warning: Defined constant "str_168" declared but not used +line 173: Warning: Defined constant "str_169" declared but not used +line 174: Warning: Defined constant "str_170" declared but not used +line 175: Warning: Defined constant "str_171" declared but not used +line 176: Warning: Defined constant "str_172" declared but not used +line 177: Warning: Defined constant "str_173" declared but not used +line 178: Warning: Defined constant "str_174" declared but not used +line 179: Warning: Defined constant "str_175" declared but not used +line 180: Warning: Defined constant "str_176" declared but not used +line 181: Warning: Defined constant "str_177" declared but not used +line 182: Warning: Defined constant "str_178" declared but not used +line 183: Warning: Defined constant "str_179" declared but not used +line 184: Warning: Defined constant "str_180" declared but not used +line 185: Warning: Defined constant "str_181" declared but not used +line 186: Warning: Defined constant "str_182" declared but not used +line 187: Warning: Defined constant "str_183" declared but not used +line 188: Warning: Defined constant "str_184" declared but not used +line 189: Warning: Defined constant "str_185" declared but not used +line 190: Warning: Defined constant "str_186" declared but not used +line 191: Warning: Defined constant "str_187" declared but not used +line 192: Warning: Defined constant "str_188" declared but not used +line 193: Warning: Defined constant "str_189" declared but not used +line 194: Warning: Defined constant "str_190" declared but not used +line 195: Warning: Defined constant "str_191" declared but not used +line 196: Warning: Defined constant "str_192" declared but not used +line 197: Warning: Defined constant "str_193" declared but not used +line 198: Warning: Defined constant "str_194" declared but not used +line 199: Warning: Defined constant "str_195" declared but not used +line 200: Warning: Defined constant "str_196" declared but not used +line 201: Warning: Defined constant "str_197" declared but not used +line 202: Warning: Defined constant "str_198" declared but not used +line 203: Warning: Defined constant "str_199" declared but not used +line 204: Warning: Defined constant "str_200" declared but not used +line 205: Warning: Defined constant "str_201" declared but not used +line 206: Warning: Defined constant "str_202" declared but not used +line 207: Warning: Defined constant "str_203" declared but not used +line 208: Warning: Defined constant "str_204" declared but not used +line 209: Warning: Defined constant "str_205" declared but not used +line 210: Warning: Defined constant "str_206" declared but not used +line 211: Warning: Defined constant "str_207" declared but not used +line 212: Warning: Defined constant "str_208" declared but not used +line 213: Warning: Defined constant "str_209" declared but not used +line 214: Warning: Defined constant "str_210" declared but not used +line 215: Warning: Defined constant "str_211" declared but not used +line 216: Warning: Defined constant "str_212" declared but not used +line 217: Warning: Defined constant "str_213" declared but not used +line 218: Warning: Defined constant "str_214" declared but not used +line 219: Warning: Defined constant "str_215" declared but not used +line 220: Warning: Defined constant "str_216" declared but not used +line 221: Warning: Defined constant "str_217" declared but not used +line 222: Warning: Defined constant "str_218" declared but not used +line 223: Warning: Defined constant "str_219" declared but not used +line 224: Warning: Defined constant "str_220" declared but not used +line 225: Warning: Defined constant "str_221" declared but not used +line 226: Warning: Defined constant "str_222" declared but not used +line 227: Warning: Defined constant "str_223" declared but not used +line 228: Warning: Defined constant "str_224" declared but not used +line 229: Warning: Defined constant "str_225" declared but not used +line 230: Warning: Defined constant "str_226" declared but not used +line 231: Warning: Defined constant "str_227" declared but not used +line 232: Warning: Defined constant "str_228" declared but not used +line 233: Warning: Defined constant "str_229" declared but not used +line 234: Warning: Defined constant "str_230" declared but not used +line 235: Warning: Defined constant "str_231" declared but not used +line 236: Warning: Defined constant "str_232" declared but not used +line 237: Warning: Defined constant "str_233" declared but not used +line 238: Warning: Defined constant "str_234" declared but not used +line 239: Warning: Defined constant "str_235" declared but not used +line 240: Warning: Defined constant "str_236" declared but not used +line 241: Warning: Defined constant "str_237" declared but not used +line 242: Warning: Defined constant "str_238" declared but not used +line 243: Warning: Defined constant "str_239" declared but not used +line 244: Warning: Defined constant "str_240" declared but not used +line 245: Warning: Defined constant "str_241" declared but not used +line 246: Warning: Defined constant "str_242" declared but not used +line 247: Warning: Defined constant "str_243" declared but not used +line 248: Warning: Defined constant "str_244" declared but not used +line 249: Warning: Defined constant "str_245" declared but not used +line 250: Warning: Defined constant "str_246" declared but not used +line 251: Warning: Defined constant "str_247" declared but not used +line 252: Warning: Defined constant "str_248" declared but not used +line 253: Warning: Defined constant "str_249" declared but not used +line 254: Warning: Defined constant "str_250" declared but not used +line 255: Warning: Defined constant "str_251" declared but not used +line 256: Warning: Defined constant "str_252" declared but not used +line 257: Warning: Defined constant "str_253" declared but not used +line 258: Warning: Defined constant "str_254" declared but not used +line 259: Warning: Defined constant "str_255" declared but not used +Compiled with 256 warnings diff --git a/inform6/Tests/Test Cases/_Console_Ideal/staticarraytest-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/staticarraytest-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/staticarraytest-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/staticarraytest.txt b/inform6/Tests/Test Cases/_Console_Ideal/staticarraytest.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/staticarraytest.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/undefdirectivetest-G.txt b/inform6/Tests/Test Cases/_Console_Ideal/undefdirectivetest-G.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/undefdirectivetest-G.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Console_Ideal/undefdirectivetest.txt b/inform6/Tests/Test Cases/_Console_Ideal/undefdirectivetest.txt new file mode 100644 index 000000000..37a907b6b --- /dev/null +++ b/inform6/Tests/Test Cases/_Console_Ideal/undefdirectivetest.txt @@ -0,0 +1 @@ +Inform 6.36 (24th January 2022) diff --git a/inform6/Tests/Test Cases/_Scripts/glulxercise-G.txt b/inform6/Tests/Test Cases/_Scripts/glulxercise-G.txt new file mode 100755 index 000000000..2ed13b6fe --- /dev/null +++ b/inform6/Tests/Test Cases/_Scripts/glulxercise-G.txt @@ -0,0 +1,2 @@ +all +quit diff --git a/inform6/Tests/Test Cases/Settings/large_opcode_text_test.txt b/inform6/Tests/Test Cases/_Settings/large_opcode_text_test.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/large_opcode_text_test.txt rename to inform6/Tests/Test Cases/_Settings/large_opcode_text_test.txt diff --git a/inform6/Tests/Test Cases/Settings/max_abbrevs_test_96_ma_96.txt b/inform6/Tests/Test Cases/_Settings/max_abbrevs_test_96_ma_96.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_abbrevs_test_96_ma_96.txt rename to inform6/Tests/Test Cases/_Settings/max_abbrevs_test_96_ma_96.txt diff --git a/inform6/Tests/Test Cases/Settings/max_abbrevs_test_96_mds_0.txt b/inform6/Tests/Test Cases/_Settings/max_abbrevs_test_96_mds_0.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_abbrevs_test_96_mds_0.txt rename to inform6/Tests/Test Cases/_Settings/max_abbrevs_test_96_mds_0.txt diff --git a/inform6/Tests/Test Cases/Settings/max_adjectives_256_gv2.txt b/inform6/Tests/Test Cases/_Settings/max_adjectives_256_gv2.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_adjectives_256_gv2.txt rename to inform6/Tests/Test Cases/_Settings/max_adjectives_256_gv2.txt diff --git a/inform6/Tests/Test Cases/Settings/max_common_props_test_280_ips_284-G.txt b/inform6/Tests/Test Cases/_Settings/max_common_props_test_280_ips_284-G.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_common_props_test_280_ips_284-G.txt rename to inform6/Tests/Test Cases/_Settings/max_common_props_test_280_ips_284-G.txt diff --git a/inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_at63_mds_64-G.txt b/inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_at63_mds_64-G.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_at63_mds_64-G.txt rename to inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_at63_mds_64-G.txt diff --git a/inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_at95_ma_0.txt b/inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_at95_ma_0.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_at95_ma_0.txt rename to inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_at95_ma_0.txt diff --git a/inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_at95_mds_96.txt b/inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_at95_mds_96.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_at95_mds_96.txt rename to inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_at95_mds_96.txt diff --git a/inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_str63.txt b/inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_str63.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_str63.txt rename to inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_str63.txt diff --git a/inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_str64_ma_31.txt b/inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_str64_ma_31.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_str64_ma_31.txt rename to inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_str64_ma_31.txt diff --git a/inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_str64_mds_65-G.txt b/inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_str64_mds_65-G.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_dynamic_strings_test_str64_mds_65-G.txt rename to inform6/Tests/Test Cases/_Settings/max_dynamic_strings_test_str64_mds_65-G.txt diff --git a/inform6/Tests/Test Cases/Settings/max_static_data_test_mqs_8001-G.txt b/inform6/Tests/Test Cases/_Settings/max_static_data_test_mqs_8001-G.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_static_data_test_mqs_8001-G.txt rename to inform6/Tests/Test Cases/_Settings/max_static_data_test_mqs_8001-G.txt diff --git a/inform6/Tests/Test Cases/Settings/max_static_data_test_mqs_8001.txt b/inform6/Tests/Test Cases/_Settings/max_static_data_test_mqs_8001.txt similarity index 100% rename from inform6/Tests/Test Cases/Settings/max_static_data_test_mqs_8001.txt rename to inform6/Tests/Test Cases/_Settings/max_static_data_test_mqs_8001.txt diff --git a/inform6/Tests/Test Errors/Settings/max_common_props_test_z3.txt b/inform6/Tests/Test Cases/_Settings/minimal_test_z3.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_common_props_test_z3.txt rename to inform6/Tests/Test Cases/_Settings/minimal_test_z3.txt diff --git a/inform6/Tests/Test Cases/_Settings/minimal_test_z4.txt b/inform6/Tests/Test Cases/_Settings/minimal_test_z4.txt new file mode 100644 index 000000000..f6ae81361 --- /dev/null +++ b/inform6/Tests/Test Cases/_Settings/minimal_test_z4.txt @@ -0,0 +1 @@ +-v4 \ No newline at end of file diff --git a/inform6/Tests/Test Cases/_Settings/minimal_test_z5.txt b/inform6/Tests/Test Cases/_Settings/minimal_test_z5.txt new file mode 100644 index 000000000..68ea94d63 --- /dev/null +++ b/inform6/Tests/Test Cases/_Settings/minimal_test_z5.txt @@ -0,0 +1 @@ +-v5 \ No newline at end of file diff --git a/inform6/Tests/Test Cases/_Settings/minimal_test_z6.txt b/inform6/Tests/Test Cases/_Settings/minimal_test_z6.txt new file mode 100644 index 000000000..3a0341c73 --- /dev/null +++ b/inform6/Tests/Test Cases/_Settings/minimal_test_z6.txt @@ -0,0 +1 @@ +-v6 \ No newline at end of file diff --git a/inform6/Tests/Test Cases/_Settings/minimal_test_z6_bigmem.txt b/inform6/Tests/Test Cases/_Settings/minimal_test_z6_bigmem.txt new file mode 100644 index 000000000..936cc3688 --- /dev/null +++ b/inform6/Tests/Test Cases/_Settings/minimal_test_z6_bigmem.txt @@ -0,0 +1 @@ +-v6 -B \ No newline at end of file diff --git a/inform6/Tests/Test Cases/_Settings/minimal_test_z7.txt b/inform6/Tests/Test Cases/_Settings/minimal_test_z7.txt new file mode 100644 index 000000000..9e3c9bc1e --- /dev/null +++ b/inform6/Tests/Test Cases/_Settings/minimal_test_z7.txt @@ -0,0 +1 @@ +-v7 \ No newline at end of file diff --git a/inform6/Tests/Test Cases/_Settings/minimal_test_z7_bigmem.txt b/inform6/Tests/Test Cases/_Settings/minimal_test_z7_bigmem.txt new file mode 100644 index 000000000..e6107450d --- /dev/null +++ b/inform6/Tests/Test Cases/_Settings/minimal_test_z7_bigmem.txt @@ -0,0 +1 @@ +-v7 -B \ No newline at end of file diff --git a/inform6/Tests/Test Cases/_Settings/minimal_test_z8.txt b/inform6/Tests/Test Cases/_Settings/minimal_test_z8.txt new file mode 100644 index 000000000..b13e05604 --- /dev/null +++ b/inform6/Tests/Test Cases/_Settings/minimal_test_z8.txt @@ -0,0 +1 @@ +-v8 \ No newline at end of file diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/actionextension-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/actionextension-G.txt new file mode 100644 index 000000000..44791888c --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/actionextension-G.txt @@ -0,0 +1,57 @@ +ActionExtensionTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +The standard action syntax: +Action <1 0 0> +Action <2 13 0> +Action <2 14 0> +Action <3 18 6> +Action <1 19 -6> +Action <2 7116 44> +Action <3 55 0> +Action <2 0 0> +Action <21 0 0> +Action <30 40 0> +Action <20 30 40> +Action <21 22 23> +Action <30 37 33> +Action <37 31 38> +Action <21 0 10> +Action <30 7116 32000> +Action <1 31 21> +Action <5 6 0> +Action <3 62 93> +Action <1 24 31> +Action <41 0 0> +Action <43 42 0> +Action <46 45 44> + +The new action syntax: +Action <2 0 0, 1234> +Action <1 0 0, 7116> +Action <3 0 0, 20> +Action <2 0 0, 30> +Action <2 0 0, 1235> +Action <1 0 0, 7116> +Action <3 0 0, 20> +Action <2 0 0, 30> +Action <1 0 0, 7> +Action <1 6 0, 8> +Action <1 5 6, 9> +Action <2 0 0, 99> +Action <21 0 0, 31> +Action <30 40 0, 90> +Action <20 30 40, 33> +Action <30 37 33, 38> +Action <37 31 2, 38> +Action <21 0 10, 50> +Action <1 31 0, 21> +Action <5 0 0, 6> +Action <3 62 93, 124> +Action <1 25 31> +Action <42 0 0, 41> +Action <45 44 0, 43> +Action <49 48 47, 46> + +All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/actionextension.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/actionextension.txt new file mode 100644 index 000000000..f4d7ac5c5 --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/actionextension.txt @@ -0,0 +1,57 @@ + ActionExtensionTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + Game file format 5. + + The standard action syntax: + Action <1 0 0> + Action <2 13 0> + Action <2 14 0> + Action <3 18 6> + Action <1 19 -6> + Action <2 5 44> + Action <3 55 0> + Action <2 0 0> + Action <21 0 0> + Action <30 40 0> + Action <20 30 40> + Action <21 22 23> + Action <30 37 33> + Action <37 31 38> + Action <21 0 10> + Action <30 5 32000> + Action <1 31 21> + Action <5 6 0> + Action <3 62 93> + Action <1 24 31> + Action <41 0 0> + Action <43 42 0> + Action <46 45 44> + + The new action syntax: + Action <2 0 0, 1234> + Action <1 0 0, 5> + Action <3 0 0, 20> + Action <2 0 0, 30> + Action <2 0 0, 1235> + Action <1 0 0, 5> + Action <3 0 0, 20> + Action <2 0 0, 30> + Action <1 0 0, 7> + Action <1 6 0, 8> + Action <1 5 6, 9> + Action <2 0 0, 99> + Action <21 0 0, 31> + Action <30 40 0, 90> + Action <20 30 40, 33> + Action <30 37 33, 38> + Action <37 31 2, 38> + Action <21 0 10, 50> + Action <1 31 0, 21> + Action <5 0 0, 6> + Action <3 62 93, 124> + Action <1 25 31> + Action <42 0 0, 41> + Action <45 44 0, 43> + Action <49 48 47, 46> + + All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/classcopytest-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/classcopytest-G.txt new file mode 100644 index 000000000..72a73e408 --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/classcopytest-G.txt @@ -0,0 +1,36 @@ +ClassCopyTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +obj1.indprop: 12 +obj1.genprop: 33 +obj1.attr1: 0 +obj1.attr2: 1 +obj1.attr3: 1 +obj2.indprop: 12 +obj2.genprop: 33 +obj2.attr1: 0 +obj2.attr2: 1 +obj2.attr3: 1 +obj2.indprop: 4 +obj2.genprop: 4 +obj2.attr1: 0 +obj2.attr2: 1 +obj2.attr3: 0 +obj3.indprop: 5 +obj3.genprop: 6 +obj3.longprop[0]: 10 +obj3.attr1: 1 +obj3.attr2: 1 +obj3.attr3: 0 +obj3.indprop: 11 +obj3.genprop: 67 +obj3.longprop[0]: 10 +obj3.attr1: 1 +obj3.attr2: 1 +obj3.attr3: 0 +obj3.longprop[0]: 13 +obj3.longprop[1]: 114 +obj3.longprop[2]: 15 + +All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/classcopytest.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/classcopytest.txt new file mode 100644 index 000000000..ba5cd48f7 --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/classcopytest.txt @@ -0,0 +1,36 @@ + ClassCopyTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + Game file format 5. + + obj1.indprop: 12 + obj1.genprop: 33 + obj1.attr1: 0 + obj1.attr2: 1 + obj1.attr3: 1 + obj2.indprop: 12 + obj2.genprop: 33 + obj2.attr1: 0 + obj2.attr2: 1 + obj2.attr3: 1 + obj2.indprop: 4 + obj2.genprop: 4 + obj2.attr1: 0 + obj2.attr2: 1 + obj2.attr3: 0 + obj3.indprop: 5 + obj3.genprop: 6 + obj3.longprop[0]: 10 + obj3.attr1: 1 + obj3.attr2: 1 + obj3.attr3: 0 + obj3.indprop: 11 + obj3.genprop: 67 + obj3.longprop[0]: 10 + obj3.attr1: 1 + obj3.attr2: 1 + obj3.attr3: 0 + obj3.longprop[0]: 13 + obj3.longprop[1]: 114 + obj3.longprop[2]: 15 + + All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/classordertest-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/classordertest-G.txt new file mode 100644 index 000000000..4372d30c3 --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/classordertest-G.txt @@ -0,0 +1,53 @@ +ClassOrderTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +obj1.indprop: 11 +obj2.indprop: 22 +obj3.indprop: 4 +obj4.indprop: 5 +obj5.indprop: 6 +obj5a.indprop: 7 +obj6.indprop: 22 +obj7.indprop: 11 +obj11.indprop: 111 +obj12.indprop: 111 +obj12a.indprop: 111 +obj13.indprop: 22 +obj13a.indprop: 22 +obj3.genprop: 4 +obj6.genprop: 33 +obj7.genprop: 33 +obj8.genprop: 44 +obj8a.genprop: 44 +obj8.#addprop: 8 +obj8.addprop[0]: 55 +obj8.addprop[1]: 66 +obj9.#addprop: 12 +obj9.addprop[0]: 2 +obj9.addprop[1]: 88 +obj9.addprop[2]: 99 +obj10.#addprop: 24 +obj10.addprop[0]: 3 +obj10.addprop[1]: 4 +obj10.addprop[2]: 55 +obj10.addprop[3]: 66 +obj10.addprop[4]: 88 +obj10.addprop[5]: 99 +obj11.#addprop: 8 +obj11.addprop[0]: 777 +obj11.addprop[1]: 77 +obj1.attr1: 1 +obj2.attr1: 1 +obj3.attr1: 0 +obj11.attr1: 0 +obj12.attr1: 0 +obj13.attr1: 0 +obj8.attr2: 1 +obj9.attr2: 1 +obj10.attr2: 1 +obj11.attr2: 1 +obj12.attr2: 0 +obj13.attr2: 1 + +All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/classordertest.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/classordertest.txt new file mode 100644 index 000000000..35e73db26 --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/classordertest.txt @@ -0,0 +1,53 @@ + ClassOrderTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + Game file format 5. + + obj1.indprop: 11 + obj2.indprop: 22 + obj3.indprop: 4 + obj4.indprop: 5 + obj5.indprop: 6 + obj5a.indprop: 7 + obj6.indprop: 22 + obj7.indprop: 11 + obj11.indprop: 111 + obj12.indprop: 111 + obj12a.indprop: 111 + obj13.indprop: 22 + obj13a.indprop: 22 + obj3.genprop: 4 + obj6.genprop: 33 + obj7.genprop: 33 + obj8.genprop: 44 + obj8a.genprop: 44 + obj8.#addprop: 4 + obj8.addprop[0]: 55 + obj8.addprop[1]: 66 + obj9.#addprop: 6 + obj9.addprop[0]: 2 + obj9.addprop[1]: 88 + obj9.addprop[2]: 99 + obj10.#addprop: 12 + obj10.addprop[0]: 3 + obj10.addprop[1]: 4 + obj10.addprop[2]: 55 + obj10.addprop[3]: 66 + obj10.addprop[4]: 88 + obj10.addprop[5]: 99 + obj11.#addprop: 4 + obj11.addprop[0]: 777 + obj11.addprop[1]: 77 + obj1.attr1: 1 + obj2.attr1: 1 + obj3.attr1: 0 + obj11.attr1: 0 + obj12.attr1: 0 + obj13.attr1: 0 + obj8.attr2: 1 + obj9.attr2: 1 + obj10.attr2: 1 + obj11.attr2: 1 + obj12.attr2: 0 + obj13.attr2: 1 + + All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/dictflagtest-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/dictflagtest-G.txt new file mode 100644 index 000000000..169f3fb2a --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/dictflagtest-G.txt @@ -0,0 +1,50 @@ +DictFlagTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +$DICT_WORD_SIZE=9, #dict_par1=11, #dict_par2=13, #dict_par3=15. + +'plain' + flag values: $80 $0 $0 +'noun1' + flag values: $80 $0 $0 +'noun2' + flag values: $80 $0 $0 +'plural' + flag values: $84 $0 $0 +'pluname' + flag values: $84 $0 $0 +'verb' + flag values: $C1 $FFFF $0 +'meta' + flag values: $C3 $FFFD $0 +'prep' + flag values: $88 $0 $0 +'prep2' + flag values: $8 $0 $0 +'verb2' + flag values: $41 $FFFE $0 +'foo' + flag values: $80 $0 $0 +'foo2' + flag values: $0 $0 $0 +'bar' + flag values: $90 $0 $0 +'baz' + flag values: $92 $0 $5D +'dquot' + flag values: $81 $0 $1 +'pip' + flag values: $87 $0 $16 +'pop' + flag values: $84 $0 $FF +'merge' + flag values: $C3 $0 $61 +'mergeverb' + flag values: $C5 $FFFC $7B +'big' + flag values: $FFFF $0 $FFFF +'bigmerge' + flag values: $12B4 $0 $4321 + +Passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/dictflagtest.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/dictflagtest.txt new file mode 100644 index 000000000..0e09cdcba --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/dictflagtest.txt @@ -0,0 +1,45 @@ + DictFlagTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + + $DICT_WORD_SIZE=6, #dict_par1=6, #dict_par2=7, #dict_par3=8. + + 'plain' + flag values: $80 $0 $0 + 'noun1' + flag values: $80 $0 $0 + 'noun2' + flag values: $80 $0 $0 + 'plural' + flag values: $84 $0 $0 + 'pluname' + flag values: $84 $0 $0 + 'verb' + flag values: $C1 $FF $0 + 'meta' + flag values: $C3 $FD $0 + 'prep' + flag values: $88 $0 $0 + 'prep2' + flag values: $8 $0 $0 + 'verb2' + flag values: $41 $FE $0 + 'foo' + flag values: $80 $0 $0 + 'foo2' + flag values: $0 $0 $0 + 'bar' + flag values: $90 $0 $0 + 'baz' + flag values: $92 $0 $5D + 'dquot' + flag values: $81 $0 $1 + 'pip' + flag values: $87 $0 $16 + 'pop' + flag values: $84 $0 $FF + 'merge' + flag values: $C3 $0 $61 + 'mergeverb' + flag values: $C5 $FC $7B + + Passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/ifelsedirecttest-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/ifelsedirecttest-G.txt new file mode 100644 index 000000000..00e18988e --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/ifelsedirecttest-G.txt @@ -0,0 +1,27 @@ +IfElseDirectiveTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +3==3: 1. +3==5: -1. +3==2: -1. +3>3: -1. +3>5: -1. +3>2: 2. +5 or -1: 5. +0 or -1: -1. +5 or -2: 5. +0 or -2: -2. +GetAbs(3): 3. +GetAbs(-7): 7. +GetAbs(0): 0. +Path1(false): 3. +Path1(true): 1. +Path2(false): 4. +Path2(true): 1. +Path3(false): 3. +Path3(true): 2. +Path4(false): 4. +Path4(true): 2. + +All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/ifelsedirecttest.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/ifelsedirecttest.txt new file mode 100644 index 000000000..86d79094c --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/ifelsedirecttest.txt @@ -0,0 +1,26 @@ + IfElseDirectiveTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + + 3==3: 1. + 3==5: -1. + 3==2: -1. + 3>3: -1. + 3>5: -1. + 3>2: 2. + 5 or -1: 5. + 0 or -1: -1. + 5 or -2: 5. + 0 or -2: -2. + GetAbs(3): 3. + GetAbs(-7): 7. + GetAbs(0): 0. + Path1(false): 3. + Path1(true): 1. + Path2(false): 4. + Path2(true): 1. + Path3(false): 3. + Path3(true): 2. + Path4(false): 4. + Path4(true): 2. + + All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/internaldirecttest-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/internaldirecttest-G.txt new file mode 100644 index 000000000..fd74b03c4 --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/internaldirecttest-G.txt @@ -0,0 +1,31 @@ +InternalDirectiveTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +testobj.color: 7664. +testobj.size: 5. +testobj has light: 0. +testobj provides genprop: 0. +testobj provides lastprop: 1. +val: 7. +val: 9. +val: 11. +val: 10. +Func4(): 4. +Func5(): 5. +val: 1. +val: 101. +val: 117. +SwitchTest(-1): -1. +SwitchTest(0): 0. +SwitchTest(1): 11. +SwitchTest(2): 22. +SwitchTest(3): 33. +SwitchTest(4): -1. +SwitchTest(5): -1. +SwitchTest(6): 66. +SwitchTest(7): -1. +SwitchTest(8): 88. +SwitchTest(9): 99. + +All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/internaldirecttest.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/internaldirecttest.txt new file mode 100644 index 000000000..2f49b5fab --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/internaldirecttest.txt @@ -0,0 +1,30 @@ + InternalDirectiveTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + + testobj.color: 1311. + testobj.size: 5. + testobj has light: 0. + testobj provides genprop: 0. + testobj provides lastprop: 1. + val: 7. + val: 9. + val: 11. + val: 10. + Func4(): 4. + Func5(): 5. + val: 1. + val: 101. + val: 117. + SwitchTest(-1): -1. + SwitchTest(0): 0. + SwitchTest(1): 11. + SwitchTest(2): 22. + SwitchTest(3): 33. + SwitchTest(4): -1. + SwitchTest(5): -1. + SwitchTest(6): 66. + SwitchTest(7): -1. + SwitchTest(8): 88. + SwitchTest(9): 99. + + All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test-G.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z3.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z3.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z4.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z4.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z5.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z5.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z6.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z6.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z6_bigmem.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z6_bigmem.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z7.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z7.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z7_bigmem.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z7_bigmem.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z8.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/minimal_test_z8.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/replacerecursetest-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/replacerecursetest-G.txt new file mode 100644 index 000000000..d049af12e --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/replacerecursetest-G.txt @@ -0,0 +1,32 @@ +ReplaceRecurseTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +Calls to replaced function: +Call0: Replacement. +Call1: Replacement. +Call2: Replacement. +Call3: Replacement. + ...called 4 times. + +Calls to recursive replaced function: +Recurse replacement: 4 +Recurse replacement: 3 +Recurse replacement: 2 +Recurse replacement: 1 +Recurse replacement: 0 + ...called 5 times. + +Calls to double-replaced function: +Tricall0: Replacement 2. +Tricall1: Replacement 2. +Tricall2: Replacement 2. +Tricall3: Replacement 2. +Tricall4: Replacement 2. + ...called 5 times. + +Calls to never-replaced function: +Unicall0: Unreplaced original. + ...called 1 times. + +All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/replacerecursetest.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/replacerecursetest.txt new file mode 100644 index 000000000..8462e880e --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/replacerecursetest.txt @@ -0,0 +1,31 @@ + ReplaceRecurseTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + + Calls to replaced function: + Call0: Replacement. + Call1: Replacement. + Call2: Replacement. + Call3: Replacement. + ...called 4 times. + + Calls to recursive replaced function: + Recurse replacement: 4 + Recurse replacement: 3 + Recurse replacement: 2 + Recurse replacement: 1 + Recurse replacement: 0 + ...called 5 times. + + Calls to double-replaced function: + Tricall0: Replacement 2. + Tricall1: Replacement 2. + Tricall2: Replacement 2. + Tricall3: Replacement 2. + Tricall4: Replacement 2. + ...called 5 times. + + Calls to never-replaced function: + Unicall0: Unreplaced original. + ...called 1 times. + + All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/static_text_test-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/static_text_test-G.txt new file mode 100644 index 000000000..e69de29bb diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/staticarraytest-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/staticarraytest-G.txt new file mode 100644 index 000000000..3c1a0337c --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/staticarraytest-G.txt @@ -0,0 +1,106 @@ +StaticArrayTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +Dynamic memory begins at address 10496. + +TestDynamicArrays: +wordarray-->0: 10 +wordarray-->1: 11268 +wordarray-->2: foo; is string:1 +wordarray-->3: 12020 +wordarray-->4: 3164 +wordarray-->5: 14 +wordarray-->6: 11300 +wordarray-->7: 10564 +wordarray-->8: 10600 +bytearray->0: 5 +bytearray->3: 8 +stringarray->0: 5 +stringarray->1: 102 +stringarray->5: 122 +tablearray-->0: 6 +tablearray-->1: 0 +tablearray-->6: 0 +tablearray-->6: 33 +bufferarray-->0: 11 +bufferarray->W+0: 0 +bufferarray->W+10: 0 +bufferarray->W+10: 65 +bytearrayref: 10600 +stringarrayref: 10604 +testobj.bufferarrayprop: 10638 +propobj.tablearrayprop: 10610 +propobj.wordarrayprop: 10564 +bigarray->430: 0 +bigarray->430: 75 +bracket1array-->0: 1 +bracket1array-->1: 4 +bracket5array-->0: 5 +bracket5array-->1: 55 +bracket5array-->4: 12036 +bracket5array-->5: 99 +random(): 8 +wordarray: 10564 is dynamic. +bytearray: 10600 is dynamic. +stringarray: 10604 is dynamic. +tablearray: 10610 is dynamic. +bufferarray: 10638 is dynamic. +bigarray: 10653 is dynamic. +bracket1array: 11084 is dynamic. +bracket5array: 11092 is dynamic. + +The following lines should produce 4 veneer programming errors, as we access outside array bounds. This is expected! + +[** Programming error: tried to read from ->431 in the array "bigarray", which has entries 0 up to 430 **] + +[** Programming error: tried to write to ->431 in the array "bigarray", which has entries 0 up to 430 **] + +[** Programming error: tried to read from -->9 in the array "wordarray", which has entries 0 up to 8 **] + +[** Programming error: tried to write to -->9 in the array "wordarray", which has entries 0 up to 8 **] + +TestStaticArrays: +wordarrayst-->0: 11 +wordarrayst-->1: 11332 +wordarrayst-->2: 12020 +wordarrayst-->3: foo; is string:1 +wordarrayst-->4: 3164 +wordarrayst-->5: 11364 +wordarrayst-->6: 9868 +wordarrayst-->7: 9904 +wordarrayst-->8: 99 +bytearrayst->0: 15 +bytearrayst->3: 18 +stringarrayst->0: 5 +stringarrayst->1: 112 +stringarrayst->5: 104 +tablearrayst-->0: 7 +tablearrayst-->1: 0 +tablearrayst-->6: 0 +bufferarrayst-->0: 13 +bufferarrayst->W+0: 0 +bufferarrayst->W+12: 0 +bytearraystref: 9904 +stringarraystref: 9908 +testobjst.bufferarrayprop: 9946 +propobjst.tablearrayprop: 9914 +propobjst.wordarrayprop: 9868 +wordarrayst: 9868 is static. +bytearrayst: 9904 is static. +stringarrayst: 9908 is static. +tablearrayst: 9914 is static. +bufferarrayst: 9946 is static. +bigarrayst: 9963 is static. + +The following lines should produce 4 veneer programming errors, as we access outside array bounds. This is expected! + +[** Programming error: tried to read from ->531 in the array "bigarrayst", which has entries 0 up to 530 **] + +[** Programming error: tried to read from -->9 in the array "wordarrayst", which has entries 0 up to 8 **] + +[** Programming error: tried to write outside memory using -> **] + +[** Programming error: tried to write outside memory using --> **] + +All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/staticarraytest.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/staticarraytest.txt new file mode 100644 index 000000000..9c6ede776 --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/staticarraytest.txt @@ -0,0 +1,106 @@ + StaticArrayTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + Game file format 5. + + Static memory begins at address 1945. + + TestDynamicArrays: + wordarray-->0: 10 + wordarray-->1: 5 + wordarray-->2: foo; is string:1 + wordarray-->3: 1954 + wordarray-->4: 1697 + wordarray-->5: 14 + wordarray-->6: 6 + wordarray-->7: 1432 + wordarray-->8: 1450 + bytearray->0: 5 + bytearray->3: 8 + stringarray->0: 5 + stringarray->1: 102 + stringarray->5: 122 + tablearray-->0: 6 + tablearray-->1: 0 + tablearray-->6: 0 + tablearray-->6: 33 + bufferarray-->0: 11 + bufferarray->W+0: 0 + bufferarray->W+10: 0 + bufferarray->W+10: 65 + bytearrayref: 1450 + stringarrayref: 1454 + testobj.bufferarrayprop: 1474 + propobj.tablearrayprop: 1460 + propobj.wordarrayprop: 1432 + bigarray->430: 0 + bigarray->430: 75 + bracket1array-->0: 1 + bracket1array-->1: 4 + bracket5array-->0: 5 + bracket5array-->1: 55 + bracket5array-->4: 1963 + bracket5array-->5: 99 + random(): 8 + wordarray: 1432 is dynamic. + bytearray: 1450 is dynamic. + stringarray: 1454 is dynamic. + tablearray: 1460 is dynamic. + bufferarray: 1474 is dynamic. + bigarray: 1487 is dynamic. + bracket1array: 1918 is dynamic. + bracket5array: 1922 is dynamic. + + The following lines should produce 4 veneer programming errors, as we access outside array bounds. This is expected! + + [** Programming error: tried to read from ->431 in the array "bigarray", which has entries 0 up to 430 **] + + [** Programming error: tried to write to ->431 in the array "bigarray", which has entries 0 up to 430 **] + + [** Programming error: tried to read from -->9 in the array "wordarray", which has entries 0 up to 8 **] + + [** Programming error: tried to write to -->9 in the array "wordarray", which has entries 0 up to 8 **] + + TestStaticArrays: + wordarrayst-->0: 11 + wordarrayst-->1: 7 + wordarrayst-->2: 1954 + wordarrayst-->3: foo; is string:1 + wordarrayst-->4: 1697 + wordarrayst-->5: 8 + wordarrayst-->6: 1972 + wordarrayst-->7: 1990 + wordarrayst-->8: 99 + bytearrayst->0: 15 + bytearrayst->3: 18 + stringarrayst->0: 5 + stringarrayst->1: 112 + stringarrayst->5: 104 + tablearrayst-->0: 7 + tablearrayst-->1: 0 + tablearrayst-->6: 0 + bufferarrayst-->0: 13 + bufferarrayst->W+0: 0 + bufferarrayst->W+12: 0 + bytearraystref: 1990 + stringarraystref: 1994 + testobjst.bufferarrayprop: 2016 + propobjst.tablearrayprop: 2000 + propobjst.wordarrayprop: 1972 + wordarrayst: 1972 is static. + bytearrayst: 1990 is static. + stringarrayst: 1994 is static. + tablearrayst: 2000 is static. + bufferarrayst: 2016 is static. + bigarrayst: 2031 is static. + + The following lines should produce 4 veneer programming errors, as we access outside array bounds. This is expected! + + [** Programming error: tried to read from ->531 in the array "bigarrayst", which has entries 0 up to 530 **] + + [** Programming error: tried to read from -->9 in the array "wordarrayst", which has entries 0 up to 8 **] + + [** Programming error: tried to write outside memory using -> **] + + [** Programming error: tried to write outside memory using --> **] + + All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/undefdirectivetest-G.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/undefdirectivetest-G.txt new file mode 100644 index 000000000..f90c540af --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/undefdirectivetest-G.txt @@ -0,0 +1,13 @@ +UndefDirectiveTest: Not a game. +Release 1 / Serial number 220305 / Inform v6.36, compiler options S +Interpreter version 0.5.4 / VM 3.1.2 / game file format 3.0.0 + +UndefMe_post: 1. +WillBeDefinedLater: 2. +WillBeDefinedLater_pre: 3. +WillBeDefinedLater_post: 4. +RemainsDefined: 5. +FutureSymbol: 6. +Function returning FutureSymbol: 6. + +All passed. diff --git a/inform6/Tests/Test Cases/_Transcript_Ideal/undefdirectivetest.txt b/inform6/Tests/Test Cases/_Transcript_Ideal/undefdirectivetest.txt new file mode 100644 index 000000000..0a82d665c --- /dev/null +++ b/inform6/Tests/Test Cases/_Transcript_Ideal/undefdirectivetest.txt @@ -0,0 +1,12 @@ + UndefDirectiveTest: Not a game. + Release 1 / Serial number 220305 / Inform v6.36, compiler options S + + UndefMe_post: 1. + WillBeDefinedLater: 2. + WillBeDefinedLater_pre: 3. + WillBeDefinedLater_post: 4. + RemainsDefined: 5. + FutureSymbol: 6. + Function returning FutureSymbol: 6. + + All passed. diff --git a/inform6/Tests/Test Cases/_md5_Ideal/actionextension-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/actionextension-G.txt new file mode 100644 index 000000000..79f950c6a --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/actionextension-G.txt @@ -0,0 +1 @@ +a90ea20de4c538312842ef1c5a5ee932 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/actionextension.txt b/inform6/Tests/Test Cases/_md5_Ideal/actionextension.txt new file mode 100644 index 000000000..5c79c8519 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/actionextension.txt @@ -0,0 +1 @@ +8434dd954b155675ec9a853052b5a5bc diff --git a/inform6/Tests/Test Cases/_md5_Ideal/classcopytest-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/classcopytest-G.txt new file mode 100644 index 000000000..9407e3fcc --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/classcopytest-G.txt @@ -0,0 +1 @@ +22577a69f64377b8e4577a76eca578af diff --git a/inform6/Tests/Test Cases/_md5_Ideal/classcopytest.txt b/inform6/Tests/Test Cases/_md5_Ideal/classcopytest.txt new file mode 100644 index 000000000..966855391 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/classcopytest.txt @@ -0,0 +1 @@ +6dc016b201b6591501911ccac02e152c diff --git a/inform6/Tests/Test Cases/_md5_Ideal/classordertest-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/classordertest-G.txt new file mode 100644 index 000000000..c589bd414 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/classordertest-G.txt @@ -0,0 +1 @@ +2844efeeff5ff0842b7185a56e80f6dd diff --git a/inform6/Tests/Test Cases/_md5_Ideal/classordertest.txt b/inform6/Tests/Test Cases/_md5_Ideal/classordertest.txt new file mode 100644 index 000000000..ff87b5087 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/classordertest.txt @@ -0,0 +1 @@ +d065c980637c8531133e75bf040e1731 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/dictflagtest-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/dictflagtest-G.txt new file mode 100644 index 000000000..9e8c9fab7 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/dictflagtest-G.txt @@ -0,0 +1 @@ +438aead86360423e32aecb2dda8e2341 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/dictflagtest.txt b/inform6/Tests/Test Cases/_md5_Ideal/dictflagtest.txt new file mode 100644 index 000000000..511d2e53f --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/dictflagtest.txt @@ -0,0 +1 @@ +494cc7406f0d8183e9c2621ab8c0d204 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/glulxercise-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/glulxercise-G.txt new file mode 100644 index 000000000..59a2dcfc9 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/glulxercise-G.txt @@ -0,0 +1 @@ +7d010c0e3a61dbac195b3ece7822d41f diff --git a/inform6/Tests/Test Cases/_md5_Ideal/ifelsedirecttest-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/ifelsedirecttest-G.txt new file mode 100644 index 000000000..36ac357ef --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/ifelsedirecttest-G.txt @@ -0,0 +1 @@ +c9f1ab6a8dfba69f4bb2746c20c3fbbb diff --git a/inform6/Tests/Test Cases/_md5_Ideal/ifelsedirecttest.txt b/inform6/Tests/Test Cases/_md5_Ideal/ifelsedirecttest.txt new file mode 100644 index 000000000..c8c1cb446 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/ifelsedirecttest.txt @@ -0,0 +1 @@ +33dfb4452ebb69030ae6e7c3db2f0833 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/internaldirecttest-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/internaldirecttest-G.txt new file mode 100644 index 000000000..690bca93b --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/internaldirecttest-G.txt @@ -0,0 +1 @@ +69666314dc31e270809d11f2ee9cebd6 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/internaldirecttest.txt b/inform6/Tests/Test Cases/_md5_Ideal/internaldirecttest.txt new file mode 100644 index 000000000..ee69b86fe --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/internaldirecttest.txt @@ -0,0 +1 @@ +191fd5acfff6e1208b04f0d6d178f8eb diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test-G.txt new file mode 100644 index 000000000..f096105e3 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test-G.txt @@ -0,0 +1 @@ +6e647107c3b3c46fc9556da0330db3a6 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z3.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z3.txt new file mode 100644 index 000000000..31f29728e --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z3.txt @@ -0,0 +1 @@ +6143c98e20a44d843c1a6fbe2c19ecae diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z4.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z4.txt new file mode 100644 index 000000000..f0fede150 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z4.txt @@ -0,0 +1 @@ +f82709a196ebbefe109525084220c35a diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z5.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z5.txt new file mode 100644 index 000000000..bb5520b5b --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z5.txt @@ -0,0 +1 @@ +90866a483312a4359bc00db776e6eed4 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z6.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z6.txt new file mode 100644 index 000000000..791484820 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z6.txt @@ -0,0 +1 @@ +08b59209daa947437a5119b8060522ef diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z6_bigmem.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z6_bigmem.txt new file mode 100644 index 000000000..8222fb38e --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z6_bigmem.txt @@ -0,0 +1 @@ +e273d746baf6dac4324c95e45982bec0 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z7.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z7.txt new file mode 100644 index 000000000..00c0989ca --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z7.txt @@ -0,0 +1 @@ +26bd70faebf8c61638a736a72f57c7ad diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z7_bigmem.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z7_bigmem.txt new file mode 100644 index 000000000..416b53fb0 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z7_bigmem.txt @@ -0,0 +1 @@ +814c9ac5777674f1cc98f9a0cd22d6da diff --git a/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z8.txt b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z8.txt new file mode 100644 index 000000000..b4bfc5df1 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/minimal_test_z8.txt @@ -0,0 +1 @@ +fa7fc9bbe032d27355b0fcf4fb4f2c53 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/replacerecursetest-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/replacerecursetest-G.txt new file mode 100644 index 000000000..25d6ffc07 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/replacerecursetest-G.txt @@ -0,0 +1 @@ +e6ff7304a967ab9cae5b99da9e7a3df1 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/replacerecursetest.txt b/inform6/Tests/Test Cases/_md5_Ideal/replacerecursetest.txt new file mode 100644 index 000000000..ae6438df4 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/replacerecursetest.txt @@ -0,0 +1 @@ +f9abd6adec9bd6cfdd215fccb1abf22b diff --git a/inform6/Tests/Test Cases/_md5_Ideal/staticarraytest-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/staticarraytest-G.txt new file mode 100644 index 000000000..c4be64ccd --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/staticarraytest-G.txt @@ -0,0 +1 @@ +45b07b21aa4ff3ba2563bdbfd134dd1a diff --git a/inform6/Tests/Test Cases/_md5_Ideal/staticarraytest.txt b/inform6/Tests/Test Cases/_md5_Ideal/staticarraytest.txt new file mode 100644 index 000000000..8061b01d3 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/staticarraytest.txt @@ -0,0 +1 @@ +736f5df15951398ec41b0d05e4280cce diff --git a/inform6/Tests/Test Cases/_md5_Ideal/undefdirectivetest-G.txt b/inform6/Tests/Test Cases/_md5_Ideal/undefdirectivetest-G.txt new file mode 100644 index 000000000..6e75445ff --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/undefdirectivetest-G.txt @@ -0,0 +1 @@ +cb28a5edcd681dfde63e472ac2542a95 diff --git a/inform6/Tests/Test Cases/_md5_Ideal/undefdirectivetest.txt b/inform6/Tests/Test Cases/_md5_Ideal/undefdirectivetest.txt new file mode 100644 index 000000000..f87b4bee8 --- /dev/null +++ b/inform6/Tests/Test Cases/_md5_Ideal/undefdirectivetest.txt @@ -0,0 +1 @@ +de2f2e32f82bf14a4178f3a992762e6b diff --git a/inform6/Tests/Test Cases/actionextension-G.inf b/inform6/Tests/Test Cases/actionextension-G.inf new file mode 100755 index 000000000..e45b269f4 --- /dev/null +++ b/inform6/Tests/Test Cases/actionextension-G.inf @@ -0,0 +1,292 @@ +Constant Story "ActionExtensionTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test, testing the new form of the +! <...> action statement. Or rather, it exhaustively tests different +! ways to pass arguments to the <...> statement, covering both the old +! cases (without the ",actor") and the new cases (with it). + +! If you want to test only the old syntax, comment out the definition +! of TRY_NEW_SYNTAX. (You might want this to verify the correctness of +! a 6.31 compiler fork.) +Constant TRY_NEW_SYNTAX; + +! (Even with TRY_NEW_SYNTAX commented out, this does not compile +! correctly on -z3. This is a pre-existing compiler bug, which I have +! not tracked down. I might even be doing something which is illegal +! in z-code v3.) + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #ifnot; + print "Game file format ", 0->0, ".^"; + #Endif; ! TARGET_GLULX +]; + +Global expect_verb; +Global expect_noun; +Global expect_second; +Global expect_actor; + +[ set_expect verb noun second actor; + expect_verb = verb; + expect_noun = noun; + expect_second = second; + expect_actor = actor; +]; + +! <...> statements are compiled as calls to R_Process(). This implementation +! simply checks that the arguments arrived as expected. + +[ R_Process verb noun second actor; + print "Action <", verb, " ", noun, " ", second; + if (actor) print ", ", actor; + print ">"; + if (expect_verb == verb && expect_noun == noun + && expect_second == second && expect_actor == actor) { + ! all correct + new_line; + rtrue; + } + print ": ERROR, expected "; + print " <", expect_verb, " ", expect_noun, " ", expect_second; + if (expect_actor) print ", ", expect_actor; + print ">"; + new_line; + failures++; + rfalse; +]; + +Verb 'verb0' * -> Verb0; +Verb 'verb1' * -> Verb1; +Verb 'verb2' * -> Verb2; +Verb 'verb3' * -> Verb3; + +[ Verb0Sub; ]; +[ Verb1Sub; ]; +[ Verb2Sub; ]; +[ Verb3Sub; ]; + +Global glob; +Object obj; +[ func37; return 37; ]; +[ func38; return 38; ]; +[ funcglobinc; + glob++; + return glob; +]; + +[ RunTest loc; + loc = R_Process; ! quiet compiler warning + + ! First, we test the old syntax with a passel of variations. + print "The standard action syntax:^"; + loc = 55; + + set_expect(1); + ; + set_expect(2, 13); + ; + set_expect(2, 14); + ; ! parsed as one computed argument + set_expect(3, 18, 6); + ; + set_expect(1, 19, -6); + ; ! parsed as two arguments + set_expect(2, obj, 44); + ; + set_expect(3, 55); + ; + + ! variations with computed arguments + loc = 20; + glob = 30; + + set_expect(2); + <(##Verb2)>; + set_expect(21); + <(loc+1)>; + set_expect(30, 40); + <(glob) (loc*2)>; + set_expect(20, 30, 40); + <(loc) glob (loc*2)>; + set_expect(21, 22, 23); + <(loc+1) (loc+2) (loc+3)>; + set_expect(30, 37, 33); + <(glob) (func37()) 33>; + set_expect(37, 31, 38); + <(func37()) (glob+1) (func38())>; + set_expect(21, 0, 10); + <(loc+1) 0 glob-loc>; + set_expect(30, obj, 32000); + <(glob) obj 32000>; + set_expect(1, 31, 21); + ; + + ! comma-expression arguments + set_expect(5, 6); + <(loc++, 5) (glob++, 6)>; + set_expect(3, 62, 93); + <(loc++, ##Verb3) (loc++, glob*2) (loc++, glob*3)>; + set_expect(1, 24, 31); + ; + + ! arguments with side-effects + ! note that the arguments are evaluated right-to-left! This is goofy, + ! but Inform function arguments are handled the same way, so it's + ! "consistent". + glob = 40; + set_expect(41); + <(funcglobinc())>; + set_expect(43, 42); + <(funcglobinc()) (funcglobinc())>; + set_expect(46, 45, 44); + <(funcglobinc()) (funcglobinc()) (funcglobinc())>; + +#ifdef TRY_NEW_SYNTAX; + ! And now, the new syntax. (If we want to test that.) + print "^The new action syntax:^"; + + loc = 20; + glob = 30; + + set_expect(2, 0, 0, 1234); + ; + set_expect(1, 0, 0, obj); + ; + set_expect(3, 0, 0, 20); + ; + set_expect(2, 0, 0, 30); + ; + set_expect(2, 0, 0, 1235); + ; + set_expect(1, 0, 0, obj); + ; + set_expect(3, 0, 0, 20); + ; + set_expect(2, 0, 0, 30); + ; + + set_expect(1, 0, 0, 7); + ; + set_expect(1, 6, 0, 8); + ; + set_expect(1, 5, 6, 9); + ; + + set_expect(2, 0, 0, 99); + <(##Verb2), 99>; + set_expect(21, 0, 0, 31); + <(loc+1), (glob+1)>; + set_expect(30, 40, 0, 90); + <(glob) (loc*2), (glob*3)>; + set_expect(20, 30, 40, 33); + <(loc) glob (loc*2), (glob+3)>; + set_expect(30, 37, 33, 38); + <(glob) (func37()) 33, (func38())>; + set_expect(37, 31, 2, 38); + <(func37()) (glob+1) 2, (func38())>; + set_expect(21, 0, 10, 50); + <(loc+1) 0 glob-loc, glob+loc>; + set_expect(1, 31, 0, 21); + ; + + ! comma-expression arguments + set_expect(5, 0, 0, 6); + <(loc++, 5), (glob++, 6)>; + set_expect(3, 62, 93, 124); + <(loc++, ##Verb3) (loc++, glob*2) (loc++, glob*3), (loc++, glob*4)>; + set_expect(1, 25, 31); + ; + + ! arguments with side-effects + glob = 40; + set_expect(42, 0, 0, 41); + <(funcglobinc()), (funcglobinc())>; + set_expect(45, 44, 0, 43); + <(funcglobinc()) (funcglobinc()), (funcglobinc())>; + set_expect(49, 48, 47, 46); + <(funcglobinc()) (funcglobinc()) (funcglobinc()), (funcglobinc())>; + +#endif; ! TRY_NEW_SYNTAX + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; diff --git a/inform6/Tests/Test Cases/actionextension.inf b/inform6/Tests/Test Cases/actionextension.inf new file mode 100755 index 000000000..e45b269f4 --- /dev/null +++ b/inform6/Tests/Test Cases/actionextension.inf @@ -0,0 +1,292 @@ +Constant Story "ActionExtensionTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test, testing the new form of the +! <...> action statement. Or rather, it exhaustively tests different +! ways to pass arguments to the <...> statement, covering both the old +! cases (without the ",actor") and the new cases (with it). + +! If you want to test only the old syntax, comment out the definition +! of TRY_NEW_SYNTAX. (You might want this to verify the correctness of +! a 6.31 compiler fork.) +Constant TRY_NEW_SYNTAX; + +! (Even with TRY_NEW_SYNTAX commented out, this does not compile +! correctly on -z3. This is a pre-existing compiler bug, which I have +! not tracked down. I might even be doing something which is illegal +! in z-code v3.) + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #ifnot; + print "Game file format ", 0->0, ".^"; + #Endif; ! TARGET_GLULX +]; + +Global expect_verb; +Global expect_noun; +Global expect_second; +Global expect_actor; + +[ set_expect verb noun second actor; + expect_verb = verb; + expect_noun = noun; + expect_second = second; + expect_actor = actor; +]; + +! <...> statements are compiled as calls to R_Process(). This implementation +! simply checks that the arguments arrived as expected. + +[ R_Process verb noun second actor; + print "Action <", verb, " ", noun, " ", second; + if (actor) print ", ", actor; + print ">"; + if (expect_verb == verb && expect_noun == noun + && expect_second == second && expect_actor == actor) { + ! all correct + new_line; + rtrue; + } + print ": ERROR, expected "; + print " <", expect_verb, " ", expect_noun, " ", expect_second; + if (expect_actor) print ", ", expect_actor; + print ">"; + new_line; + failures++; + rfalse; +]; + +Verb 'verb0' * -> Verb0; +Verb 'verb1' * -> Verb1; +Verb 'verb2' * -> Verb2; +Verb 'verb3' * -> Verb3; + +[ Verb0Sub; ]; +[ Verb1Sub; ]; +[ Verb2Sub; ]; +[ Verb3Sub; ]; + +Global glob; +Object obj; +[ func37; return 37; ]; +[ func38; return 38; ]; +[ funcglobinc; + glob++; + return glob; +]; + +[ RunTest loc; + loc = R_Process; ! quiet compiler warning + + ! First, we test the old syntax with a passel of variations. + print "The standard action syntax:^"; + loc = 55; + + set_expect(1); + ; + set_expect(2, 13); + ; + set_expect(2, 14); + ; ! parsed as one computed argument + set_expect(3, 18, 6); + ; + set_expect(1, 19, -6); + ; ! parsed as two arguments + set_expect(2, obj, 44); + ; + set_expect(3, 55); + ; + + ! variations with computed arguments + loc = 20; + glob = 30; + + set_expect(2); + <(##Verb2)>; + set_expect(21); + <(loc+1)>; + set_expect(30, 40); + <(glob) (loc*2)>; + set_expect(20, 30, 40); + <(loc) glob (loc*2)>; + set_expect(21, 22, 23); + <(loc+1) (loc+2) (loc+3)>; + set_expect(30, 37, 33); + <(glob) (func37()) 33>; + set_expect(37, 31, 38); + <(func37()) (glob+1) (func38())>; + set_expect(21, 0, 10); + <(loc+1) 0 glob-loc>; + set_expect(30, obj, 32000); + <(glob) obj 32000>; + set_expect(1, 31, 21); + ; + + ! comma-expression arguments + set_expect(5, 6); + <(loc++, 5) (glob++, 6)>; + set_expect(3, 62, 93); + <(loc++, ##Verb3) (loc++, glob*2) (loc++, glob*3)>; + set_expect(1, 24, 31); + ; + + ! arguments with side-effects + ! note that the arguments are evaluated right-to-left! This is goofy, + ! but Inform function arguments are handled the same way, so it's + ! "consistent". + glob = 40; + set_expect(41); + <(funcglobinc())>; + set_expect(43, 42); + <(funcglobinc()) (funcglobinc())>; + set_expect(46, 45, 44); + <(funcglobinc()) (funcglobinc()) (funcglobinc())>; + +#ifdef TRY_NEW_SYNTAX; + ! And now, the new syntax. (If we want to test that.) + print "^The new action syntax:^"; + + loc = 20; + glob = 30; + + set_expect(2, 0, 0, 1234); + ; + set_expect(1, 0, 0, obj); + ; + set_expect(3, 0, 0, 20); + ; + set_expect(2, 0, 0, 30); + ; + set_expect(2, 0, 0, 1235); + ; + set_expect(1, 0, 0, obj); + ; + set_expect(3, 0, 0, 20); + ; + set_expect(2, 0, 0, 30); + ; + + set_expect(1, 0, 0, 7); + ; + set_expect(1, 6, 0, 8); + ; + set_expect(1, 5, 6, 9); + ; + + set_expect(2, 0, 0, 99); + <(##Verb2), 99>; + set_expect(21, 0, 0, 31); + <(loc+1), (glob+1)>; + set_expect(30, 40, 0, 90); + <(glob) (loc*2), (glob*3)>; + set_expect(20, 30, 40, 33); + <(loc) glob (loc*2), (glob+3)>; + set_expect(30, 37, 33, 38); + <(glob) (func37()) 33, (func38())>; + set_expect(37, 31, 2, 38); + <(func37()) (glob+1) 2, (func38())>; + set_expect(21, 0, 10, 50); + <(loc+1) 0 glob-loc, glob+loc>; + set_expect(1, 31, 0, 21); + ; + + ! comma-expression arguments + set_expect(5, 0, 0, 6); + <(loc++, 5), (glob++, 6)>; + set_expect(3, 62, 93, 124); + <(loc++, ##Verb3) (loc++, glob*2) (loc++, glob*3), (loc++, glob*4)>; + set_expect(1, 25, 31); + ; + + ! arguments with side-effects + glob = 40; + set_expect(42, 0, 0, 41); + <(funcglobinc()), (funcglobinc())>; + set_expect(45, 44, 0, 43); + <(funcglobinc()) (funcglobinc()), (funcglobinc())>; + set_expect(49, 48, 47, 46); + <(funcglobinc()) (funcglobinc()) (funcglobinc()), (funcglobinc())>; + +#endif; ! TRY_NEW_SYNTAX + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; diff --git a/inform6/Tests/Test Cases/classcopytest-G.inf b/inform6/Tests/Test Cases/classcopytest-G.inf new file mode 100755 index 000000000..6c3c7068a --- /dev/null +++ b/inform6/Tests/Test Cases/classcopytest-G.inf @@ -0,0 +1,205 @@ +Constant Story "ClassCopyTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for how multiple-inheritance objects +! handle copy and recreate. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main loc; + #Ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 loc; + #Endif; ! TARGET_ + + loc = 0; + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #ifnot; + print "Game file format ", 0->0, ".^"; + #Endif; ! TARGET_GLULX +]; + +[ RunTest; + ClassCopyTest(); + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +Property genprop; +Property additive addprop; +Attribute attr1; +Attribute attr2; +Attribute attr3; + +class Foo(0) + with indprop 11, + with addprop 77, + has attr1, + has attr2; + +class Bar + with indprop 22, + with genprop 33, + has ~attr1; + +Object obj1 + class Foo, + class Bar; + +Object obj2 + class Bar, + class Foo; + +Object obj3 + class Bar, + class Foo, + with indprop 4, + with genprop 4, + longprop 10 11 12, + has ~attr1; + +Object obj4 + class Foo, + with indprop 5, + with genprop 6, + longprop 5 6 7 8; + +Object obj5 + class Foo, + with longprop 13 14 15; + +[ ClassCopyTest; + give obj1 ~attr1; + give obj1 attr3; + obj1.indprop = 12; + + print "obj1.indprop: "; check_value(obj1.indprop, 12); print "^"; + print "obj1.genprop: "; check_value(obj1.genprop, 33); print "^"; + print "obj1.attr1: "; check_value(obj1 has attr1, false); print "^"; + print "obj1.attr2: "; check_value(obj1 has attr2, true); print "^"; + print "obj1.attr3: "; check_value(obj1 has attr3, true); print "^"; + + Foo.copy(obj2, obj1); + + print "obj2.indprop: "; check_value(obj2.indprop, 12); print "^"; + print "obj2.genprop: "; check_value(obj2.genprop, 33); print "^"; + print "obj2.attr1: "; check_value(obj2 has attr1, false); print "^"; + print "obj2.attr2: "; check_value(obj2 has attr2, true); print "^"; + print "obj2.attr3: "; check_value(obj2 has attr3, true); print "^"; + + Foo.copy(obj2, obj3); + + print "obj2.indprop: "; check_value(obj2.indprop, 4); print "^"; + print "obj2.genprop: "; check_value(obj2.genprop, 4); print "^"; + print "obj2.attr1: "; check_value(obj2 has attr1, false); print "^"; + print "obj2.attr2: "; check_value(obj2 has attr2, true); print "^"; + print "obj2.attr3: "; check_value(obj2 has attr3, false); print "^"; + + Foo.copy(obj3, obj4); + + print "obj3.indprop: "; check_value(obj3.indprop, 5); print "^"; + print "obj3.genprop: "; check_value(obj3.genprop, 6); print "^"; + print "obj3.longprop[0]: "; check_value((obj3.&longprop)-->0, 10); print "^"; + print "obj3.attr1: "; check_value(obj3 has attr1, true); print "^"; + print "obj3.attr2: "; check_value(obj3 has attr2, true); print "^"; + print "obj3.attr3: "; check_value(obj3 has attr3, false); print "^"; + + obj3.genprop = 67; + give obj3 attr3; + Foo.recreate(obj3); + + print "obj3.indprop: "; check_value(obj3.indprop, 11); print "^"; + print "obj3.genprop: "; check_value(obj3.genprop, 67); print "^"; + print "obj3.longprop[0]: "; check_value((obj3.&longprop)-->0, 10); print "^"; + print "obj3.attr1: "; check_value(obj3 has attr1, true); print "^"; + print "obj3.attr2: "; check_value(obj3 has attr2, true); print "^"; + print "obj3.attr3: "; check_value(obj3 has attr3, false); print "^"; + + (obj5.&longprop)-->1 = 114; + Foo.copy(obj3, obj5); + + print "obj3.longprop[0]: "; check_value((obj3.&longprop)-->0, 13); print "^"; + print "obj3.longprop[1]: "; check_value((obj3.&longprop)-->1, 114); print "^"; + print "obj3.longprop[2]: "; check_value((obj3.&longprop)-->2, 15); print "^"; +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + diff --git a/inform6/Tests/Test Cases/classcopytest.inf b/inform6/Tests/Test Cases/classcopytest.inf new file mode 100755 index 000000000..6c3c7068a --- /dev/null +++ b/inform6/Tests/Test Cases/classcopytest.inf @@ -0,0 +1,205 @@ +Constant Story "ClassCopyTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for how multiple-inheritance objects +! handle copy and recreate. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main loc; + #Ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 loc; + #Endif; ! TARGET_ + + loc = 0; + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #ifnot; + print "Game file format ", 0->0, ".^"; + #Endif; ! TARGET_GLULX +]; + +[ RunTest; + ClassCopyTest(); + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +Property genprop; +Property additive addprop; +Attribute attr1; +Attribute attr2; +Attribute attr3; + +class Foo(0) + with indprop 11, + with addprop 77, + has attr1, + has attr2; + +class Bar + with indprop 22, + with genprop 33, + has ~attr1; + +Object obj1 + class Foo, + class Bar; + +Object obj2 + class Bar, + class Foo; + +Object obj3 + class Bar, + class Foo, + with indprop 4, + with genprop 4, + longprop 10 11 12, + has ~attr1; + +Object obj4 + class Foo, + with indprop 5, + with genprop 6, + longprop 5 6 7 8; + +Object obj5 + class Foo, + with longprop 13 14 15; + +[ ClassCopyTest; + give obj1 ~attr1; + give obj1 attr3; + obj1.indprop = 12; + + print "obj1.indprop: "; check_value(obj1.indprop, 12); print "^"; + print "obj1.genprop: "; check_value(obj1.genprop, 33); print "^"; + print "obj1.attr1: "; check_value(obj1 has attr1, false); print "^"; + print "obj1.attr2: "; check_value(obj1 has attr2, true); print "^"; + print "obj1.attr3: "; check_value(obj1 has attr3, true); print "^"; + + Foo.copy(obj2, obj1); + + print "obj2.indprop: "; check_value(obj2.indprop, 12); print "^"; + print "obj2.genprop: "; check_value(obj2.genprop, 33); print "^"; + print "obj2.attr1: "; check_value(obj2 has attr1, false); print "^"; + print "obj2.attr2: "; check_value(obj2 has attr2, true); print "^"; + print "obj2.attr3: "; check_value(obj2 has attr3, true); print "^"; + + Foo.copy(obj2, obj3); + + print "obj2.indprop: "; check_value(obj2.indprop, 4); print "^"; + print "obj2.genprop: "; check_value(obj2.genprop, 4); print "^"; + print "obj2.attr1: "; check_value(obj2 has attr1, false); print "^"; + print "obj2.attr2: "; check_value(obj2 has attr2, true); print "^"; + print "obj2.attr3: "; check_value(obj2 has attr3, false); print "^"; + + Foo.copy(obj3, obj4); + + print "obj3.indprop: "; check_value(obj3.indprop, 5); print "^"; + print "obj3.genprop: "; check_value(obj3.genprop, 6); print "^"; + print "obj3.longprop[0]: "; check_value((obj3.&longprop)-->0, 10); print "^"; + print "obj3.attr1: "; check_value(obj3 has attr1, true); print "^"; + print "obj3.attr2: "; check_value(obj3 has attr2, true); print "^"; + print "obj3.attr3: "; check_value(obj3 has attr3, false); print "^"; + + obj3.genprop = 67; + give obj3 attr3; + Foo.recreate(obj3); + + print "obj3.indprop: "; check_value(obj3.indprop, 11); print "^"; + print "obj3.genprop: "; check_value(obj3.genprop, 67); print "^"; + print "obj3.longprop[0]: "; check_value((obj3.&longprop)-->0, 10); print "^"; + print "obj3.attr1: "; check_value(obj3 has attr1, true); print "^"; + print "obj3.attr2: "; check_value(obj3 has attr2, true); print "^"; + print "obj3.attr3: "; check_value(obj3 has attr3, false); print "^"; + + (obj5.&longprop)-->1 = 114; + Foo.copy(obj3, obj5); + + print "obj3.longprop[0]: "; check_value((obj3.&longprop)-->0, 13); print "^"; + print "obj3.longprop[1]: "; check_value((obj3.&longprop)-->1, 114); print "^"; + print "obj3.longprop[2]: "; check_value((obj3.&longprop)-->2, 15); print "^"; +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + diff --git a/inform6/Tests/Test Cases/classordertest-G.inf b/inform6/Tests/Test Cases/classordertest-G.inf new file mode 100755 index 000000000..bdfd93f70 --- /dev/null +++ b/inform6/Tests/Test Cases/classordertest-G.inf @@ -0,0 +1,262 @@ +Constant Story "ClassOrderTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for how multiple-inheritance objects +! are resolved. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main loc; + #Ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 loc; + #Endif; ! TARGET_ + + loc = 0; + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #ifnot; + print "Game file format ", 0->0, ".^"; + #Endif; ! TARGET_GLULX +]; + +[ RunTest; + ClassOrderTest(); + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +Property genprop; +Property additive addprop; +Attribute attr1; +Attribute attr2; + +class Foo + with indprop 11, + with addprop 77, + has attr1, + has attr2; + +class Foofoo + class Foo + with indprop 111, + with genprop 222, + with addprop 777, + has ~attr1; + +class Bar + with indprop 22, + with genprop 33, + has ~attr1; + +class Mum + with genprop 44, + with addprop 55 66, + has attr2; + +class Qux + with addprop 88 99, + has ~attr2; + +Object obj1 + class Foo, + class Bar; + +Object obj2 + class Bar, + class Foo; + +Object obj3 + class Bar, + class Foo, + with indprop 4, + with genprop 4, + has ~attr1; + +Bar obj4 + with indprop 5; + +Bar obj5 + class Foo, + with indprop 6; + +Bar obj5a + with indprop 7, + class Foo; + +Bar obj6 + class Foo; + +Foo obj7 + class Bar; + +Object obj8 + class Mum, + class Bar; + +Object obj8a + class Mum Bar; + +Qux obj9 + with addprop 2, + has attr2; + +Object obj10 + class Mum, + class Qux, + with addprop 3 4; + +Foofoo obj11; + +Object obj12 + class Foofoo, + class Bar, + has ~attr2; + +Object obj12a + class Foofoo Bar, + has ~attr2; + +Object obj13 + class Bar, + class Foofoo; + +Object obj13a + class Bar Foofoo; + +[ ClassOrderTest; + print "obj1.indprop: "; check_value(obj1.indprop, 11); print "^"; + print "obj2.indprop: "; check_value(obj2.indprop, 22); print "^"; + print "obj3.indprop: "; check_value(obj3.indprop, 4); print "^"; + print "obj4.indprop: "; check_value(obj4.indprop, 5); print "^"; + print "obj5.indprop: "; check_value(obj5.indprop, 6); print "^"; + print "obj5a.indprop: "; check_value(obj5a.indprop, 7); print "^"; + print "obj6.indprop: "; check_value(obj6.indprop, 22); print "^"; + print "obj7.indprop: "; check_value(obj7.indprop, 11); print "^"; + print "obj11.indprop: "; check_value(obj11.indprop, 111); print "^"; + print "obj12.indprop: "; check_value(obj12.indprop, 111); print "^"; + print "obj12a.indprop: "; check_value(obj12a.indprop, 111); print "^"; + print "obj13.indprop: "; check_value(obj13.indprop, 22); print "^"; + print "obj13a.indprop: "; check_value(obj13a.indprop, 22); print "^"; + + print "obj3.genprop: "; check_value(obj3.genprop, 4); print "^"; + print "obj6.genprop: "; check_value(obj6.genprop, 33); print "^"; + print "obj7.genprop: "; check_value(obj7.genprop, 33); print "^"; + print "obj8.genprop: "; check_value(obj8.genprop, 44); print "^"; + print "obj8a.genprop: "; check_value(obj8a.genprop, 44); print "^"; + + print "obj8.#addprop: "; check_value(obj8.#addprop, WORDSIZE*2); print "^"; + print "obj8.addprop[0]: "; check_value(obj8.&addprop-->0, 55); print "^"; + print "obj8.addprop[1]: "; check_value(obj8.&addprop-->1, 66); print "^"; + + print "obj9.#addprop: "; check_value(obj9.#addprop, WORDSIZE*3); print "^"; + print "obj9.addprop[0]: "; check_value(obj9.&addprop-->0, 2); print "^"; + print "obj9.addprop[1]: "; check_value(obj9.&addprop-->1, 88); print "^"; + print "obj9.addprop[2]: "; check_value(obj9.&addprop-->2, 99); print "^"; + + print "obj10.#addprop: "; check_value(obj10.#addprop, WORDSIZE*6); print "^"; + print "obj10.addprop[0]: "; check_value(obj10.&addprop-->0, 3); print "^"; + print "obj10.addprop[1]: "; check_value(obj10.&addprop-->1, 4); print "^"; + print "obj10.addprop[2]: "; check_value(obj10.&addprop-->2, 55); print "^"; + print "obj10.addprop[3]: "; check_value(obj10.&addprop-->3, 66); print "^"; + print "obj10.addprop[4]: "; check_value(obj10.&addprop-->4, 88); print "^"; + print "obj10.addprop[5]: "; check_value(obj10.&addprop-->5, 99); print "^"; + + print "obj11.#addprop: "; check_value(obj11.#addprop, WORDSIZE*2); print "^"; + print "obj11.addprop[0]: "; check_value(obj11.&addprop-->0, 777); print "^"; + print "obj11.addprop[1]: "; check_value(obj11.&addprop-->1, 77); print "^"; + + print "obj1.attr1: "; check_value(obj1 has attr1, true); print "^"; + print "obj2.attr1: "; check_value(obj2 has attr1, true); print "^"; + print "obj3.attr1: "; check_value(obj3 has attr1, false); print "^"; + print "obj11.attr1: "; check_value(obj11 has attr1, false); print "^"; + print "obj12.attr1: "; check_value(obj12 has attr1, false); print "^"; + print "obj13.attr1: "; check_value(obj13 has attr1, false); print "^"; + + print "obj8.attr2: "; check_value(obj8 has attr2, true); print "^"; + print "obj9.attr2: "; check_value(obj9 has attr2, true); print "^"; + print "obj10.attr2: "; check_value(obj10 has attr2, true); print "^"; + print "obj11.attr2: "; check_value(obj11 has attr2, true); print "^"; + print "obj12.attr2: "; check_value(obj12 has attr2, false); print "^"; + print "obj13.attr2: "; check_value(obj13 has attr2, true); print "^"; +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + diff --git a/inform6/Tests/Test Cases/classordertest.inf b/inform6/Tests/Test Cases/classordertest.inf new file mode 100755 index 000000000..bdfd93f70 --- /dev/null +++ b/inform6/Tests/Test Cases/classordertest.inf @@ -0,0 +1,262 @@ +Constant Story "ClassOrderTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for how multiple-inheritance objects +! are resolved. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main loc; + #Ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 loc; + #Endif; ! TARGET_ + + loc = 0; + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #ifnot; + print "Game file format ", 0->0, ".^"; + #Endif; ! TARGET_GLULX +]; + +[ RunTest; + ClassOrderTest(); + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +Property genprop; +Property additive addprop; +Attribute attr1; +Attribute attr2; + +class Foo + with indprop 11, + with addprop 77, + has attr1, + has attr2; + +class Foofoo + class Foo + with indprop 111, + with genprop 222, + with addprop 777, + has ~attr1; + +class Bar + with indprop 22, + with genprop 33, + has ~attr1; + +class Mum + with genprop 44, + with addprop 55 66, + has attr2; + +class Qux + with addprop 88 99, + has ~attr2; + +Object obj1 + class Foo, + class Bar; + +Object obj2 + class Bar, + class Foo; + +Object obj3 + class Bar, + class Foo, + with indprop 4, + with genprop 4, + has ~attr1; + +Bar obj4 + with indprop 5; + +Bar obj5 + class Foo, + with indprop 6; + +Bar obj5a + with indprop 7, + class Foo; + +Bar obj6 + class Foo; + +Foo obj7 + class Bar; + +Object obj8 + class Mum, + class Bar; + +Object obj8a + class Mum Bar; + +Qux obj9 + with addprop 2, + has attr2; + +Object obj10 + class Mum, + class Qux, + with addprop 3 4; + +Foofoo obj11; + +Object obj12 + class Foofoo, + class Bar, + has ~attr2; + +Object obj12a + class Foofoo Bar, + has ~attr2; + +Object obj13 + class Bar, + class Foofoo; + +Object obj13a + class Bar Foofoo; + +[ ClassOrderTest; + print "obj1.indprop: "; check_value(obj1.indprop, 11); print "^"; + print "obj2.indprop: "; check_value(obj2.indprop, 22); print "^"; + print "obj3.indprop: "; check_value(obj3.indprop, 4); print "^"; + print "obj4.indprop: "; check_value(obj4.indprop, 5); print "^"; + print "obj5.indprop: "; check_value(obj5.indprop, 6); print "^"; + print "obj5a.indprop: "; check_value(obj5a.indprop, 7); print "^"; + print "obj6.indprop: "; check_value(obj6.indprop, 22); print "^"; + print "obj7.indprop: "; check_value(obj7.indprop, 11); print "^"; + print "obj11.indprop: "; check_value(obj11.indprop, 111); print "^"; + print "obj12.indprop: "; check_value(obj12.indprop, 111); print "^"; + print "obj12a.indprop: "; check_value(obj12a.indprop, 111); print "^"; + print "obj13.indprop: "; check_value(obj13.indprop, 22); print "^"; + print "obj13a.indprop: "; check_value(obj13a.indprop, 22); print "^"; + + print "obj3.genprop: "; check_value(obj3.genprop, 4); print "^"; + print "obj6.genprop: "; check_value(obj6.genprop, 33); print "^"; + print "obj7.genprop: "; check_value(obj7.genprop, 33); print "^"; + print "obj8.genprop: "; check_value(obj8.genprop, 44); print "^"; + print "obj8a.genprop: "; check_value(obj8a.genprop, 44); print "^"; + + print "obj8.#addprop: "; check_value(obj8.#addprop, WORDSIZE*2); print "^"; + print "obj8.addprop[0]: "; check_value(obj8.&addprop-->0, 55); print "^"; + print "obj8.addprop[1]: "; check_value(obj8.&addprop-->1, 66); print "^"; + + print "obj9.#addprop: "; check_value(obj9.#addprop, WORDSIZE*3); print "^"; + print "obj9.addprop[0]: "; check_value(obj9.&addprop-->0, 2); print "^"; + print "obj9.addprop[1]: "; check_value(obj9.&addprop-->1, 88); print "^"; + print "obj9.addprop[2]: "; check_value(obj9.&addprop-->2, 99); print "^"; + + print "obj10.#addprop: "; check_value(obj10.#addprop, WORDSIZE*6); print "^"; + print "obj10.addprop[0]: "; check_value(obj10.&addprop-->0, 3); print "^"; + print "obj10.addprop[1]: "; check_value(obj10.&addprop-->1, 4); print "^"; + print "obj10.addprop[2]: "; check_value(obj10.&addprop-->2, 55); print "^"; + print "obj10.addprop[3]: "; check_value(obj10.&addprop-->3, 66); print "^"; + print "obj10.addprop[4]: "; check_value(obj10.&addprop-->4, 88); print "^"; + print "obj10.addprop[5]: "; check_value(obj10.&addprop-->5, 99); print "^"; + + print "obj11.#addprop: "; check_value(obj11.#addprop, WORDSIZE*2); print "^"; + print "obj11.addprop[0]: "; check_value(obj11.&addprop-->0, 777); print "^"; + print "obj11.addprop[1]: "; check_value(obj11.&addprop-->1, 77); print "^"; + + print "obj1.attr1: "; check_value(obj1 has attr1, true); print "^"; + print "obj2.attr1: "; check_value(obj2 has attr1, true); print "^"; + print "obj3.attr1: "; check_value(obj3 has attr1, false); print "^"; + print "obj11.attr1: "; check_value(obj11 has attr1, false); print "^"; + print "obj12.attr1: "; check_value(obj12 has attr1, false); print "^"; + print "obj13.attr1: "; check_value(obj13 has attr1, false); print "^"; + + print "obj8.attr2: "; check_value(obj8 has attr2, true); print "^"; + print "obj9.attr2: "; check_value(obj9 has attr2, true); print "^"; + print "obj10.attr2: "; check_value(obj10 has attr2, true); print "^"; + print "obj11.attr2: "; check_value(obj11 has attr2, true); print "^"; + print "obj12.attr2: "; check_value(obj12 has attr2, false); print "^"; + print "obj13.attr2: "; check_value(obj13 has attr2, true); print "^"; +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + diff --git a/inform6/Tests/Test Cases/dictflagtest-G.inf b/inform6/Tests/Test Cases/dictflagtest-G.inf new file mode 100755 index 000000000..2d50ce2e4 --- /dev/null +++ b/inform6/Tests/Test Cases/dictflagtest-G.inf @@ -0,0 +1,326 @@ +Constant Story "DictFlagTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test, testing the new form of the Dictionary +! directive (proposed December 2011). If you try to compile this with an +! older I6 compiler, you'll get errors. + +! Given a newer I6 compiler, this test should compile and pass in both +! Z-code and Glulx. + +#ifndef TARGET_GLULX; + +! This magic constant tells I6 to use grammar version 2, which is the current +! standard. +Constant Grammar__Version 2; + +Constant HDR_GAMERELEASE $02; ! word +Constant HDR_DICTIONARY $08; ! word +Constant HDR_GAMESERIAL $12; ! six ASCII characters + +#ifnot; + +Global gg_mainwin; + +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters + +#endif; + +Global failures; + +[ Main loc; +#ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 loc; +#endif; + + Banner(); + new_line; + RunTest(); + + loc = print_dictionary; ! shut up unused-variable warnings + !print_dictionary(); +]; + +#ifndef TARGET_GLULX; + +[ Banner i; + if (Story ~= 0) { + style bold; + print (string) Story; + style roman; + } + if (Headline ~= 0) print ": ", (string) Headline; + print "Release "; + print (HDR_GAMERELEASE-->0) & $03ff; + print " / Serial number "; + for (i=0 : i<6 : i++) print (char) HDR_GAMESERIAL->i; + print " / Inform v"; inversion; + print ", compiler options "; + i = false; + #Ifdef STRICT_MODE; + print "S"; i++; + #Endif; ! STRICT_MODE + #Ifdef INFIX; + print "X"; i++; + #Ifnot; + #Ifdef DEBUG; + print "D"; i++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~i) print "(none)"; + new_line; +]; + +#ifnot; + +[ Banner i ix; + if (Story ~= 0) { + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + } + if (Headline ~= 0) print ": ", (string) Headline; + print "Release "; + @aloads ROM_GAMERELEASE 0 i; + print i; + print " / Serial number "; + for (i=0 : i<6 : i++) print (char) ROM_GAMESERIAL->i; + print " / Inform v"; inversion; + print ", compiler options "; + i = false; + #Ifdef STRICT_MODE; + print "S"; i++; + #Endif; ! STRICT_MODE + #Ifdef INFIX; + print "X"; i++; + #Ifnot; + #Ifdef DEBUG; + print "D"; i++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~i) print "(none)"; + new_line; + + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; +]; + +#endif; + +[ RunTest verboffset entrylen; + print "$DICT_WORD_SIZE=", DICT_WORD_SIZE; + print ", #dict_par1=", #dict_par1, ", #dict_par2=", #dict_par2, ", #dict_par3=", #dict_par3, ".^^"; + + ! Allow for the fact that verbs count down from 255 in Z-code, + ! but from 65535 in Glulx. + #ifndef TARGET_GLULX; + verboffset = $100; + entrylen = 9; + #ifnot; + verboffset = $10000; + entrylen = DICT_WORD_SIZE + 7; + #endif; + + ! Simple cases. + check_word('plain', $80, 0, 0); + check_word('noun1', $80, 0, 0); + check_word('noun2', $80, 0, 0); + check_word('plural//p', $84, 0, 0); + check_word('pluname', $84, 0, 0); + check_word('verb', $C1, verboffset-1, 0); + check_word('meta', $C3, verboffset-3, 0); + check_word('prep', $88, 0, 0); + + ! Any word referred to as a single-quoted literal in code gets bit 7 + ! set. To test the cases where it's not, we cleverly name a word by + ! adding entrylen to the previous dict word. + check_word('prep'+entrylen, $8, 0, 0); + check_word('verb'+entrylen, $41, verboffset-2, 0); + + ! And now, words defined with the new Dictionary directive. + check_word('foo', $80, 0, 0); + check_word('foo'+entrylen, $0, 0, 0); + check_word('bar', $90, 0, 0); + check_word('baz', $92, 0, 93); + check_word('dquot', $81, 0, 1); + check_word('pip', $87, 0, 22); + check_word('pop', $84, 0, 255); + check_word('merge', $C3, 0, $61); + check_word('mergeverb', $C5, verboffset-4, 123); + + ! Wordd using the 16-bit fields available in Glulx. + #ifdef TARGET_GLULX; + check_word('big', $FFFF, 0, $FFFF); + check_word('bigmerge', $12B4, 0, $4321); + #endif; + + new_line; + if (failures == 0) + print "Passed.^"; + else + print "FAILED! ", failures, " errors.^"; +]; + +Object thing1 with name 'noun1' 'pluname//p'; +Object thing2 with name "noun2"; + +Verb 'verb' * -> Dummy + * 'prep' -> Dummy; +Verb 'verb2' * 'prep2' -> Dummy; +Verb meta 'meta' * -> Dummy; +Verb 'mergeverb' * -> Dummy; + +[ DummySub; +]; + +Dictionary 'foo'; +Dictionary 'foo2'; +Dictionary 'bar' 16; +Dictionary 'baz' 18 93; +Dictionary "dquot" 1 1; +Constant PIPVAL 22; +Dictionary 'pip' 7 PIPVAL; +Dictionary 'pop' (PIPVAL-18) $FF; +Dictionary 'merge' $41 $41; +Dictionary 'merge' $42 $21; +Dictionary 'mergeverb' 4 123; + +#ifdef TARGET_GLULX; +Dictionary 'big' $FFFF $FFFF; +Dictionary 'bigmerge' $1030 $0301; +Dictionary 'bigmerge' $0204 $4020; +#endif; + +! The following lines, if uncommented, will produce warnings for Z-code +!Dictionary 'warning' $100; +!Dictionary 'warning' 0 $100; +! The following lines will produce warnings for both Glulx and Z-code +!Dictionary 'warning' $10000; +!Dictionary 'warning' 0 $10000; +!Dictionary 'warning' (-1); + +[ check_word wd want1 want2 want3 val1 val2 val3; + #ifndef TARGET_GLULX; + val1 = wd->#dict_par1; + val2 = wd->#dict_par2; + val3 = wd->#dict_par3; + #ifnot; + val1 = wd->(#dict_par1-1) * 256 + wd->#dict_par1; + val2 = wd->(#dict_par2-1) * 256 + wd->#dict_par2; + val3 = wd->(#dict_par3-1) * 256 + wd->#dict_par3; + #endif; + print "'", (address) wd, "'^"; + print " flag values: "; + print (Hex) val1; + if (val1 ~= want1) { + failures++; + print " (error, wanted ", (Hex) want1, ")"; + } + print " "; + print (Hex) val2; + if (val2 ~= want2) { + failures++; + print " (error, wanted ", (Hex) want2, ")"; + } + print " "; + print (Hex) val3; + if (val3 ~= want3) { + failures++; + print " (error, wanted ", (Hex) want3, ")"; + } + print "^"; +]; + +! This routine is not used in the test, but it may be handy for development. +! It prints out the entire dictionary. +[ print_dictionary ix dictstart dictlen entrylen wd; + #ifndef TARGET_GLULX; + dictstart = HDR_DICTIONARY-->0 + 7; + dictlen = (dictstart - 2)-->0; + entrylen = 9; + #ifnot; + dictstart = #dictionary_table + WORDSIZE; + dictlen = #dictionary_table-->0; + entrylen = DICT_WORD_SIZE + 7; + #endif; + + for (ix=0 : ix#dict_par1; + val2 = wd->#dict_par2; + val3 = wd->#dict_par3; + #ifnot; + val1 = wd->(#dict_par1-1) * 256 + wd->#dict_par1; + val2 = wd->(#dict_par2-1) * 256 + wd->#dict_par2; + val3 = wd->(#dict_par3-1) * 256 + wd->#dict_par3; + #endif; + print "'", (address) wd, "'^"; + print " flag values: "; + print (Hex) val1; + print " "; + print (Hex) val2; + print " "; + print (Hex) val3; + print "^"; +]; + +#ifndef TARGET_GLULX; + +[ Hex val byte initial ix; + print "$"; + initial = true; + for (ix=0 : ix<4 : ix++) { + @log_shift val (-12) -> byte; + @log_shift val 4 -> val; + byte = byte & $0F; + if (byte == 0 && initial && ix < 3) + continue; + initial = false; + if (byte <= 9) + print (char) (byte+'0'); + else + print (char) (byte-10+'A'); + } +]; + +#ifnot; + +[ Hex val byte initial ix; + print "$"; + initial = true; + for (ix=0 : ix<8 : ix++) { + @ushiftr val 28 byte; + @shiftl val 4 val; + byte = byte & $0F; + if (byte == 0 && initial && ix < 7) + continue; + initial = false; + if (byte <= 9) + print (char) (byte+'0'); + else + print (char) (byte-10+'A'); + } +]; + +#endif; diff --git a/inform6/Tests/Test Cases/dictflagtest.inf b/inform6/Tests/Test Cases/dictflagtest.inf new file mode 100755 index 000000000..2d50ce2e4 --- /dev/null +++ b/inform6/Tests/Test Cases/dictflagtest.inf @@ -0,0 +1,326 @@ +Constant Story "DictFlagTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test, testing the new form of the Dictionary +! directive (proposed December 2011). If you try to compile this with an +! older I6 compiler, you'll get errors. + +! Given a newer I6 compiler, this test should compile and pass in both +! Z-code and Glulx. + +#ifndef TARGET_GLULX; + +! This magic constant tells I6 to use grammar version 2, which is the current +! standard. +Constant Grammar__Version 2; + +Constant HDR_GAMERELEASE $02; ! word +Constant HDR_DICTIONARY $08; ! word +Constant HDR_GAMESERIAL $12; ! six ASCII characters + +#ifnot; + +Global gg_mainwin; + +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters + +#endif; + +Global failures; + +[ Main loc; +#ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 loc; +#endif; + + Banner(); + new_line; + RunTest(); + + loc = print_dictionary; ! shut up unused-variable warnings + !print_dictionary(); +]; + +#ifndef TARGET_GLULX; + +[ Banner i; + if (Story ~= 0) { + style bold; + print (string) Story; + style roman; + } + if (Headline ~= 0) print ": ", (string) Headline; + print "Release "; + print (HDR_GAMERELEASE-->0) & $03ff; + print " / Serial number "; + for (i=0 : i<6 : i++) print (char) HDR_GAMESERIAL->i; + print " / Inform v"; inversion; + print ", compiler options "; + i = false; + #Ifdef STRICT_MODE; + print "S"; i++; + #Endif; ! STRICT_MODE + #Ifdef INFIX; + print "X"; i++; + #Ifnot; + #Ifdef DEBUG; + print "D"; i++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~i) print "(none)"; + new_line; +]; + +#ifnot; + +[ Banner i ix; + if (Story ~= 0) { + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + } + if (Headline ~= 0) print ": ", (string) Headline; + print "Release "; + @aloads ROM_GAMERELEASE 0 i; + print i; + print " / Serial number "; + for (i=0 : i<6 : i++) print (char) ROM_GAMESERIAL->i; + print " / Inform v"; inversion; + print ", compiler options "; + i = false; + #Ifdef STRICT_MODE; + print "S"; i++; + #Endif; ! STRICT_MODE + #Ifdef INFIX; + print "X"; i++; + #Ifnot; + #Ifdef DEBUG; + print "D"; i++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~i) print "(none)"; + new_line; + + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; +]; + +#endif; + +[ RunTest verboffset entrylen; + print "$DICT_WORD_SIZE=", DICT_WORD_SIZE; + print ", #dict_par1=", #dict_par1, ", #dict_par2=", #dict_par2, ", #dict_par3=", #dict_par3, ".^^"; + + ! Allow for the fact that verbs count down from 255 in Z-code, + ! but from 65535 in Glulx. + #ifndef TARGET_GLULX; + verboffset = $100; + entrylen = 9; + #ifnot; + verboffset = $10000; + entrylen = DICT_WORD_SIZE + 7; + #endif; + + ! Simple cases. + check_word('plain', $80, 0, 0); + check_word('noun1', $80, 0, 0); + check_word('noun2', $80, 0, 0); + check_word('plural//p', $84, 0, 0); + check_word('pluname', $84, 0, 0); + check_word('verb', $C1, verboffset-1, 0); + check_word('meta', $C3, verboffset-3, 0); + check_word('prep', $88, 0, 0); + + ! Any word referred to as a single-quoted literal in code gets bit 7 + ! set. To test the cases where it's not, we cleverly name a word by + ! adding entrylen to the previous dict word. + check_word('prep'+entrylen, $8, 0, 0); + check_word('verb'+entrylen, $41, verboffset-2, 0); + + ! And now, words defined with the new Dictionary directive. + check_word('foo', $80, 0, 0); + check_word('foo'+entrylen, $0, 0, 0); + check_word('bar', $90, 0, 0); + check_word('baz', $92, 0, 93); + check_word('dquot', $81, 0, 1); + check_word('pip', $87, 0, 22); + check_word('pop', $84, 0, 255); + check_word('merge', $C3, 0, $61); + check_word('mergeverb', $C5, verboffset-4, 123); + + ! Wordd using the 16-bit fields available in Glulx. + #ifdef TARGET_GLULX; + check_word('big', $FFFF, 0, $FFFF); + check_word('bigmerge', $12B4, 0, $4321); + #endif; + + new_line; + if (failures == 0) + print "Passed.^"; + else + print "FAILED! ", failures, " errors.^"; +]; + +Object thing1 with name 'noun1' 'pluname//p'; +Object thing2 with name "noun2"; + +Verb 'verb' * -> Dummy + * 'prep' -> Dummy; +Verb 'verb2' * 'prep2' -> Dummy; +Verb meta 'meta' * -> Dummy; +Verb 'mergeverb' * -> Dummy; + +[ DummySub; +]; + +Dictionary 'foo'; +Dictionary 'foo2'; +Dictionary 'bar' 16; +Dictionary 'baz' 18 93; +Dictionary "dquot" 1 1; +Constant PIPVAL 22; +Dictionary 'pip' 7 PIPVAL; +Dictionary 'pop' (PIPVAL-18) $FF; +Dictionary 'merge' $41 $41; +Dictionary 'merge' $42 $21; +Dictionary 'mergeverb' 4 123; + +#ifdef TARGET_GLULX; +Dictionary 'big' $FFFF $FFFF; +Dictionary 'bigmerge' $1030 $0301; +Dictionary 'bigmerge' $0204 $4020; +#endif; + +! The following lines, if uncommented, will produce warnings for Z-code +!Dictionary 'warning' $100; +!Dictionary 'warning' 0 $100; +! The following lines will produce warnings for both Glulx and Z-code +!Dictionary 'warning' $10000; +!Dictionary 'warning' 0 $10000; +!Dictionary 'warning' (-1); + +[ check_word wd want1 want2 want3 val1 val2 val3; + #ifndef TARGET_GLULX; + val1 = wd->#dict_par1; + val2 = wd->#dict_par2; + val3 = wd->#dict_par3; + #ifnot; + val1 = wd->(#dict_par1-1) * 256 + wd->#dict_par1; + val2 = wd->(#dict_par2-1) * 256 + wd->#dict_par2; + val3 = wd->(#dict_par3-1) * 256 + wd->#dict_par3; + #endif; + print "'", (address) wd, "'^"; + print " flag values: "; + print (Hex) val1; + if (val1 ~= want1) { + failures++; + print " (error, wanted ", (Hex) want1, ")"; + } + print " "; + print (Hex) val2; + if (val2 ~= want2) { + failures++; + print " (error, wanted ", (Hex) want2, ")"; + } + print " "; + print (Hex) val3; + if (val3 ~= want3) { + failures++; + print " (error, wanted ", (Hex) want3, ")"; + } + print "^"; +]; + +! This routine is not used in the test, but it may be handy for development. +! It prints out the entire dictionary. +[ print_dictionary ix dictstart dictlen entrylen wd; + #ifndef TARGET_GLULX; + dictstart = HDR_DICTIONARY-->0 + 7; + dictlen = (dictstart - 2)-->0; + entrylen = 9; + #ifnot; + dictstart = #dictionary_table + WORDSIZE; + dictlen = #dictionary_table-->0; + entrylen = DICT_WORD_SIZE + 7; + #endif; + + for (ix=0 : ix#dict_par1; + val2 = wd->#dict_par2; + val3 = wd->#dict_par3; + #ifnot; + val1 = wd->(#dict_par1-1) * 256 + wd->#dict_par1; + val2 = wd->(#dict_par2-1) * 256 + wd->#dict_par2; + val3 = wd->(#dict_par3-1) * 256 + wd->#dict_par3; + #endif; + print "'", (address) wd, "'^"; + print " flag values: "; + print (Hex) val1; + print " "; + print (Hex) val2; + print " "; + print (Hex) val3; + print "^"; +]; + +#ifndef TARGET_GLULX; + +[ Hex val byte initial ix; + print "$"; + initial = true; + for (ix=0 : ix<4 : ix++) { + @log_shift val (-12) -> byte; + @log_shift val 4 -> val; + byte = byte & $0F; + if (byte == 0 && initial && ix < 3) + continue; + initial = false; + if (byte <= 9) + print (char) (byte+'0'); + else + print (char) (byte-10+'A'); + } +]; + +#ifnot; + +[ Hex val byte initial ix; + print "$"; + initial = true; + for (ix=0 : ix<8 : ix++) { + @ushiftr val 28 byte; + @shiftl val 4 val; + byte = byte & $0F; + if (byte == 0 && initial && ix < 7) + continue; + initial = false; + if (byte <= 9) + print (char) (byte+'0'); + else + print (char) (byte-10+'A'); + } +]; + +#endif; diff --git a/inform6/Tests/Test Cases/glulxercise-G.inf b/inform6/Tests/Test Cases/glulxercise-G.inf new file mode 100755 index 000000000..ccbd92388 --- /dev/null +++ b/inform6/Tests/Test Cases/glulxercise-G.inf @@ -0,0 +1,10548 @@ +!% $MEMORY_MAP_EXTENSION=256 + +Constant Story "Glulxercise"; +Constant Headline "A Glulx interpreter unit test^"; +Release 9; +Serial "161114"; +! Written by Andrew Plotkin (erkyrath@eblong.com). +! This unit test suite, and its functions, are in the public domain. + +! To compile this canonically, do "inform -G glulxercise.inf". No other +! options. + +! Comment out the following line if you are using an Inform 6 compiler +! that lacks the new floating-point opcodes. +Constant FLOAT_OPCODES_AVAILABLE; + +Constant GG_MAINWIN_ROCK 201; +Constant GG_SAVESTR_ROCK 301; +Constant GG_SCRIPTSTR_ROCK 302; +Constant GG_SCRIPTFREF_ROCK 401; +Constant GG_SAVEFREF_ROCK 402; + +Global gg_mainwin = 0; +Global gg_savestr = 0; +Global gg_savefref = 0; +Global gg_scriptfref = 0; +Global gg_scriptstr = 0; + +Array gg_event --> 4; +Array gg_arguments --> 8; + +!Constant HDR_MAGICNUMBER $00; ! long word +Constant HDR_GLULXVERSION $04; ! long word +!Constant HDR_RAMSTART $08; ! long word +Constant HDR_EXTSTART $0C; ! long word +Constant HDR_ENDMEM $10; ! long word +!Constant HDR_STACKSIZE $14; ! long word +!Constant HDR_STARTFUNC $18; ! long word +Constant HDR_DECODINGTBL $1C; ! long word +!Constant HDR_CHECKSUM $20; ! long word +!Constant ROM_INFO $24; ! four ASCII characters +!Constant ROM_MEMORYLAYOUT $28; ! long word +!Constant ROM_INFORMVERSION $2C; ! four ASCII characters +!Constant ROM_COMPVERSION $30; ! four ASCII characters +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters + +Constant INPUT_BUFFER_LEN = 260; ! No extra byte necessary +Constant MAX_BUFFER_WORDS = 20; +Constant PARSE_BUFFER_LEN = 244; ! 4 + MAX_BUFFER_WORDS*4; + +Array buffer buffer INPUT_BUFFER_LEN; +Array parse --> PARSE_BUFFER_LEN/WORDSIZE; + +Global allstackdepth; +Global failures = 0; +Global total_failures = 0; + +[ Main ix; + GGInitialise(); + + ! deal with some compiler warnings + ix = PrintShortName; + + if (startovertest-->0 == 1234 && startovertest-->1 == 2 && startovertest-->2 == 0) { + ! Part of UndoRestartTest. + new_line; + print "A voice booooms out: You've been here before!^^"; + startovertest-->1 = 3; + startovertest-->2 = 3; + print "Restoring undo...^"; + @restoreundo ix; + print "Undo failed (", ix, ")! Exiting.^"; + @quit; + } + + new_line; + Banner(); + new_line; + + LookSub(); + TestLoop(); + + print "^Exiting via return. (Try ~opquit~ for @@64quit, ~glkquit~ for glk_exit().)^"; + print "^Goodbye.^"; +]; + +[ GGInitialise res; + @gestalt 4 2 res; ! Test if this interpreter has Glk. + if (res == 0) { + ! Without Glk, we're entirely screwed. + quit; + } + ! Set the VM's I/O system to be Glk. + @setiosys 2 0; + + ! First, we must go through all the Glk objects that exist, and see + ! if we created any of them. One might think this strange, since the + ! program has just started running, but remember that the player might + ! have just typed "restart". + + GGRecoverObjects(); + + ! Now, gg_mainwin might already be set. If not, set it. + + if (gg_mainwin == 0) { + ! Open the story window. + gg_mainwin = glk($0023, 0, 0, 0, 3, GG_MAINWIN_ROCK); ! window_open + if (gg_mainwin == 0) { + ! If we can't even open one window, there's no point in going on. + quit; + } + } + else { + ! There was already a story window. + ! glk($002A, gg_mainwin); ! window_clear + } + + glk($002F, gg_mainwin); ! set_window +]; + +[ GGRecoverObjects id; + ! If GGRecoverObjects() has been called, all these stored IDs are + ! invalid, so we start by clearing them all out. + ! (In fact, after a restoreundo, some of them may still be good. + ! For simplicity, though, we assume the general case.) + gg_mainwin = 0; + gg_scriptfref = 0; + gg_scriptstr = 0; + gg_savefref = 0; + gg_savestr = 0; + + id = glk($0040, 0, gg_arguments); ! stream_iterate + while (id) { + switch (gg_arguments-->0) { + GG_SAVESTR_ROCK: gg_savestr = id; + GG_SCRIPTSTR_ROCK: gg_scriptstr = id; + } + id = glk($0040, id, gg_arguments); ! stream_iterate + } + + id = glk($0020, 0, gg_arguments); ! window_iterate + while (id) { + switch (gg_arguments-->0) { + GG_MAINWIN_ROCK: gg_mainwin = id; + } + id = glk($0020, id, gg_arguments); ! window_iterate + } + + id = glk($0064, 0, gg_arguments); ! fileref_iterate + while (id) { + switch (gg_arguments-->0) { + GG_SAVEFREF_ROCK: gg_savefref = id; + GG_SCRIPTFREF_ROCK: gg_scriptfref = id; + } + id = glk($0064, id, gg_arguments); ! fileref_iterate + } +]; + +[ Keyboard; + while (true) { + print ">"; + KeyboardPrimitive(buffer, parse); + if (parse-->0) + break; + } +]; + +[ KeyboardPrimitive a_buffer a_table done; + done = false; + glk($00D0, gg_mainwin, a_buffer+WORDSIZE, INPUT_BUFFER_LEN-WORDSIZE, 0); ! request_line_event + while (~~done) { + glk($00C0, gg_event); ! select + switch (gg_event-->0) { + 3: ! evtype_LineInput + if (gg_event-->1 == gg_mainwin) { + a_buffer-->0 = gg_event-->2; + done = true; + } + } + } + Tokenise__(a_buffer,a_table); +]; + +Array gg_tokenbuf -> DICT_WORD_SIZE; + +[ Tokenise__ buf tab + cx numwords len bx ix wx wpos wlen val res dictlen entrylen; + len = buf-->0; + buf = buf+WORDSIZE; + + ! First, split the buffer up into words. We use the standard Infocom + ! list of word separators (comma, period, double-quote). + + cx = 0; + numwords = 0; + while (cx < len) { + while (cx < len && buf->cx == ' ') cx++; + if (cx >= len) break; + bx = cx; + if (buf->cx == '.' or ',' or '"') cx++; + else { + while (cx < len && buf->cx ~= ' ' or '.' or ',' or '"') cx++; + } + tab-->(numwords*3+2) = (cx-bx); + tab-->(numwords*3+3) = WORDSIZE+bx; + numwords++; + if (numwords >= MAX_BUFFER_WORDS) break; + } + tab-->0 = numwords; + + ! Now we look each word up in the dictionary. + + dictlen = #dictionary_table-->0; + entrylen = DICT_WORD_SIZE + 7; + + for (wx=0 : wx(wx*3+2); + wpos = tab-->(wx*3+3); + + ! Copy the word into the gg_tokenbuf array, clipping to DICT_WORD_SIZE + ! characters and lower case. + if (wlen > DICT_WORD_SIZE) wlen = DICT_WORD_SIZE; + cx = wpos - WORDSIZE; + for (ix=0 : ixix = glk($00A0, buf->(cx+ix)); + for (: ixix = 0; + + val = #dictionary_table + WORDSIZE; + @binarysearch gg_tokenbuf DICT_WORD_SIZE val entrylen dictlen 1 1 res; + tab-->(wx*3+1) = res; + } +]; + +[ Banner i ix; + if (Story ~= 0) { + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + } + if (Headline ~= 0) print ": ", (string) Headline; + print "Release "; + @aloads ROM_GAMERELEASE 0 i; + print i; + print " / Serial number "; + for (i=0 : i<6 : i++) print (char) ROM_GAMESERIAL->i; + print " / Inform v"; inversion; + print ", compiler options "; + i = false; + #Ifdef STRICT_MODE; + print "S"; i++; + #Endif; ! STRICT_MODE + #Ifdef INFIX; + print "X"; i++; + #Ifnot; + #Ifdef DEBUG; + print "D"; i++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~i) print "(none)"; + new_line; + + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; +]; + +[ TestLoop wd paddr plen ix obj found; + while (true) { + new_line; + if (failures) { + print failures, " uncounted test failures!^^"; + failures = 0; + } + + Keyboard(); + wd = parse-->1; + + if (wd == 'quit' or 'q//' or 'exit') + return; + + found = nothing; + + objectloop (obj ofclass TestClass) { + paddr = obj.&name; + plen = obj.#name / WORDSIZE; + for (ix=0 : ixix == wd) { + found = obj; + break; + } + } + if (found) + break; + } + + if (~~found) { + print "I don't understand that command.^"; + continue; + } + + allstackdepth = 0; + found.testfunc(); + } +]; + +Attribute meta; + +Class TestClass + with + short_name 0, + testfunc TestNothing, + fail_count; + +Class TestFloatClass + class TestClass; + +[ PrintShortName obj; + if (obj provides short_name && obj.short_name) { + print (string) obj.short_name; + rtrue; + } + if (obj ofclass TestClass) { + print (address) obj.name; + rtrue; + } + print (object) obj; +]; + +[ Hex val byte initial ix; + print "$"; + initial = true; + for (ix=0 : ix<8 : ix++) { + @ushiftr val 28 byte; + @shiftl val 4 val; + byte = byte & $0F; + if (byte == 0 && initial && ix < 7) + continue; + initial = false; + if (byte <= 9) + print (char) (byte+'0'); + else + print (char) (byte-10+'A'); + } +]; + +[ string_to_array val arr arrlen str oldstr len; + oldstr = glk($0048); ! stream_get_current + str = glk($0043, arr, arrlen, 1, 0); ! stream_open_memory + if (str == 0) return 0; + + glk($0047, str); ! stream_set_current + + if (val->0 == $c0 or $c1) + val(); + else + @streamstr val; + + glk($0047, oldstr); ! stream_set_current + @copy $ffffffff sp; + @copy str sp; + @glk $0044 2 0; ! stream_close + @copy sp len; + @copy sp 0; + + return len; +]; + +[ func_to_array _vararg_count arr arrlen func str oldstr len; + @copy sp arr; + @copy sp arrlen; + @copy sp func; + _vararg_count = _vararg_count-3; + + oldstr = glk($0048); ! stream_get_current + str = glk($0043, arr, arrlen, 1, 0); ! stream_open_memory + if (str == 0) return 0; + + glk($0047, str); ! stream_set_current + + @call func _vararg_count 0; + + glk($0047, oldstr); ! stream_set_current + @copy $ffffffff sp; + @copy str sp; + @glk $0044 2 0; ! stream_close + @copy sp len; + @copy sp 0; + + return len; +]; + +[ string_to_uniarray val arr arrlen str oldstr len; + oldstr = glk($0048); ! stream_get_current + str = glk($0139, arr, arrlen, 1, 0); ! stream_open_memory_uni + if (str == 0) return 0; + + glk($0047, str); ! stream_set_current + + if (val->0 == $c0 or $c1) + val(); + else + @streamstr val; + + glk($0047, oldstr); ! stream_set_current + @copy $ffffffff sp; + @copy str sp; + @glk $0044 2 0; ! stream_close + @copy sp len; + @copy sp 0; + + return len; +]; + +[ check val wanted; + if (val == wanted) { + print val; + rtrue; + } + failures++; + print val, " (should be ", wanted, " FAIL)"; + rfalse; +]; + +[ check_nonzero val; + if (val) { + print (Hex) val; + rtrue; + } + failures++; + print val, " (should be nonzero FAIL)"; + rfalse; +]; + +[ check_range val wantmin wantmax; + if (val >= wantmin && val <= wantmax) { + print val; + rtrue; + } + failures++; + print val, " (should be in [", wantmin, "..", wantmax, "] FAIL)"; + rfalse; +]; + +[ check_hex val wanted; + if (val == wanted) { + print (Hex) val; + rtrue; + } + failures++; + print (Hex) val, " (should be ", (Hex) wanted, " FAIL)"; + rfalse; +]; + +[ check_list _vararg_count arr ix wanted; + @copy sp arr; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp wanted; + if (ix) + print ", "; + if (wanted == arr-->ix) { + print wanted; + } + else { + failures++; + print arr-->ix, " (should be ", wanted, " FAIL)"; + } + } +]; + +[ check_bytelist _vararg_count arr ix wanted val; + @copy sp arr; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp wanted; + if (ix) + print ", "; + @aloadb arr ix val; + if (wanted == val) { + print wanted; + } + else { + failures++; + print val, " (should be ", wanted, " FAIL)"; + } + } +]; + +[ check_str str len newlen ix good ch; + good = true; + newlen = string_to_array(str, bigbuffer2, BIGBUFSIZE); + if (newlen ~= len) { + good = false; + } + else { + for (ix=0 : ixix ~= bigbuffer2->ix) + good = false; + } + } + print "~"; + for (ix=0 : ixix; + @streamchar ch; + } + print "~ len ", len; + if (~~good) { + failures++; + print " (should be ~"; + for (ix=0 : ixix; + @streamchar ch; + } + print "~ len ", newlen, ", FAIL)"; + } +]; + +[ check_ustr str len newlen ix good ch; + good = true; + newlen = string_to_uniarray(str, bigubuffer2, BIGBUFSIZE); + if (newlen ~= len) { + good = false; + } + else { + for (ix=0 : ixix ~= bigubuffer2-->ix) + good = false; + } + } + print "~"; + for (ix=0 : ixix; + @streamunichar ch; + } + print "~ len ", len; + if (~~good) { + failures++; + print " (should be ~"; + for (ix=0 : ixix; + @streamunichar ch; + } + print "~ len ", newlen, ", FAIL)"; + } +]; + +[ count_failures val; + print "^"; + if (failures) { + val = failures; + total_failures = total_failures + failures; + failures = 0; + print_ret val, " tests failed."; + } + else { + "Passed."; + } +]; + +[ run_all_tests cla obj startfail res ix; + startfail = total_failures; + objectloop (obj ofclass cla) { + if (obj has meta) + continue; + + res = total_failures; + print "^"; + allstackdepth = 148; + obj.testfunc(); + obj.fail_count = total_failures - res; + } + res = total_failures - startfail; + if (res == 0) { + "^All tests passed."; + } + else { + print "^", res, " tests failed overall: "; + ix = 0; + objectloop (obj ofclass cla) { + if (obj.fail_count) { + if (ix) + print ", "; + print (name) obj, " (", obj.fail_count, ")"; + ix++; + } + } + "."; + } +]; + +TestClass LookAction + with name 'look' 'l//' 'help' '?//', + testfunc LookSub, + has meta; + +TestClass VersionAction + with name 'version', + testfunc Banner, + has meta; + +TestClass OpQuitAction + with name 'opquit' 'opq' 'opexit', + testfunc [; + print "^Exiting via @@64quit. (Try ~quit~ for return, ~glkquit~ for glk_exit().)^"; + print "^Goodbye.^"; + @quit; + ], + has meta; + +TestClass GlkQuitAction + with name 'glkquit' 'glkq' 'glkexit', + testfunc [ val; + print "^Exiting via glk_exit(). (Try ~quit~ for return, ~opquit~ for @@64quit.)^"; + print "^Goodbye.^"; + @glk $0001 0 val; ! exit + ], + has meta; + +TestClass AllAction + with name 'all', + testfunc [; + print "All tests:^"; + run_all_tests(TestClass); + ], + has meta; + +TestClass AllFloatAction + with name 'allfloat' 'floatall', + testfunc [; + print "All floating-point tests:^"; + run_all_tests(TestFloatClass); + ], + has meta; + +[ TestNothing; + "Nothing happens."; +]; + +[ LookSub obj ix; + print "A voice booooms out: Welcome to the test chamber.^^"; + print "Type ~help~ to repeat this message, ~quit~ to exit, + ~all~ to run all tests, or one of the following test options: "; + + ix = 0; + objectloop (obj ofclass TestClass) { + if (obj has meta) + continue; + if (ix) print ", "; + print "~", (name) obj, "~"; + ix++; + } + print ".^"; + if (total_failures) { + print "^", total_failures, " tests have failed so far in this run.^"; + } +]; + +Global testglobal; +Global testglobal2; + +TestClass OperandTest + with name 'operand' 'operands', + testfunc [ val; + print "Basic operand access:^^"; + + @nop; ! we have to test it somewhere. + + ! discards have no effect + @copy testglobal 0; + @copy val 0; + @copy $12356 0; + @copy 99 sp; + @copy sp 0; + @stkcount val; + print "stkcount="; check(val, 0); print "^"; + + @copy 0 val; + print "Constants: zero="; check(val, 0); print ", "; + @copy (-1) val; + print "-1="; check(val, -1); print ", "; + @copy (16) val; + print "16="; check(val, 16); print ", "; + @copy (-$81) val; + print "-$81="; check_hex(val, -$81); print ", "; + @copy ($100) val; + print "$100="; check_hex(val, $100); print ", "; + @copy (-$8000) val; + print "-$8000="; check_hex(val, -$8000); print ", "; + @copy ($10000) val; + print "$10000="; check_hex(val, $10000); print ", "; + @copy ($7FFFFFFF) val; + print "$7FFFFFFF="; check_hex(val, $7FFFFFFF); print ", "; + @copy ($80000000) val; + print "$80000000="; check_hex(val, $80000000); print ", "; + @copy ($CDEF1234) val; + print "$CDEF1234="; check_hex(val, $CDEF1234); print "^"; + + @add 0 0 val; + print "Constants: zero="; check(val, 0); print ", "; + @add 0 (-1) val; + print "-1="; check(val, -1); print ", "; + @add 0 (16) val; + print "16="; check(val, 16); print ", "; + @add 0 (-$81) val; + print "-$81="; check_hex(val, -$81); print ", "; + @add 0 ($100) val; + print "$100="; check_hex(val, $100); print ", "; + @add 0 (-$8000) val; + print "-$8000="; check_hex(val, -$8000); print ", "; + @add 0 ($10000) val; + print "$10000="; check_hex(val, $10000); print ", "; + @add 0 ($7FFFFFFF) val; + print "$7FFFFFFF="; check_hex(val, $7FFFFFFF); print ", "; + @add 0 ($80000000) val; + print "$80000000="; check_hex(val, $80000000); print ", "; + @add 0 ($CDEF1234) val; + print "$CDEF1234="; check_hex(val, $CDEF1234); print "^"; + + testglobal = 123; + @copy testglobal val; + print "Global to local 123="; check(val, 123); + print "="; check(#globals_array --> #g$testglobal, 123); print ", "; + val = 321; + @copy val testglobal; + val = 0; + @copy testglobal val; + print "local to global 321="; check(val, 321); + print "="; check(#globals_array --> #g$testglobal, 321); print "^"; + + @copy 456 sp; + val = 0; + @copy sp val; + print "Stack: 456="; check(val, 456); print ", "; + + @copy 933 sp; + val = noop(); + @copy sp val; + print "Stack: 933="; check(val, 933); print "^"; + + testglobal = 123; + @copy testglobal sp; + val = 0; + @copy sp val; + print "Global to stack: 123="; check(val, 123); print "^"; + + @copy 789 sp; + @copy sp sp; ! might as well check this case + @copy sp val; + print "Stack to stack: 789="; check(val, 789); print ", "; + + @copy 1234 sp; + val = noop(); + @copy sp sp; ! might as well check this case + @copy sp val; + print "Stack to stack: 1234="; check(val, 1234); print "^"; + + count_failures(); + ]; + +TestClass ArithTest + with name 'arith', + testfunc [ val; + print "Integer arithmetic:^^"; + + @add 2 2 val; + print "2+2="; check(val, 4); print ", "; + @add (-2) (-3) val; + print "-2+-3="; check(val, -5); print ", "; + @add 3 (-4) val; + print "3+-4="; check(val, -1); print ", "; + @add (-4) 5 val; + print "-4+5="; check(val, 1); print ", "; + @add $7FFFFFFF $7FFFFFFE val; + print "$7FFFFFFF+$7FFFFFFE="; check(val, -3); print ", "; + @add $80000000 $80000000 val; + print "$80000000+$80000000="; check(val, 0); print "^"; + testglobal = 6; testglobal2 = 8; + @add testglobal testglobal2 val; + print "Globals 6+8="; check(val, 14); print "^"; + + @sub 2 2 val; + print "2-2="; check(val, 0); print ", "; + @sub (-2) 3 val; + print "-2-3="; check(val, -5); print ", "; + @sub 3 4 val; + print "3-4="; check(val, -1); print ", "; + @sub (-4) (-5) val; + print "-4-(-5)="; check(val, 1); print ", "; + @sub $7FFFFFFF $7FFFFFFE val; + print "$7FFFFFFF-$7FFFFFFE="; check(val, 1); print ", "; + @sub $80000000 $80000001 val; + print "$80000000-$80000001="; check(val, -1); print ", "; + @sub $7FFFFFFF $80000001 val; + print "$7FFFFFFF-$80000001="; check(val, -2); print "^"; + testglobal = 6; testglobal2 = 8; + @sub testglobal testglobal2 val; + print "Globals 6-8="; check(val, -2); print "^"; + + @mul 2 2 val; + print "2*2="; check(val, 4); print ", "; + @mul (-2) (-3) val; + print "-2*-3="; check(val, 6); print ", "; + @mul 3 (-4) val; + print "3*-4="; check(val, -12); print ", "; + @mul (-4) 5 val; + print "-4*5="; check(val, -20); print ", "; + @mul $10000 $10000 val; + print "$10000*$10000 (trunc)="; check(val, 0); print ", "; + @mul 311537 335117 val; + print "311537*335117 (trunc)="; check_hex(val, 1322129725); print "^"; + testglobal = -6; testglobal2 = -8; + @mul testglobal testglobal2 val; + print "Globals -6*-8="; check(val, 48); print "^"; + + @div 12 3 val; + print "12/3="; check(val, 4); print ", "; + @div 11 2 val; + print "11/2="; check(val, 5); print ", "; + @div (-11) 2 val; + print "-11/2="; check(val, -5); print ", "; + @div 11 (-2) val; + print "11/-2="; check(val, -5); print ", "; + @div (-11) (-2) val; + print "-11/-2="; check(val, 5); print ", "; + @div $7fffffff 2 val; + print "$7fffffff/2="; check_hex(val, $3fffffff); print ", "; + @div $7fffffff (-2) val; + print "$7fffffff/-2="; check_hex(val, -$3fffffff); print ", "; + @div (-$7fffffff) 2 val; + print "-$7fffffff/2="; check_hex(val, -$3fffffff); print ", "; + @div (-$7fffffff) (-2) val; + print "-$7fffffff/-2="; check_hex(val, $3fffffff); print ", "; + @div $80000000 2 val; + print "$80000000/2="; check_hex(val, $C0000000); print ", "; + @div $80000000 (-2) val; + print "$80000000/(-2)="; check_hex(val, $40000000); print ", "; + @div $80000000 1 val; + print "$80000000/1="; check_hex(val, $80000000); print "^"; + + testglobal = -48; testglobal2 = -8; + @div testglobal testglobal2 val; + print "Globals -48/-8="; check(val, 6); print ", "; + testglobal = 48; testglobal2 = 7; + @div testglobal testglobal2 val; + print "48/7="; check(val, 6); print ", "; + testglobal = 48; testglobal2 = -7; + @div testglobal testglobal2 val; + print "48/-7="; check(val, -6); print ", "; + testglobal = -48; testglobal2 = 7; + @div testglobal testglobal2 val; + print "-48/7="; check(val, -6); print ", "; + testglobal = -48; testglobal2 = -7; + @div testglobal testglobal2 val; + print "-48/-7="; check(val, 6); print "^"; + + @mod 12 3 val; + print "12%3="; check(val, 0); print ", "; + @mod 13 5 val; + print "13%5="; check(val, 3); print ", "; + @mod (-13) 5 val; + print "-13%5="; check(val, -3); print ", "; + @mod 13 (-5) val; + print "13%-5="; check(val, 3); print ", "; + @mod (-13) (-5) val; + print "-13%-5="; check(val, -3); print ", "; + @mod $7fffffff 7 val; + print "$7fffffff%7="; check(val, 1); print ", "; + @mod (-$7fffffff) 7 val; + print "-$7fffffff%7="; check(val, -1); print ", "; + @mod $7fffffff (-7) val; + print "$7fffffff%-7="; check(val, 1); print ", "; + @mod (-$7fffffff) (-7) val; + print "-$7fffffff%-7="; check(val, -1); print ", "; + @mod $80000000 7 val; + print "$80000000%7="; check(val, -2); print ", "; + @mod $80000000 (-7) val; + print "$80000000%-7="; check(val, -2); print ", "; + @mod $80000000 2 val; + print "$80000000%2="; check(val, 0); print ", "; + @mod $80000000 (-2) val; + print "$80000000%-2="; check(val, 0); print ", "; + @mod $80000000 1 val; + print "$80000000%1="; check(val, 0); print "^"; + + testglobal = 49; testglobal2 = 8; + @mod testglobal testglobal2 val; + print "Globals 49%8="; check(val, 1); print ", "; + testglobal = 49; testglobal2 = -8; + @mod testglobal testglobal2 val; + print "49%-8="; check(val, 1); print ", "; + testglobal = -49; testglobal2 = 8; + @mod testglobal testglobal2 val; + print "-49%8="; check(val, -1); print ", "; + testglobal = -49; testglobal2 = -8; + @mod testglobal testglobal2 val; + print "-49%-8="; check(val, -1); print "^"; + + @neg 0 val; + print "-(0)="; check(val, 0); print ", "; + @neg 5 val; + print "-(5)="; check(val, -5); print ", "; + @neg (-5) val; + print "-(-5)="; check(val, 5); print ", "; + @neg $7FFFFFFF val; + print "-($7FFFFFFF)="; check(val, $80000001); print ", "; + @neg $80000001 val; + print "-($80000001)="; check(val, $7FFFFFFF); print ", "; + @neg $80000000 val; + print "-($80000000)="; check_hex(val, $80000000); print "^"; + + testglobal = $80000001; + @neg testglobal val; + print "global -($80000001)="; check(val, $7FFFFFFF); print "^"; + + count_failures(); + ]; + +TestClass BigMulTest + with name 'bigmul', + testfunc [ val loc1 loc2; + print "Large integer multiplication:^^"; + + @mul 51537 35117 val; + print "51537*35117="; check_hex(val, 1809824829); print "^"; + @mul (-51539) 35117 val; + print "-51539*35117="; check_hex(val, -1809895063); print "^"; + @mul 51537 (-35119) val; + print "51537*-35119="; check_hex(val, -1809927903); print "^"; + @mul (-51539) (-35119) val; + print "-51539*-35119="; check_hex(val, 1809998141); print "^"; + + loc1 = 51537; + loc2 = 35117; + @mul loc1 loc2 val; + print "51537*35117 (loc)="; check_hex(val, 1809824829); print "^"; + + testglobal = 51537; + testglobal2 = 35117; + @mul testglobal testglobal2 val; + print "51537*35117 (glob)="; check_hex(val, 1809824829); print "^"; + + loc1 = $5432FEDB; + loc2 = -1; + @mul loc1 loc2 val; + print "$5432FEDB*-1 (loc)="; check_hex(val, -$5432FEDB); print "^"; + + testglobal = $1C10FF9E; + loc2 = -3; + @mul testglobal loc2 val; + print "$1C10FF9E*-3 (glob,loc)="; check_hex(val, -$5432FEDA); print "^"; + new_line; + + testglobal = $7654321; + @mul testglobal 1 val; + print "$7654321*1="; check_hex(val, $7654321); print "^"; + @mul testglobal 2 val; + print "$7654321*2="; check_hex(val, $ECA8642); print "^"; + @mul testglobal 4 val; + print "$7654321*4="; check_hex(val, $1D950C84); print "^"; + @mul testglobal 5 val; + print "$7654321*5="; check_hex(val, $24FA4FA5); print "^"; + @mul testglobal 8 val; + print "$7654321*8="; check_hex(val, $3B2A1908); print "^"; + @mul testglobal 16 val; + print "$7654321*16="; check_hex(val, $76543210); print "^"; + @mul testglobal 32 val; + print "$7654321*32="; check_hex(val, $ECA86420); print "^"; + @mul testglobal 64 val; + print "$7654321*64="; check_hex(val, $D950C840); print "^"; + @mul testglobal 128 val; + print "$7654321*128="; check_hex(val, $B2A19080); print "^"; + @mul testglobal 256 val; + print "$7654321*256="; check_hex(val, $65432100); print "^"; + @mul testglobal 1024 val; + print "$7654321*1024="; check_hex(val, $950C8400); print "^"; + @mul testglobal 32768 val; + print "$7654321*32768="; check_hex(val, $A1908000); print "^"; + @mul testglobal 65536 val; + print "$7654321*65536="; check_hex(val, $43210000); print "^"; + + new_line; + + testglobal = $7654321; + @mul 1 testglobal val; + print "1*$7654321="; check_hex(val, $7654321); print "^"; + @mul 2 testglobal val; + print "2*$7654321="; check_hex(val, $ECA8642); print "^"; + @mul 4 testglobal val; + print "4*$7654321="; check_hex(val, $1D950C84); print "^"; + @mul 5 testglobal val; + print "5*$7654321="; check_hex(val, $24FA4FA5); print "^"; + @mul 8 testglobal val; + print "8*$7654321="; check_hex(val, $3B2A1908); print "^"; + @mul 16 testglobal val; + print "16*$7654321="; check_hex(val, $76543210); print "^"; + @mul 32 testglobal val; + print "32*$7654321="; check_hex(val, $ECA86420); print "^"; + @mul 64 testglobal val; + print "64*$7654321="; check_hex(val, $D950C840); print "^"; + @mul 128 testglobal val; + print "128*$7654321="; check_hex(val, $B2A19080); print "^"; + @mul 256 testglobal val; + print "256*$7654321="; check_hex(val, $65432100); print "^"; + @mul 1024 testglobal val; + print "1024*$7654321="; check_hex(val, $950C8400); print "^"; + @mul 32768 testglobal val; + print "32768*$7654321="; check_hex(val, $A1908000); print "^"; + @mul 65536 testglobal val; + print "65536*$7654321="; check_hex(val, $43210000); print "^"; + + new_line; + + @mul $7FFFFFFF $7FFFFFFF val; + print "$7FFFFFFF*$7FFFFFFF (trunc)="; check_hex(val, 1); print "^"; + + testglobal = $7FFFFFFF; + testglobal2 = $7FFFFFFE; + @mul testglobal testglobal2 val; + print "$7FFFFFFF*$7FFFFFFE (glob,trunc)="; check_hex(val, $80000002); print "^"; + + loc1 = -$7FFFFFFE; + loc2 = $7FFFFFFE; + @mul loc1 loc2 val; + print "-$7FFFFFFE*$7FFFFFFE (loc,trunc)="; check_hex(val, -4); print "^"; + + @mul $10000003 $10000007 val; + print "$10000003*$10000007 (trunc)="; check_hex(val, $A0000015); print "^"; + + testglobal = $10000001; + testglobal2 = $10000003; + @mul testglobal testglobal2 val; + print "$10000001*$10000003 (glob,trunc)="; check_hex(val, $40000003); print "^"; + + loc1 = -$10000005; + loc2 = $10000007; + @mul loc1 loc2 val; + print "-$10000005*$10000007 (loc,trunc)="; check_hex(val, $3FFFFFDD); print "^"; + + count_failures(); + ]; + +TestClass CompoundVarTest + with name 'comvar' 'compvar', + testfunc [ loc1 loc2; + print "Compound variable juggling:^^"; + + @copy 5 loc1; + @copy loc1 loc2; + @copy 6 loc1; + print "6="; check(loc1, 6); print ", "; + print "5="; check(loc2, 5); print "^"; + + @copy 3 loc1; + @add loc1 loc1 loc1; + @add loc1 loc1 loc2; + print "12="; check(loc2, 12); print ", "; + + @copy 2 loc1; + @mul loc1 loc1 loc1; + @mul loc1 loc1 loc2; + print "16="; check(loc2, 16); print ", "; + + @copy 3 loc1; + @add loc1 loc1 loc1; + @mul loc1 loc1 loc2; + print "36="; check(loc2, 36); print ", "; + + @copy 4 loc1; + @mul loc1 loc1 loc1; + @add loc1 loc1 loc2; + print "32="; check(loc2, 32); print "^"; + + @copy 7 sp; + @copy sp loc1; + @copy loc1 loc2; + print "7="; check(loc2, 7); print ", "; + + @copy 5 testglobal; + @add testglobal 1 loc1; + @copy loc1 sp; + @copy sp loc2; + print "6="; check(loc1, 6); print ", "; + print "6="; check(loc2, 6); print "^"; + + @copy 8 sp; + @copy 6 testglobal; + @add testglobal 1 loc1; + @copy loc1 sp; + @copy sp loc2; + @stkcopy 1; + print "7="; check(loc1, 7); print ", "; + print "7="; check(loc2, 7); print "^"; + @copy sp loc1; + @copy sp loc2; + print "8="; check(loc1, 8); print ", "; + print "8="; check(loc2, 8); print "^"; + + count_failures(); + ]; + +TestClass CompoundArithTest + with name 'comarith' 'comparith', + testfunc [ val xloc yloc zloc; + print "Compound arithmetic expressions:^^"; + + xloc = 7; + yloc = 2; + zloc = -4; + val = (xloc + yloc) * zloc; + print "(7+2)*-4="; check(val, -36); print ", "; + + testglobal = 7; + yloc = 2; + zloc = -4; + noop(); + val = (testglobal + yloc) * zloc; + print "(7+2)*-4="; check(val, -36); print "^"; + + xloc = $10000; + yloc = $10000; + zloc = 16; + val = (xloc * yloc) / zloc + 1; + print "($10000*$10000)/16+1="; check(val, 1); print ", "; + + xloc = $10000; + yloc = $10000; + zloc = 16; + noop(); + val = (xloc * yloc) / zloc + 1; + print "($10000*$10000)/16+1="; check(val, 1); print "^"; + + xloc = $7FFFFFFF; + yloc = 2; + zloc = 16; + val = (xloc + yloc) / zloc; + print "($7FFFFFFF+2)/16="; check(val, -$7FFFFFF); print ", "; + + xloc = $7FFFFFFF; + yloc = 2; + zloc = 16; + noop(); + val = (xloc + yloc) / zloc; + print "($7FFFFFFF+2)/16="; check(val, -$7FFFFFF); print "^"; + + xloc = -$7FFFFFFF; + yloc = 2; + zloc = 16; + val = (xloc - yloc) / zloc; + print "(-$7FFFFFFF-2)/16="; check(val, $7FFFFFF); print ", "; + + xloc = -$7FFFFFFF; + yloc = 2; + zloc = 16; + noop(); + val = (xloc - yloc) / zloc; + print "(-$7FFFFFFF-2)/16="; check(val, $7FFFFFF); print "^"; + + count_failures(); + ]; + +TestClass BitwiseTest + with name 'bitwise' 'bits' 'bit', + testfunc [ val; + print "Bitwise arithmetic:^^"; + + @bitand 0 0 val; + print "0&0="; check_hex(val, 0); print ", "; + @bitand $FFFFFFFF 0 val; + print "$FFFFFFFF&0="; check_hex(val, 0); print ", "; + @bitand $FFFFFFFF $FFFFFFFF val; + print "$FFFFFFFF&$FFFFFFFF="; check_hex(val, $FFFFFFFF); print ", "; + @bitand $0137FFFF $FFFF7310 val; + print "$0137FFFF&$FFFF7310="; check_hex(val, $01377310); print ", "; + @bitand $35 $56 val; + print "$35&56="; check_hex(val, $14); print "^"; + + @bitor 0 0 val; + print "0|0="; check_hex(val, 0); print ", "; + @bitor $FFFFFFFF 0 val; + print "$FFFFFFFF|0="; check_hex(val, $FFFFFFFF); print ", "; + @bitor $FFFFFFFF $FFFFFFFF val; + print "$FFFFFFFF|$FFFFFFFF="; check_hex(val, $FFFFFFFF); print ", "; + @bitor $01370000 $00007310 val; + print "$01370000|$00007310="; check_hex(val, $01377310); print ", "; + @bitor $35 $56 val; + print "$35|56="; check_hex(val, $77); print "^"; + + @bitxor 0 0 val; + print "0", "@@94", "0="; check_hex(val, 0); print ", "; + @bitxor $FFFFFFFF 0 val; + print "$FFFFFFFF", "@@94", "0="; check_hex(val, $FFFFFFFF); print ", "; + @bitxor $FFFFFFFF $FFFFFFFF val; + print "$FFFFFFFF", "@@94", "$FFFFFFFF="; check_hex(val, 0); print ", "; + @bitxor $0137FFFF $00007310 val; + print "$0137FFFF", "@@94", "$00007310="; check_hex(val, $01378CEF); print ", "; + @bitxor $35 $56 val; + print "$35", "@@94", "56="; check_hex(val, $63); print "^"; + + @bitnot 0 val; + print "!0="; check_hex(val, $FFFFFFFF); print ", "; + @bitnot 1 val; + print "!1="; check_hex(val, $FFFFFFFE); print ", "; + @bitnot $F val; + print "!$F="; check_hex(val, $FFFFFFF0); print ", "; + @bitnot $80000000 val; + print "!$80000000="; check_hex(val, $7FFFFFFF); print "^"; + + count_failures(); + ]; + +TestClass ShiftTest + with name 'shift', + testfunc [ val res ix; + print "Bit shifts:^^"; + + @shiftl $1001 0 val; + print "$1001<<0="; check_hex(val, $1001); print ", "; + @shiftl $1001 1 val; + print "$1001<<1="; check_hex(val, $2002); print ", "; + @shiftl $1001 4 val; + print "$1001<<4="; check_hex(val, $10010); print ", "; + @shiftl $1001 10 val; + print "$1001<<10="; check_hex(val, $400400); print ", "; + @shiftl $1001 16 val; + print "$1001<<16="; check_hex(val, $10010000); print ", "; + @shiftl $1001 24 val; + print "$1001<<24="; check_hex(val, $01000000); print ", "; + @shiftl $1001 31 val; + print "$1001<<31="; check_hex(val, $80000000); print ", "; + @shiftl $1001 32 val; + print "$1001<<32="; check_hex(val, 0); print ", "; + @shiftl $1001 (-1) val; + print "$1001<<-1="; check_hex(val, 0); print "^"; + @shiftl (-2) 0 val; + print "-2<<0="; check(val, -2); print ", "; + @shiftl (-2) 1 val; + print "-2<<1="; check(val, -4); print ", "; + @shiftl (-2) 7 val; + print "-2<<7="; check(val, -256); print ", "; + @shiftl (-2) 31 val; + print "-2<<31="; check(val, 0); print "^"; + + testglobal = 1; + res = 1; + for (ix=0 : ix<32 : ix++) { + @shiftl testglobal ix val; + print "1<<", ix, "="; check_hex(val, res); print ", "; + res = res+res; + } + @shiftl testglobal ix val; + print "1<<", ix, "="; check(val, 0); print ", "; + ix = -1; + @shiftl testglobal ix val; + print "1<<", ix, "="; check(val, 0); print "^"; + + @ushiftr $1001 0 val; + print "$1001u>>0="; check_hex(val, $1001); print ", "; + @ushiftr $1001 1 val; + print "$1001u>>1="; check_hex(val, $800); print ", "; + @ushiftr $1001 2 val; + print "$1001u>>2="; check_hex(val, $400); print ", "; + @ushiftr $1001 6 val; + print "$1001u>>6="; check_hex(val, $40); print ", "; + @ushiftr $1001 12 val; + print "$1001u>>12="; check_hex(val, $1); print ", "; + @ushiftr $1001 13 val; + print "$1001u>>13="; check_hex(val, $0); print ", "; + @ushiftr $1001 31 val; + print "$1001u>>31="; check_hex(val, $0); print ", "; + @ushiftr $1001 32 val; + print "$1001u>>32="; check_hex(val, $0); print "^"; + + @ushiftr $7FFFFFFF 0 val; + print "$7FFFFFFFu>>0="; check_hex(val, $7FFFFFFF); print ", "; + @ushiftr $7FFFFFFF 1 val; + print "$7FFFFFFFu>>1="; check_hex(val, $3FFFFFFF); print ", "; + @ushiftr $7FFFFFFF 2 val; + print "$7FFFFFFFu>>2="; check_hex(val, $1FFFFFFF); print ", "; + @ushiftr $7FFFFFFF 6 val; + print "$7FFFFFFFu>>6="; check_hex(val, $1FFFFFF); print ", "; + @ushiftr $7FFFFFFF 12 val; + print "$7FFFFFFFu>>12="; check_hex(val, $7FFFF); print ", "; + @ushiftr $7FFFFFFF 13 val; + print "$7FFFFFFFu>>13="; check_hex(val, $3FFFF); print ", "; + @ushiftr $7FFFFFFF 30 val; + print "$7FFFFFFFu>>30="; check_hex(val, $1); print ", "; + @ushiftr $7FFFFFFF 31 val; + print "$7FFFFFFFu>>31="; check_hex(val, $0); print ", "; + @ushiftr $7FFFFFFF 32 val; + print "$7FFFFFFFu>>32="; check_hex(val, $0); print "^"; + + @ushiftr (-1) 0 val; + print "-1u>>0="; check_hex(val, -1); print ", "; + @ushiftr (-1) 1 val; + print "-1u>>1="; check_hex(val, $7FFFFFFF); print ", "; + @ushiftr (-1) 2 val; + print "-1u>>2="; check_hex(val, $3FFFFFFF); print ", "; + @ushiftr (-1) 6 val; + print "-1u>>6="; check_hex(val, $3FFFFFF); print ", "; + @ushiftr (-1) 12 val; + print "-1u>>12="; check_hex(val, $FFFFF); print ", "; + @ushiftr (-1) 13 val; + print "-1u>>13="; check_hex(val, $7FFFF); print ", "; + @ushiftr (-1) 30 val; + print "-1u>>30="; check_hex(val, $3); print ", "; + @ushiftr (-1) 31 val; + print "-1u>>31="; check_hex(val, $1); print ", "; + @ushiftr (-1) 32 val; + print "-1u>>32="; check_hex(val, $0); print ", "; + @ushiftr (-1) 33 val; + print "-1u>>33="; check_hex(val, $0); print ", "; + @ushiftr (-1) (-1) val; + print "-1u>>-1="; check_hex(val, $0); print "^"; + + testglobal = -1; + res = $7fffffff; + for (ix=1 : ix<32 : ix++) { + @ushiftr testglobal ix val; + print "-1u>>", ix, "="; check_hex(val, res); print ", "; + res = res / 2; + } + @ushiftr testglobal ix val; + print "-1u>>", ix, "="; check(val, 0); print ", "; + ix = -1; + @ushiftr testglobal ix val; + print "-1u>>", ix, "="; check(val, 0); print "^"; + + @sshiftr $1001 0 val; + print "$1001s>>0="; check_hex(val, $1001); print ", "; + @sshiftr $1001 1 val; + print "$1001s>>1="; check_hex(val, $800); print ", "; + @sshiftr $1001 2 val; + print "$1001s>>2="; check_hex(val, $400); print ", "; + @sshiftr $1001 6 val; + print "$1001s>>6="; check_hex(val, $40); print ", "; + @sshiftr $1001 12 val; + print "$1001s>>12="; check_hex(val, $1); print ", "; + @sshiftr $1001 13 val; + print "$1001s>>13="; check_hex(val, $0); print ", "; + @sshiftr $1001 31 val; + print "$1001s>>31="; check_hex(val, $0); print ", "; + @sshiftr $1001 32 val; + print "$1001s>>32="; check_hex(val, $0); print "^"; + + @sshiftr $7FFFFFFF 0 val; + print "$7FFFFFFFs>>0="; check_hex(val, $7FFFFFFF); print ", "; + @sshiftr $7FFFFFFF 1 val; + print "$7FFFFFFFs>>1="; check_hex(val, $3FFFFFFF); print ", "; + @sshiftr $7FFFFFFF 2 val; + print "$7FFFFFFFs>>2="; check_hex(val, $1FFFFFFF); print ", "; + @sshiftr $7FFFFFFF 6 val; + print "$7FFFFFFFs>>6="; check_hex(val, $1FFFFFF); print ", "; + @sshiftr $7FFFFFFF 12 val; + print "$7FFFFFFFs>>12="; check_hex(val, $7FFFF); print ", "; + @sshiftr $7FFFFFFF 13 val; + print "$7FFFFFFFs>>13="; check_hex(val, $3FFFF); print ", "; + @sshiftr $7FFFFFFF 30 val; + print "$7FFFFFFFs>>30="; check_hex(val, $1); print ", "; + @sshiftr $7FFFFFFF 31 val; + print "$7FFFFFFFs>>31="; check_hex(val, $0); print ", "; + @sshiftr $7FFFFFFF 32 val; + print "$7FFFFFFFs>>32="; check_hex(val, $0); print "^"; + + @sshiftr (-1) 0 val; + print "-1s>>0="; check(val, -1); print ", "; + @sshiftr (-1) 1 val; + print "-1s>>1="; check(val, -1); print ", "; + @sshiftr (-1) 31 val; + print "-1s>>31="; check(val, -1); print ", "; + @sshiftr (-1) 32 val; + print "-1s>>32="; check(val, -1); print ", "; + @sshiftr (-1) 33 val; + print "-1s>>33="; check(val, -1); print ", "; + @sshiftr (-1) (-1) val; + print "-1s>>-1="; check(val, -1); print "^"; + + @sshiftr (-1000) 0 val; + print "-1000s>>0="; check(val, -1000); print ", "; + @sshiftr (-1000) 1 val; + print "-1000s>>1="; check(val, -500); print ", "; + @sshiftr (-1000) 2 val; + print "-1000s>>2="; check(val, -250); print ", "; + @sshiftr (-1000) 4 val; + print "-1000s>>4="; check(val, -63); print ", "; + @sshiftr (-1000) 6 val; + print "-1000s>>6="; check(val, -16); print ", "; + @sshiftr (-1000) 9 val; + print "-1000s>>9="; check(val, -2); print ", "; + @sshiftr (-1000) 31 val; + print "-1000s>>31="; check(val, -1); print ", "; + @sshiftr (-1000) 32 val; + print "-1000s>>32="; check(val, -1); print ", "; + @sshiftr (-1000) 33 val; + print "-1000s>>33="; check(val, -1); print ", "; + @sshiftr (-1000) (-1) val; + print "-1000s>>-1="; check(val, -1); print "^"; + + testglobal = -1; + for (ix=0 : ix<32 : ix++) { + @sshiftr testglobal ix val; + print "-1s>>", ix, "="; check(val, -1); print ", "; + } + @sshiftr testglobal ix val; + print "-1s>>", ix, "="; check(val, -1); print ", "; + ix = -1; + @sshiftr testglobal ix val; + print "-1s>>", ix, "="; check(val, -1); print "^"; + + count_failures(); + ]; + +TestClass TruncCopyTest + with name 'trunc' 'truncating' 'copy', + testfunc [ val; + print "Truncating copies:^^"; + + ! I6 doesn't let us test 2-byte and 1-byte local variables + + testglobal2 = $01020304; + @copys $12345678 testglobal2; + @copy testglobal2 val; + print "$12345678 s:> glob $01020304="; check_hex(val, $56780304); print ", "; + @copys $80818283 sp; + @copy sp val; + print "$80818283 s:> stack="; check_hex(val, $8283); print ", "; + testglobal = $fedcba98; + testglobal2 = $02030405; + @copys testglobal testglobal2; + @copy testglobal2 val; + print "glob $fedcba98 s:> glob $02030405="; check_hex(val, $fedc0405); print ", "; + testglobal = $fedcba98; + @copys testglobal sp; + @copy sp val; + print "glob $fedcba98 s:> stack="; check_hex(val, $fedc); print ", "; + testglobal2 = $03040506; + @copy $7654321f sp; + @copys sp testglobal2; + @copy testglobal2 val; + print "stack $7654321f s:> glob $03040506="; check_hex(val, $321f0506); print ", "; + testglobal2 = $04050607; + testglobal = $654321fe; + @copy testglobal sp; + @copys sp testglobal2; + @copy testglobal2 val; + print "stack $654321fe s:> glob $04050607="; check_hex(val, $21fe0607); print ", "; + @copy $674523f1 sp; + @copys sp sp; + @copy sp val; + print "stack $674523f1 s:> stack="; check_hex(val, $23f1); print ", "; + @copy $67452301 sp; noop(); + @copys sp sp; + @copy sp val; + print "stack $67452301 s:> stack="; check_hex(val, $2301); print "^"; + + testglobal2 = $01020304; + @copyb $12345678 testglobal2; + @copy testglobal2 val; + print "$12345678 b:> glob $01020304="; check_hex(val, $78020304); print ", "; + @copyb $80818283 sp; + @copy sp val; + print "$80818283 b:> stack="; check_hex(val, $83); print ", "; + testglobal = $fedcba98; + testglobal2 = $02030405; + @copyb testglobal testglobal2; + @copy testglobal2 val; + print "glob $fedcba98 b:> glob $02030405="; check_hex(val, $fe030405); print ", "; + testglobal = $fedcba98; + @copyb testglobal sp; + @copy sp val; + print "glob $fedcba98 b:> stack="; check_hex(val, $fe); print ", "; + testglobal2 = $03040506; + @copy $7654321f sp; + @copyb sp testglobal2; + @copy testglobal2 val; + print "stack $7654321f b:> glob $03040506="; check_hex(val, $1f040506); print ", "; + testglobal2 = $04050607; + testglobal = $654321fe; + @copy testglobal sp; + @copyb sp testglobal2; + @copy testglobal2 val; + print "stack $654321fe b:> glob $04050607="; check_hex(val, $fe050607); print ", "; + @copy $674523f1 sp; + @copyb sp sp; + @copy sp val; + print "stack $674523f1 b:> stack="; check_hex(val, $f1); print ", "; + @copy $67452301 sp; noop(); + @copyb sp sp; + @copy sp val; + print "stack $67452301 b:> stack="; check_hex(val, $01); print "^"; + + count_failures(); + ]; + +TestClass ExtendTest + with name 'extend' 'sex', + testfunc [ val; + print "Sign-extend:^^"; + + @sexb $00 val; + print "sexb($00)="; check_hex(val, 0); print ", "; + @sexb $01 val; + print "sexb($01)="; check_hex(val, 1); print ", "; + @sexb $7f val; + print "sexb($7f)="; check_hex(val, $7f); print ", "; + @sexb $80 val; + print "sexb($80)="; check_hex(val, $ffffff80); print ", "; + @sexb $fe val; + print "sexb($fe)="; check_hex(val, -2); print ", "; + @sexb $ff val; + print "sexb($ff)="; check_hex(val, -1); print ", "; + @sexb $100 val; + print "sexb($100)="; check_hex(val, 0); print ", "; + @sexb $ffffff01 val; + print "sexb($ffffff01)="; check_hex(val, 1); print ", "; + @sexb $7f0f0ff0 val; + print "sexb($7f0f0ff0)="; check_hex(val, -16); print "^"; + + testglobal = $02; + @sexb testglobal sp; + @copy sp val; + print "sexb($02)="; check_hex(val, 2); print ", "; + @copy $0f sp; + @sexb sp testglobal; + val = testglobal; + print "sexb($0f)="; check_hex(val, $0f); print ", "; + testglobal = $ff; + @sexb testglobal sp; + @copy sp val; + print "sexb($ff)="; check_hex(val, -1); print ", "; + testglobal = $100; + @sexb testglobal sp; + @copy sp val; + print "sexb($100)="; check_hex(val, 0); print ", "; + @copy $ffffff01 sp; + @sexb sp sp; + @copy sp val; + print "sexb($ffffff01)="; check_hex(val, 1); print ", "; + testglobal = $7f1f1ff1; + @sexb testglobal testglobal2; + print "sexb($7f1f1ff1)="; check_hex(testglobal2, -15); print "^"; + + @sexs $00 val; + print "sexs($00)="; check_hex(val, 0); print ", "; + @sexs $01 val; + print "sexs($01)="; check_hex(val, 1); print ", "; + @sexs $7fff val; + print "sexs($7fff)="; check_hex(val, $7fff); print ", "; + @sexs $8000 val; + print "sexs($8000)="; check_hex(val, $ffff8000); print ", "; + @sexs $fffe val; + print "sexs($fffe)="; check_hex(val, -2); print ", "; + @sexs $ffff val; + print "sexs($ffff)="; check_hex(val, -1); print ", "; + @sexs $10000 val; + print "sexs($10000)="; check_hex(val, 0); print ", "; + @sexs $ffff0001 val; + print "sexs($ffff0001)="; check_hex(val, 1); print ", "; + @sexs $7f0ff00f val; + print "sexs($7f0ff00f)="; check_hex(val, $fffff00f); print "^"; + + testglobal = $102; + @sexs testglobal sp; + @copy sp val; + print "sexs($102)="; check_hex(val, $102); print ", "; + @copy $0fffff sp; + @sexs sp testglobal; + val = testglobal; + print "sexs($0fffff)="; check_hex(val, -1); print ", "; + testglobal = $fffe; + @sexs testglobal sp; + @copy sp val; + print "sexs($fffe)="; check_hex(val, -2); print ", "; + testglobal = $10000; + @sexs testglobal sp; + @copy sp val; + print "sexs($10000)="; check_hex(val, 0); print ", "; + @copy $ffff0001 sp; + @sexs sp sp; + @copy sp val; + print "sexs($ffff0001)="; check_hex(val, 1); print ", "; + testglobal = $7f1ffff1; + @sexs testglobal testglobal2; + print "sexs($7f1ffff1)="; check_hex(testglobal2, -15); print "^"; + + count_failures(); + ]; + +Array testarray -> $01 $02 $03 $04 $ff $fe $fd $fc $0 $0 $0 $f; +Array testarray2 -> $7f $00 $80 $02 $01 $00 $ff $ff; + +TestClass AloadTest + with name 'aload', + testfunc [ val arr; + print "Array loads:^^"; + + print "Array sequence: "; check_hex(testarray2 - testarray, 12); print "^"; + + @aload testarray 0 val; + print "arr-->0="; check_hex(val, $01020304); print ", "; + @aload testarray 1 val; + print "arr-->1="; check_hex(val, $fffefdfc); print ", "; + @aload testarray 2 val; + print "arr-->2="; check_hex(val, $f); print "^"; + arr = testarray+1; + @aload arr 0 val; + print "arr+1-->0="; check_hex(val, $020304ff); print ", "; + @aload arr 1 val; + print "arr+1-->1="; check_hex(val, $fefdfc00); print ", "; + arr = testarray+2; + @aload arr 0 val; + print "arr+2-->0="; check_hex(val, $0304fffe); print ", "; + @aload arr 1 val; + print "arr+2-->1="; check_hex(val, $fdfc0000); print ", "; + arr = testarray+3; + @aload arr 0 val; + print "arr+3-->0="; check_hex(val, $04fffefd); print ", "; + @aload arr 1 val; + print "arr+3-->1="; check_hex(val, $fc000000); print ", "; + arr = testarray+4; + @aload arr (-1) val; + print "arr+4-->-1="; check_hex(val, $01020304); print ", "; + @aload arr 0 val; + print "arr+4-->0="; check_hex(val, $fffefdfc); print ", "; + @aload arr 1 val; + print "arr+4-->1="; check_hex(val, $f); print "^"; + + arr = testarray2; + + @aload testarray2 (-1) val; + print "arr2-->-1="; check_hex(val, $f); print ", "; + val = -1; + @aload testarray2 val val; + print "arr2-->-1="; check_hex(val, $f); print ", "; + @aload arr (-1) val; + print "arr2-->-1="; check_hex(val, $f); print ", "; + val = -1; + @aload arr val val; + print "arr2-->-1="; check_hex(val, $f); print ", "; + ! + @aload testarray2 (-1) sp; + @copy sp val; + print "arr2-->-1="; check_hex(val, $f); print ", "; + val = -1; + @aload testarray2 val sp; + @copy sp val; + print "arr2-->-1="; check_hex(val, $f); print ", "; + @aload arr (-1) sp; + @copy sp val; + print "arr2-->-1="; check_hex(val, $f); print ", "; + val = -1; + @aload arr val sp; + @copy sp val; + print "arr2-->-1="; check_hex(val, $f); print "^"; + + @aload testarray2 0 val; + print "arr2-->0="; check_hex(val, $7f008002); print ", "; + val = 0; + @aload testarray2 val val; + print "arr2-->0="; check_hex(val, $7f008002); print ", "; + @aload arr 0 val; + print "arr2-->0="; check_hex(val, $7f008002); print ", "; + val = 0; + @aload arr val val; + print "arr2-->0="; check_hex(val, $7f008002); print ", "; + ! + @aload testarray2 0 sp; + @copy sp val; + print "arr2-->0="; check_hex(val, $7f008002); print ", "; + val = 0; + @aload testarray2 val sp; + @copy sp val; + print "arr2-->0="; check_hex(val, $7f008002); print ", "; + @aload arr 0 sp; + @copy sp val; + print "arr2-->0="; check_hex(val, $7f008002); print ", "; + val = 0; + @aload arr val sp; + @copy sp val; + print "arr2-->0="; check_hex(val, $7f008002); print "^"; + + @aload testarray2 1 val; + print "arr2-->1="; check_hex(val, $100ffff); print ", "; + val = 1; + @aload testarray2 val val; + print "arr2-->1="; check_hex(val, $100ffff); print ", "; + @aload arr 1 val; + print "arr2-->1="; check_hex(val, $100ffff); print ", "; + val = 1; + @aload arr val val; + print "arr2-->1="; check_hex(val, $100ffff); print ", "; + ! + @aload testarray2 1 sp; + @copy sp val; + print "arr2-->1="; check_hex(val, $100ffff); print ", "; + val = 1; + @aload testarray2 val sp; + @copy sp val; + print "arr2-->1="; check_hex(val, $100ffff); print ", "; + @aload arr 1 sp; + @copy sp val; + print "arr2-->1="; check_hex(val, $100ffff); print ", "; + val = 1; + @aload arr val sp; + @copy sp val; + print "arr2-->1="; check_hex(val, $100ffff); print "^"; + + @aloads testarray 0 val; + print "arr=>0="; check_hex(val, $0102); print ", "; + @aloads testarray 1 val; + print "arr=>1="; check_hex(val, $0304); print ", "; + @aloads testarray 2 val; + print "arr=>2="; check_hex(val, $fffe); print ", "; + @aloads testarray 3 val; + print "arr=>3="; check_hex(val, $fdfc); print ", "; + @aloads testarray 4 val; + print "arr=>4="; check_hex(val, $0); print ", "; + @aloads testarray 5 val; + print "arr=>5="; check_hex(val, $f); print "^"; + arr = testarray+1; + @aloads arr 0 val; + print "arr+1=>0="; check_hex(val, $0203); print ", "; + @aloads arr 1 val; + print "arr+1=>1="; check_hex(val, $04ff); print ", "; + arr = testarray+2; + @aloads arr 0 val; + print "arr+2=>0="; check_hex(val, $0304); print ", "; + @aloads arr 1 val; + print "arr+2=>1="; check_hex(val, $fffe); print ", "; + arr = testarray+3; + @aloads arr 0 val; + print "arr+3=>0="; check_hex(val, $04ff); print ", "; + @aloads arr 1 val; + print "arr+3=>1="; check_hex(val, $fefd); print ", "; + arr = testarray+4; + @aloads arr (-1) val; + print "arr+4=>-1="; check_hex(val, $0304); print ", "; + @aloads arr 0 val; + print "arr+4=>0="; check_hex(val, $fffe); print ", "; + @aloads arr 1 val; + print "arr+4=>1="; check_hex(val, $fdfc); print "^"; + + arr = testarray2; + + @aloads testarray2 (-1) val; + print "arr2=>-1="; check_hex(val, $f); print ", "; + val = -1; + @aloads testarray2 val val; + print "arr2=>-1="; check_hex(val, $f); print ", "; + @aloads arr (-1) val; + print "arr2=>-1="; check_hex(val, $f); print ", "; + val = -1; + @aloads arr val val; + print "arr2=>-1="; check_hex(val, $f); print ", "; + ! + @aloads testarray2 (-1) sp; + @copy sp val; + print "arr2=>-1="; check_hex(val, $f); print ", "; + val = -1; + @aloads testarray2 val sp; + @copy sp val; + print "arr2=>-1="; check_hex(val, $f); print ", "; + @aloads arr (-1) sp; + @copy sp val; + print "arr2=>-1="; check_hex(val, $f); print ", "; + val = -1; + @aloads arr val sp; + @copy sp val; + print "arr2=>-1="; check_hex(val, $f); print "^"; + + @aloads testarray2 0 val; + print "arr2=>0="; check_hex(val, $7f00); print ", "; + val = 0; + @aloads testarray2 val val; + print "arr2=>0="; check_hex(val, $7f00); print ", "; + @aloads arr 0 val; + print "arr2=>0="; check_hex(val, $7f00); print ", "; + val = 0; + @aloads arr val val; + print "arr2=>0="; check_hex(val, $7f00); print ", "; + ! + @aloads testarray2 0 sp; + @copy sp val; + print "arr2=>0="; check_hex(val, $7f00); print ", "; + val = 0; + @aloads testarray2 val sp; + @copy sp val; + print "arr2=>0="; check_hex(val, $7f00); print ", "; + @aloads arr 0 sp; + @copy sp val; + print "arr2=>0="; check_hex(val, $7f00); print ", "; + val = 0; + @aloads arr val sp; + @copy sp val; + print "arr2=>0="; check_hex(val, $7f00); print "^"; + + @aloads testarray2 1 val; + print "arr2=>1="; check_hex(val, $8002); print ", "; + val = 1; + @aloads testarray2 val val; + print "arr2=>1="; check_hex(val, $8002); print ", "; + @aloads arr 1 val; + print "arr2=>1="; check_hex(val, $8002); print ", "; + val = 1; + @aloads arr val val; + print "arr2=>1="; check_hex(val, $8002); print ", "; + ! + @aloads testarray2 1 sp; + @copy sp val; + print "arr2=>1="; check_hex(val, $8002); print ", "; + val = 1; + @aloads testarray2 val sp; + @copy sp val; + print "arr2=>1="; check_hex(val, $8002); print ", "; + @aloads arr 1 sp; + @copy sp val; + print "arr2=>1="; check_hex(val, $8002); print ", "; + val = 1; + @aloads arr val sp; + @copy sp val; + print "arr2=>1="; check_hex(val, $8002); print "^"; + + @aloadb testarray 0 val; + print "arr->0="; check_hex(val, $01); print ", "; + @aloadb testarray 1 val; + print "arr->1="; check_hex(val, $02); print ", "; + @aloadb testarray 4 val; + print "arr->4="; check_hex(val, $ff); print ", "; + @aloadb testarray 5 val; + print "arr->5="; check_hex(val, $fe); print ", "; + @aloadb testarray 11 val; + print "arr->11="; check_hex(val, $f); print "^"; + arr = testarray+1; + @aloadb arr 0 val; + print "arr+1->0="; check_hex(val, $02); print ", "; + @aloadb arr 1 val; + print "arr+1->1="; check_hex(val, $03); print ", "; + arr = testarray+2; + @aloadb arr 0 val; + print "arr+2->0="; check_hex(val, $03); print ", "; + @aloadb arr 1 val; + print "arr+2->1="; check_hex(val, $04); print ", "; + arr = testarray+3; + @aloadb arr 0 val; + print "arr+3->0="; check_hex(val, $04); print ", "; + @aloadb arr 1 val; + print "arr+3->1="; check_hex(val, $ff); print ", "; + arr = testarray+4; + @aloadb arr (-1) val; + print "arr+4->-1="; check_hex(val, $04); print ", "; + @aloadb arr 0 val; + print "arr+4->0="; check_hex(val, $ff); print ", "; + @aloadb arr 1 val; + print "arr+4->1="; check_hex(val, $fe); print "^"; + + arr = testarray2; + + @aloadb testarray2 (-1) val; + print "arr2->-1="; check_hex(val, $f); print ", "; + val = -1; + @aloadb testarray2 val val; + print "arr2->-1="; check_hex(val, $f); print ", "; + @aloadb arr (-1) val; + print "arr2->-1="; check_hex(val, $f); print ", "; + val = -1; + @aloadb arr val val; + print "arr2->-1="; check_hex(val, $f); print ", "; + ! + @aloadb testarray2 (-1) sp; + @copy sp val; + print "arr2->-1="; check_hex(val, $f); print ", "; + val = -1; + @aloadb testarray2 val sp; + @copy sp val; + print "arr2->-1="; check_hex(val, $f); print ", "; + @aloadb arr (-1) sp; + @copy sp val; + print "arr2->-1="; check_hex(val, $f); print ", "; + val = -1; + @aloadb arr val sp; + @copy sp val; + print "arr2->-1="; check_hex(val, $f); print "^"; + + @aloadb testarray2 0 val; + print "arr2->0="; check_hex(val, $7f); print ", "; + val = 0; + @aloadb testarray2 val val; + print "arr2->0="; check_hex(val, $7f); print ", "; + @aloadb arr 0 val; + print "arr2->0="; check_hex(val, $7f); print ", "; + val = 0; + @aloadb arr val val; + print "arr2->0="; check_hex(val, $7f); print ", "; + ! + @aloadb testarray2 0 sp; + @copy sp val; + print "arr2->0="; check_hex(val, $7f); print ", "; + val = 0; + @aloadb testarray2 val sp; + @copy sp val; + print "arr2->0="; check_hex(val, $7f); print ", "; + @aloadb arr 0 sp; + @copy sp val; + print "arr2->0="; check_hex(val, $7f); print ", "; + val = 0; + @aloadb arr val sp; + @copy sp val; + print "arr2->0="; check_hex(val, $7f); print "^"; + + @aloadb testarray2 2 val; + print "arr2->2="; check_hex(val, $80); print ", "; + val = 2; + @aloadb testarray2 val val; + print "arr2->2="; check_hex(val, $80); print ", "; + @aloadb arr 2 val; + print "arr2->2="; check_hex(val, $80); print ", "; + val = 2; + @aloadb arr val val; + print "arr2->2="; check_hex(val, $80); print ", "; + ! + @aloadb testarray2 2 sp; + @copy sp val; + print "arr2->2="; check_hex(val, $80); print ", "; + val = 2; + @aloadb testarray2 val sp; + @copy sp val; + print "arr2->2="; check_hex(val, $80); print ", "; + @aloadb arr 2 sp; + @copy sp val; + print "arr2->2="; check_hex(val, $80); print ", "; + val = 2; + @aloadb arr val sp; + @copy sp val; + print "arr2->2="; check_hex(val, $80); print "^"; + + count_failures(); + ]; + +Array destarray -> 12; +Array destarray2 -> 12; + +TestClass AstoreTest + with name 'astore', + testfunc [ val arr; + print "Array stores:^^"; + + print "Array sequence: "; check_hex(destarray2 - destarray, 12); print "^"; + arr = destarray; + for (val=0 : val<24 : val++) + arr->val = 0; + + @astore destarray 0 $02030405; + @aload destarray 0 val; + print "arr-->0="; check_hex(val, $02030405); print ", "; + @astore destarray 1 $fefdfcdb; + @aload destarray 1 val; + print "arr-->1="; check_hex(val, $fefdfcdb); print ", "; + @astore destarray 2 $e0f; + @aload destarray 2 val; + print "arr-->2="; check_hex(val, $0e0f); print "^"; + arr = destarray+1; + @astore arr 0 $12131415; + @aload arr 0 val; + print "arr+1-->0="; check_hex(val, $12131415); print ", "; + @aload destarray 0 val; check_hex(val, $02121314); print "/"; + @aload destarray 1 val; check_hex(val, $15fdfcdb); print ", "; + @astore arr 1 $e0e1e2e3; + @aload arr 1 val; + print "arr+1-->1="; check_hex(val, $e0e1e2e3); print ", "; + @aload destarray 0 val; check_hex(val, $02121314); print "/"; + @aload destarray 1 val; check_hex(val, $15e0e1e2); print "/"; + @aload destarray 2 val; check_hex(val, $e3000e0f); print ", "; + arr = destarray+2; + @astore arr 0 $12345678; + @aload arr 0 val; + print "arr+2-->0="; check_hex(val, $12345678); print ", "; + @aload destarray 0 val; check_hex(val, $02121234); print "/"; + @aload destarray 1 val; check_hex(val, $5678e1e2); print ", "; + @astore arr 1 $fedcba99; + @aload arr 1 val; + print "arr+2-->1="; check_hex(val, $fedcba99); print ", "; + arr = destarray+3; + @astore arr 0 $44556677; + @aload arr 0 val; + print "arr+3-->0="; check_hex(val, $44556677); print ", "; + @aload destarray 0 val; check_hex(val, $02121244); print "/"; + @aload destarray 1 val; check_hex(val, $556677dc); print ", "; + @astore arr 1 $51413121; + @aload arr 1 val; + print "arr+3-->1="; check_hex(val, $51413121); print ", "; + @aload destarray 0 val; check_hex(val, $02121244); print "/"; + @aload destarray 1 val; check_hex(val, $55667751); print "/"; + @aload destarray 2 val; check_hex(val, $4131210f); print ", "; + arr = destarray+4; + @astore arr (-1) $21436587; + @aload arr (-1) val; + print "arr+4-->-1="; check_hex(val, $21436587); print ", "; + @astore arr 0 $31425364; + @aload arr 0 val; + print "arr+4-->0="; check_hex(val, $31425364); print ", "; + @astore arr 1 $41526374; + @aload arr 1 val; + print "arr+4-->1="; check_hex(val, $41526374); print ", "; + @aload destarray 0 val; check_hex(val, $21436587); print "/"; + @aload destarray 1 val; check_hex(val, $31425364); print "/"; + @aload destarray 2 val; check_hex(val, $41526374); print "^"; + + arr = destarray2; + + testglobal = destarray2-4; + @astore destarray2 (-1) $d0000001; + @aload testglobal 0 val; + print "arr2-->-1="; check_hex(val, $d0000001); print ", "; + val = -1; + @astore destarray2 val $d1000002; + @aload testglobal 0 val; + print "arr2-->-1="; check_hex(val, $d1000002); print ", "; + @astore arr (-1) $d2000003; + @aload testglobal 0 val; + print "arr2-->-1="; check_hex(val, $d2000003); print ", "; + val = -1; + @astore arr val $d3000004; + @aload testglobal 0 val; + print "arr2-->-1="; check_hex(val, $d3000004); print ", "; + ! + @copy $e0000001 sp; + @astore destarray2 (-1) sp; + @aload testglobal 0 val; + print "arr2-->-1="; check_hex(val, $e0000001); print ", "; + val = -1; + @copy $e1000011 sp; + @astore destarray2 val sp; + @aload testglobal 0 val; + print "arr2-->-1="; check_hex(val, $e1000011); print ", "; + @copy $e2000021 sp; + @astore arr (-1) sp; + @aload testglobal 0 val; + print "arr2-->-1="; check_hex(val, $e2000021); print ", "; + val = -1; + @copy $e3000031 sp; + @astore arr val sp; + @aload testglobal 0 val; + print "arr2-->-1="; check_hex(val, $e3000031); print "^"; + + testglobal = destarray2; + @astore destarray2 0 $f1223310; + @aload testglobal 0 val; + print "arr2-->0="; check_hex(val, $f1223310); print ", "; + val = 0; + @astore destarray2 val $f2223311; + @aload testglobal 0 val; + print "arr2-->0="; check_hex(val, $f2223311); print ", "; + @astore arr 0 $f3223312; + @aload testglobal 0 val; + print "arr2-->0="; check_hex(val, $f3223312); print ", "; + val = 0; + @astore arr val $f4223313; + @aload testglobal 0 val; + print "arr2-->0="; check_hex(val, $f4223313); print ", "; + ! + @copy $f5223315 sp; + @astore destarray2 0 sp; + @aload testglobal 0 val; + print "arr2-->0="; check_hex(val, $f5223315); print ", "; + val = 0; + @copy $f6223316 sp; + @astore destarray2 val sp; + @aload testglobal 0 val; + print "arr2-->0="; check_hex(val, $f6223316); print ", "; + @copy $f7223317 sp; + @astore arr 0 sp; + @aload testglobal 0 val; + print "arr2-->0="; check_hex(val, $f7223317); print ", "; + val = 0; + @copy $f8223318 sp; + @astore arr val sp; + @aload testglobal 0 val; + print "arr2-->0="; check_hex(val, $f8223318); print "^"; + + testglobal = destarray2+4; + @astore destarray2 1 $1; + @aload testglobal 0 val; + print "arr2-->1="; check_hex(val, $1); print ", "; + val = 1; + @astore destarray2 val $2; + @aload testglobal 0 val; + print "arr2-->1="; check_hex(val, $2); print ", "; + @astore arr 1 $3; + @aload testglobal 0 val; + print "arr2-->1="; check_hex(val, $3); print ", "; + val = 1; + @astore arr val $4; + @aload testglobal 0 val; + print "arr2-->1="; check_hex(val, $4); print ", "; + ! + @copy $5 sp; + @astore destarray2 1 sp; + @aload testglobal 0 val; + print "arr2-->1="; check_hex(val, $5); print ", "; + val = 1; + @copy $6 sp; + @astore destarray2 val sp; + @aload testglobal 0 val; + print "arr2-->1="; check_hex(val, $6); print ", "; + @copy $7 sp; + @astore arr 1 sp; + @aload testglobal 0 val; + print "arr2-->1="; check_hex(val, $7); print ", "; + val = 1; + @copy $8 sp; + @astore arr val sp; + @aload testglobal 0 val; + print "arr2-->1="; check_hex(val, $8); print "^"; + + arr = destarray; + for (val=0 : val<24 : val++) + arr->val = 0; + + @astores destarray 0 $02030405; + @aload destarray 0 val; + print "arr=>0="; check_hex(val, $04050000); print ", "; + @astores destarray 1 $fefdfcdb; + @aload destarray 0 val; + print "arr=>1="; check_hex(val, $0405fcdb); print ", "; + @astores destarray 2 $e0f; + @aload destarray 1 val; + print "arr=>2="; check_hex(val, $0e0f0000); print "^"; + arr = destarray+1; + @astores arr 0 $12131415; + @aloads arr 0 val; + print "arr+1=>0="; check_hex(val, $1415); print ", "; + @aload destarray 0 val; check_hex(val, $041415db); print "/"; + @aload destarray 1 val; check_hex(val, $0e0f0000); print ", "; + @astores arr 1 $e0e1e2e3; + @aloads arr 1 val; + print "arr+1=>1="; check_hex(val, $e2e3); print ", "; + @aload destarray 0 val; check_hex(val, $041415e2); print "/"; + @aload destarray 1 val; check_hex(val, $e30f0000); print ", "; + arr = destarray+2; + @astores arr 0 $12345678; + @aloads arr 0 val; + print "arr+2=>0="; check_hex(val, $5678); print ", "; + @aload destarray 0 val; check_hex(val, $04145678); print "/"; + @aload destarray 1 val; check_hex(val, $e30f0000); print ", "; + @astores arr 1 $fedcba99; + @aloads arr 1 val; + print "arr+2=>1="; check_hex(val, $ba99); print ", "; + @aload destarray 0 val; check_hex(val, $04145678); print "/"; + @aload destarray 1 val; check_hex(val, $ba990000); print ", "; + arr = destarray+3; + @astores arr 0 $44556677; + @aloads arr 0 val; + print "arr+3=>0="; check_hex(val, $6677); print ", "; + @aload destarray 0 val; check_hex(val, $04145666); print "/"; + @aload destarray 1 val; check_hex(val, $77990000); print ", "; + @astores arr 1 $51413121; + @aloads arr 1 val; + print "arr+3=>1="; check_hex(val, $3121); print ", "; + @aload destarray 0 val; check_hex(val, $04145666); print "/"; + @aload destarray 1 val; check_hex(val, $77312100); print ", "; + arr = destarray+4; + @astores arr (-1) $21436587; + @aloads arr (-1) val; + print "arr+4=>-1="; check_hex(val, $6587); print ", "; + @astores arr 0 $31425364; + @aloads arr 0 val; + print "arr+4=>0="; check_hex(val, $5364); print ", "; + @astores arr 1 $41526374; + @aloads arr 1 val; + print "arr+4=>1="; check_hex(val, $6374); print ", "; + @aload destarray 0 val; check_hex(val, $04146587); print "/"; + @aload destarray 1 val; check_hex(val, $53646374); print "^"; + + arr = destarray2; + + testglobal = destarray2-4; + @astore testglobal 0 $99990000; + @astore testglobal 1 $98979695; + @astores destarray2 (-1) $d00ff001; + @aloads testglobal 1 val; + print "arr2=>-1="; check_hex(val, $f001); print ", "; + val = -1; + @astores destarray2 val $d10ee002; + @aloads testglobal 1 val; + print "arr2=>-1="; check_hex(val, $e002); print ", "; + @astores arr (-1) $d20dd003; + @aloads testglobal 1 val; + print "arr2=>-1="; check_hex(val, $d003); print ", "; + val = -1; + @astores arr val $d30cc004; + @aloads testglobal 1 val; + print "arr2=>-1="; check_hex(val, $c004); print ", "; + ! + @copy $e00ff001 sp; + @astores destarray2 (-1) sp; + @aloads testglobal 1 val; + print "arr2=>-1="; check_hex(val, $f001); print ", "; + val = -1; + @copy $e10ee011 sp; + @astores destarray2 val sp; + @aloads testglobal 1 val; + print "arr2=>-1="; check_hex(val, $e011); print ", "; + @copy $e20dd021 sp; + @astores arr (-1) sp; + @aloads testglobal 1 val; + print "arr2=>-1="; check_hex(val, $d021); print ", "; + val = -1; + @copy $e30cc031 sp; + @astores arr val sp; + @aloads testglobal 1 val; + print "arr2=>-1="; check_hex(val, $c031); print "^"; + @aload testglobal 0 val; + print "pre-guard="; check_hex(val, $9999c031); print ", "; + @aload testglobal 1 val; + print "post-guard="; check_hex(val, $98979695); print "^"; + + testglobal = destarray2; + @astore testglobal 0 $98979695; + @astores destarray2 0 $f1223310; + @aloads testglobal 0 val; + print "arr2=>0="; check_hex(val, $3310); print ", "; + val = 0; + @astores destarray2 val $f2223311; + @aloads testglobal 0 val; + print "arr2=>0="; check_hex(val, $3311); print ", "; + @astores arr 0 $f3223312; + @aloads testglobal 0 val; + print "arr2=>0="; check_hex(val, $3312); print ", "; + val = 0; + @astores arr val $f4223313; + @aloads testglobal 0 val; + print "arr2=>0="; check_hex(val, $3313); print ", "; + ! + @copy $f5223315 sp; + @astores destarray2 0 sp; + @aloads testglobal 0 val; + print "arr2=>0="; check_hex(val, $3315); print ", "; + val = 0; + @copy $f6223316 sp; + @astores destarray2 val sp; + @aloads testglobal 0 val; + print "arr2=>0="; check_hex(val, $3316); print ", "; + @copy $f7223317 sp; + @astores arr 0 sp; + @aloads testglobal 0 val; + print "arr2=>0="; check_hex(val, $3317); print ", "; + val = 0; + @copy $f8223318 sp; + @astores arr val sp; + @aloads testglobal 0 val; + print "arr2=>0="; check_hex(val, $3318); print "^"; + @aload testglobal 0 val; + print "post-guard="; check_hex(val, $33189695); print "^"; + + testglobal = destarray2+4; + @astore testglobal 0 $98979695; + @astores destarray2 2 $1; + @aloads testglobal 0 val; + print "arr2=>2="; check_hex(val, $1); print ", "; + val = 2; + @astores destarray2 val $2; + @aloads testglobal 0 val; + print "arr2=>2="; check_hex(val, $2); print ", "; + @astores arr 2 $3; + @aloads testglobal 0 val; + print "arr2=>2="; check_hex(val, $3); print ", "; + val = 2; + @astores arr val $4; + @aloads testglobal 0 val; + print "arr2=>2="; check_hex(val, $4); print ", "; + ! + @copy $5 sp; + @astores destarray2 2 sp; + @aloads testglobal 0 val; + print "arr2=>2="; check_hex(val, $5); print ", "; + val = 2; + @copy $6 sp; + @astores destarray2 val sp; + @aloads testglobal 0 val; + print "arr2=>2="; check_hex(val, $6); print ", "; + @copy $7 sp; + @astores arr 2 sp; + @aloads testglobal 0 val; + print "arr2=>2="; check_hex(val, $7); print ", "; + val = 2; + @copy $8 sp; + @astores arr val sp; + @aloads testglobal 0 val; + print "arr2=>2="; check_hex(val, $8); print "^"; + @aload testglobal 0 val; + print "post-guard="; check_hex(val, $00089695); print "^"; + + arr = destarray; + for (val=0 : val<24 : val++) + arr->val = 0; + + @astoreb destarray 0 $02030405; + @aload destarray 0 val; + print "arr=>0="; check_hex(val, $05000000); print ", "; + @astoreb destarray 1 $fefdfcdb; + @aload destarray 0 val; + print "arr=>1="; check_hex(val, $05db0000); print ", "; + @astoreb destarray 2 $e0f; + @aload destarray 0 val; + print "arr=>2="; check_hex(val, $05db0f00); print ", "; + @astoreb destarray 3 $5263; + @aload destarray 0 val; + print "arr=>3="; check_hex(val, $05db0f63); print "^"; + arr = destarray+1; + @astoreb arr 0 $12131415; + @aloadb arr 0 val; + print "arr+1=>0="; check_hex(val, $15); print ", "; + @aload destarray 0 val; check_hex(val, $05150f63); print "/"; + @aload destarray 1 val; check_hex(val, $00000000); print ", "; + @astoreb arr 1 $e0e1e2e3; + @aloadb arr 1 val; + print "arr+1=>1="; check_hex(val, $e3); print ", "; + @aload destarray 0 val; check_hex(val, $0515e363); print "/"; + @aload destarray 1 val; check_hex(val, $00000000); print ", "; + arr = destarray+2; + @astoreb arr 0 $12345678; + @aloadb arr 0 val; + print "arr+2=>0="; check_hex(val, $78); print ", "; + @aload destarray 0 val; check_hex(val, $05157863); print "/"; + @aload destarray 1 val; check_hex(val, $00000000); print ", "; + @astoreb arr 1 $fedcba99; + @aloadb arr 1 val; + print "arr+2=>1="; check_hex(val, $99); print ", "; + @aload destarray 0 val; check_hex(val, $05157899); print "/"; + @aload destarray 1 val; check_hex(val, $00000000); print ", "; + arr = destarray+3; + @astoreb arr 0 $44556677; + @aloadb arr 0 val; + print "arr+3=>0="; check_hex(val, $77); print ", "; + @aload destarray 0 val; check_hex(val, $05157877); print "/"; + @aload destarray 1 val; check_hex(val, $00000000); print ", "; + @astoreb arr 1 $51413121; + @aloadb arr 1 val; + print "arr+3=>1="; check_hex(val, $21); print ", "; + @aload destarray 0 val; check_hex(val, $05157877); print "/"; + @aload destarray 1 val; check_hex(val, $21000000); print ", "; + arr = destarray+4; + @astoreb arr (-1) $21436587; + @aloadb arr (-1) val; + print "arr+4=>-1="; check_hex(val, $87); print ", "; + @astoreb arr 0 $31425364; + @aloadb arr 0 val; + print "arr+4=>0="; check_hex(val, $64); print ", "; + @astoreb arr 1 $41526374; + @aloadb arr 1 val; + print "arr+4=>1="; check_hex(val, $74); print ", "; + @aload destarray 0 val; check_hex(val, $05157887); print "/"; + @aload destarray 1 val; check_hex(val, $64740000); print "^"; + + arr = destarray2; + + testglobal = destarray2-4; + @astore testglobal 0 $99999900; + @astore testglobal 1 $98979695; + @astoreb destarray2 (-1) $d00ff001; + @aloadb testglobal 3 val; + print "arr2=>-1="; check_hex(val, $01); print ", "; + val = -1; + @astoreb destarray2 val $d10ee002; + @aloadb testglobal 3 val; + print "arr2=>-1="; check_hex(val, $02); print ", "; + @astoreb arr (-1) $d20dd003; + @aloadb testglobal 3 val; + print "arr2=>-1="; check_hex(val, $03); print ", "; + val = -1; + @astoreb arr val $d30cc004; + @aloadb testglobal 3 val; + print "arr2=>-1="; check_hex(val, $04); print ", "; + ! + @copy $e00ff001 sp; + @astoreb destarray2 (-1) sp; + @aloadb testglobal 3 val; + print "arr2=>-1="; check_hex(val, $01); print ", "; + val = -1; + @copy $e10ee011 sp; + @astoreb destarray2 val sp; + @aloadb testglobal 3 val; + print "arr2=>-1="; check_hex(val, $11); print ", "; + @copy $e20dd021 sp; + @astoreb arr (-1) sp; + @aloadb testglobal 3 val; + print "arr2=>-1="; check_hex(val, $21); print ", "; + val = -1; + @copy $e30cc031 sp; + @astoreb arr val sp; + @aloadb testglobal 3 val; + print "arr2=>-1="; check_hex(val, $31); print "^"; + @aload testglobal 0 val; + print "pre-guard="; check_hex(val, $99999931); print ", "; + @aload testglobal 1 val; + print "post-guard="; check_hex(val, $98979695); print "^"; + + testglobal = destarray2; + @astore testglobal 0 $98979695; + @astoreb destarray2 0 $f1223310; + @aloadb testglobal 0 val; + print "arr2=>0="; check_hex(val, $10); print ", "; + val = 0; + @astoreb destarray2 val $f2223311; + @aloadb testglobal 0 val; + print "arr2=>0="; check_hex(val, $11); print ", "; + @astoreb arr 0 $f3223312; + @aloadb testglobal 0 val; + print "arr2=>0="; check_hex(val, $12); print ", "; + val = 0; + @astoreb arr val $f4223313; + @aloadb testglobal 0 val; + print "arr2=>0="; check_hex(val, $13); print ", "; + ! + @copy $f5223315 sp; + @astoreb destarray2 0 sp; + @aloadb testglobal 0 val; + print "arr2=>0="; check_hex(val, $15); print ", "; + val = 0; + @copy $f6223316 sp; + @astoreb destarray2 val sp; + @aloadb testglobal 0 val; + print "arr2=>0="; check_hex(val, $16); print ", "; + @copy $f7223317 sp; + @astoreb arr 0 sp; + @aloadb testglobal 0 val; + print "arr2=>0="; check_hex(val, $17); print ", "; + val = 0; + @copy $f8223318 sp; + @astoreb arr val sp; + @aloadb testglobal 0 val; + print "arr2=>0="; check_hex(val, $18); print "^"; + @aload testglobal 0 val; + print "post-guard="; check_hex(val, $18979695); print "^"; + + testglobal = destarray2+2; + @astore testglobal 0 $98979695; + @astoreb destarray2 2 $1; + @aloadb testglobal 0 val; + print "arr2=>2="; check_hex(val, $1); print ", "; + val = 2; + @astoreb destarray2 val $2; + @aloadb testglobal 0 val; + print "arr2=>2="; check_hex(val, $2); print ", "; + @astoreb arr 2 $3; + @aloadb testglobal 0 val; + print "arr2=>2="; check_hex(val, $3); print ", "; + val = 2; + @astoreb arr val $4; + @aloadb testglobal 0 val; + print "arr2=>2="; check_hex(val, $4); print ", "; + ! + @copy $5 sp; + @astoreb destarray2 2 sp; + @aloadb testglobal 0 val; + print "arr2=>2="; check_hex(val, $5); print ", "; + val = 2; + @copy $6 sp; + @astoreb destarray2 val sp; + @aloadb testglobal 0 val; + print "arr2=>2="; check_hex(val, $6); print ", "; + @copy $7 sp; + @astoreb arr 2 sp; + @aloadb testglobal 0 val; + print "arr2=>2="; check_hex(val, $7); print ", "; + val = 2; + @copy $8 sp; + @astoreb arr val sp; + @aloadb testglobal 0 val; + print "arr2=>2="; check_hex(val, $8); print "^"; + @aload testglobal 0 val; + print "post-guard="; check_hex(val, $08979695); print "^"; + + count_failures(); + ]; + +TestClass ArrayBitTest + with name 'arraybit' 'aloadbit' 'astorebit' 'abit' 'abits', + testfunc [ val ix res arr; + print "Aloadbit and astorebit:^^"; + + for (ix=0 : ix<16 : ix++) { + res = 0; + if (ix == 0 or 9) + res = 1; + @aloadbit testarray ix val; + print "bit ", ix, "="; check(val, res); print ", "; + } + print "^"; + for (ix=-8 : ix<16 : ix++) { + res = 0; + @copy ix sp; + @copy testarray2 sp; + if (ix < -4 || (ix >= 0 && ix < 7)) + res = 1; + @aloadbit sp sp val; + print "bit ", ix, "="; check(val, res); print ", "; + } + print "^"; + for (ix=-8 : ix<16 : ix++) { + res = 0; + if (ix < -4 || (ix >= 0 && ix < 7)) + res = 1; + @aloadbit testarray2 ix val; + print "bit ", ix, "="; check(val, res); print ", "; + } + print "^"; + + @aloadbit testarray2 22 val; + print "bit 22="; check(val, 0); print ", "; + @aloadbit testarray2 23 val; + print "bit 23="; check(val, 1); print ", "; + @aloadbit testarray2 24 val; + print "bit 24="; check(val, 0); print ", "; + @aloadbit testarray2 25 val; + print "bit 25="; check(val, 1); print "^"; + @aloadbit testarray2 (-31) val; + print "bit -31="; check(val, 0); print ", "; + @aloadbit testarray2 (-32) val; + print "bit -32="; check(val, 0); print ", "; + @aloadbit testarray2 (-33) val; + print "bit -33="; check(val, 1); print ", "; + @aloadbit testarray2 (-34) val; + print "bit -34="; check(val, 1); print "^"; + + arr = testarray2+1; + @aloadbit arr 14 val; + print "bit 22="; check(val, 0); print ", "; + @aloadbit arr 15 val; + print "bit 23="; check(val, 1); print ", "; + @aloadbit arr 16 val; + print "bit 24="; check(val, 0); print ", "; + @aloadbit arr 17 val; + print "bit 25="; check(val, 1); print "^"; + @aloadbit arr (-39) val; + print "bit -31="; check(val, 0); print ", "; + @aloadbit arr (-40) val; + print "bit -32="; check(val, 0); print ", "; + @aloadbit arr (-41) val; + print "bit -33="; check(val, 1); print ", "; + @aloadbit arr (-42) val; + print "bit -34="; check(val, 1); print "^"; + + arr = destarray; + for (val=0 : val<24 : val++) + arr->val = 0; + @astoreb destarray 1 $ff; + + @astorebit destarray 1 1; + @aloadb destarray 0 val; + print "bit 1 on="; check_hex(val, $2); print ", "; + @astorebit destarray 6 $ff; + @aloadb destarray 0 val; + print "bit 6 on="; check_hex(val, $42); print ", "; + @astorebit destarray 3 $80000000; + @aloadb destarray 0 val; + print "bit 3 on="; check_hex(val, $4a); print ", "; + @astorebit destarray 0 0; + @aloadb destarray 0 val; + print "bit 0 off="; check_hex(val, $4a); print ", "; + @astorebit destarray 6 0; + @aloadb destarray 0 val; + print "bit 6 off="; check_hex(val, $0a); print "^"; + @astorebit destarray 15 0; + @aloadb destarray 1 val; + print "bit 15 off="; check_hex(val, $7f); print ", "; + @astorebit destarray 12 2; + @aloadb destarray 1 val; + print "bit 12 on="; check_hex(val, $7f); print ", "; + @astorebit destarray 8 0; + @aloadb destarray 1 val; + print "bit 8 off="; check_hex(val, $7e); print "^"; + @astorebit destarray2 (-1) 1; + @aloadb destarray2 (-1) val; + print "bit -1 on="; check_hex(val, $80); print ", "; + @astorebit destarray2 (-8) 1; + @aloadb destarray2 (-1) val; + print "bit -8 on="; check_hex(val, $81); print "^"; + + @astore destarray 0 0; + res = 0; + for (ix=0 : ix < 32 : ix++) { + arr = (8*(3-(ix/8)) + (ix&7)); + @shiftl 1 arr arr; + res = res | arr; + @astorebit destarray ix 1; + @aload destarray 0 val; + check_hex(val, res); print ", "; + } + print "^"; + res = -1; + for (ix=0 : ix < 32 : ix++) { + arr = (8*(3-(ix/8)) + (ix&7)); + @shiftl 1 arr arr; + res = res & (~arr); + @copy ix sp; + @copy destarray sp; + if (testglobal) testglobal++; + @astorebit sp sp 0; + @aload destarray 0 val; + check_hex(val, res); print ", "; + } + print "^"; + + count_failures(); + ]; + +TestClass CallTest + with name 'call', + testfunc [ val; + print "Call and tailcall:^^"; + + val = arg2adder(); + print "arg2adder()="; check(val, 0); print ", "; + val = arg2adder(4); + print "arg2adder(4)="; check(val, 4); print ", "; + val = arg2adder(4, 6); + print "arg2adder(4,6)="; check(val, 10); print ", "; + val = arg2adder(4, 6, 1); + print "arg2adder(4,6,1)="; check(val, 10); print "^"; + + val = arghasher(4, 6, 1); + print "hash(4,6,1)="; check(val, 19); print "^"; + + testglobal = 0; + val = tailcalltest(2, 3, 4); + print "tailcalltest(2,3,4)="; check(val, 18); print ", "; + print "testglobal="; check(testglobal, 2); print "^"; + + count_failures(); + ]; + +[ tailcalltest ix jx kx; + testglobal++; + ix = ix+jx+kx; + @copy ix sp; + if (1) @tailcall tailcall2test 1; + testglobal = 99; + return 99; +]; + +[ tailcall2test val; + testglobal++; + return val*2; +]; + +TestClass CallStackTest + with name 'callstack', + testfunc [ val; + print "Call with various stack arrangements:^^"; + + val = arghasher(6, 3, 5, 4, 2); + print "hash(6,3,5,4,2)="; check(val, 53); print "^"; + + @copy 99 sp; + @copy 1 sp; @copy 3 sp; @copy 2 sp; @copy 5 sp; @copy 4 sp; + @copy arghasher sp; + @call sp 5 sp; + @copy sp val; + print "hash(4,5,2,3,1)="; check(val, 37); print ", "; + @copy sp val; + print "guard value="; check(val, 99); print "^"; + + @copy 98 sp; + @copy 2 sp; @copy 4 sp; @copy 5 sp; @copy 3 sp; @copy 6 sp; + @copy 5 sp; + @copy arghasher sp; + @call sp sp val; + print "hash(6,3,5,4,2)="; check(val, 53); print ", "; + @copy sp val; + print "guard value="; check(val, 98); print "^"; + + @copy 1 sp; @copy 3 sp; @copy 2 sp; + noop(); + @copy 5 sp; @copy 4 sp; + @call arghasher 5 val; + print "hash(4,5,2,3,1)="; check(val, 37); print "^"; + + @copy 2 sp; @copy 4 sp; @copy 5 sp; + noop(); + @copy 3 sp; @copy 6 sp; + @copy 5 sp; + @call arghasher sp val; + print "hash(6,3,5,4,2)="; check(val, 53); print "^"; + + @callf arghasher val; + print "hash()="; check(val, 0); print "^"; + + @callfi arghasher 7 val; + print "hash(7)="; check(val, 7); print ", "; + @copy 8 sp; + @callfi arghasher sp val; + print "hash(8)="; check(val, 8); print "^"; + @copy 99 sp; + @copy 9 sp; + @copy arghasher sp; + @callfi sp sp sp; + @copy sp val; + print "hash(9)="; check(val, 9); print ", "; + @copy sp val; + print "guard value="; check(val, 99); print "^"; + + @copy 98 sp; + @copy 8 sp; @copy 7 sp; + @call arghasher 2 0; + @copy sp val; + print "guard value="; check(val, 98); print "^"; + + @callfii arghasher 6 7 val; + print "hash(6,7)="; check(val, 20); print ", "; + @callfiii arghasher 5 7 2 val; + print "hash(5,7,2)="; check(val, 25); print "^"; + + testglobal = 0; + + @copy 99 sp; + @copy 1 sp; @copy 3 sp; @copy 2 sp; @copy 5 sp; @copy 4 sp; + @copy arghasher sp; + if (testglobal) testglobal++; + @call sp 5 sp; + @copy sp val; + print "hash(4,5,2,3,1)="; check(val, 37); print ", "; + @copy sp val; + print "guard value="; check(val, 99); print "^"; + + @copy 98 sp; + @copy 2 sp; @copy 4 sp; @copy 5 sp; @copy 3 sp; @copy 6 sp; + @copy 5 sp; + @copy arghasher sp; + if (testglobal) testglobal++; + @call sp sp val; + print "hash(6,3,5,4,2)="; check(val, 53); print ", "; + @copy sp val; + print "guard value="; check(val, 98); print "^"; + + @copy 1 sp; @copy 3 sp; @copy 2 sp; + noop(); + @copy 5 sp; @copy 4 sp; + if (testglobal) testglobal++; + @call arghasher 5 val; + print "hash(4,5,2,3,1)="; check(val, 37); print "^"; + + @copy 2 sp; @copy 4 sp; @copy 5 sp; + noop(); + @copy 3 sp; @copy 6 sp; + @copy 5 sp; + if (testglobal) testglobal++; + @call arghasher sp val; + print "hash(6,3,5,4,2)="; check(val, 53); print "^"; + + @callf arghasher val; + print "hash()="; check(val, 0); print "^"; + + @callfi arghasher 7 val; + print "hash(7)="; check(val, 7); print ", "; + @copy 8 sp; + if (testglobal) testglobal++; + @callfi arghasher sp val; + print "hash(8)="; check(val, 8); print "^"; + @copy 99 sp; + @copy 9 sp; + @copy arghasher sp; + if (testglobal) testglobal++; + @callfi sp sp sp; + @copy sp val; + print "hash(9)="; check(val, 9); print ", "; + @copy sp val; + print "guard value="; check(val, 99); print "^"; + + @copy 98 sp; + @copy 8 sp; @copy 7 sp; + if (testglobal) testglobal++; + @call arghasher 2 0; + @copy sp val; + print "guard value="; check(val, 98); print "^"; + + count_failures(); + ]; + +[ arg2adder ix jx; + return ix+jx; +]; + +[ arghasher _vararg_count res ix val; + res = 0; + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val; + res = res + (ix+1) * val; + } + return res; +]; + +[ noop; +]; + +TestClass JumpTest + with name 'jump' 'branch', + testfunc [ val; + print "Jumps and branches:^^"; + + val = 0; + .P0; + val++; + if (val < 5) { + @jump ?P0; + } + print "Jump loop 5="; check(val, 5); print "^"; + + val = 0; + @jz val ?P1jz_t; + val = false; @jump ?P1jz_f; + .P1jz_t; + val = true; + .P1jz_f; + print "jz 0="; check(val, 1); print ", "; + + val = 1; + @jz val ?P2jz_t; + val = false; @jump ?P2jz_f; + .P2jz_t; + val = true; + .P2jz_f; + print "jz 1="; check(val, 0); print ", "; + + val = -1; + @jz val ?P3jz_t; + val = false; @jump ?P3jz_f; + .P3jz_t; + val = true; + .P3jz_f; + print "jz -1="; check(val, 0); print "^"; + + val = 0; + @jnz val ?P1jnz_t; + val = false; @jump ?P1jnz_f; + .P1jnz_t; + val = true; + .P1jnz_f; + print "jnz 0="; check(val, 0); print ", "; + + val = $1000000; + @jnz val ?P4jnz_t; + val = false; @jump ?P4jnz_f; + .P4jnz_t; + val = true; + .P4jnz_f; + print "jnz $1000000="; check(val, 1); print ", "; + + val = 1; + @jnz val ?P2jnz_t; + val = false; @jump ?P2jnz_f; + .P2jnz_t; + val = true; + .P2jnz_f; + print "jnz 1="; check(val, 1); print ", "; + + val = -1; + @jnz val ?P3jnz_t; + val = false; @jump ?P3jnz_f; + .P3jnz_t; + val = true; + .P3jnz_f; + print "jnz -1="; check(val, 1); print "^"; + + testglobal = 0; + val = test_jumpabs(); + print "jumpabs test="; check(val, 33); print ", "; + check(testglobal, 44); print "^"; + + count_failures(); + ]; + +[ test_jumpabs pos loc; + pos = test_jumpabs_2+5; + loc = 22; + @jumpabs pos; +]; + +[ test_jumpabs_2 pos loc; + pos = 0; + loc = loc+11; + testglobal = 44; + return loc; +]; + +TestClass JumpFormTest + with name 'jumpform', + testfunc [ val; + print "Jump with various operand forms:^^"; + + val = 1; + @"B1:32" ?P1; + return; + .P1; + val = 2; + @"B1:32" ?P2; + val = 3; + .P2; + print "Test A0="; check(val, 2); print "^"; + + @copy 91 sp; + val = 4; + @"B1:32" ?P3; + return; + .P3; + val = 5; + @"B1:32" ?P4; + val = 6; + .P4; + print "Test A1="; check(val, 5); print ", "; + @copy sp val; + print "guard val="; check(val, 91); print "^"; + + val = test_jump0(); + print "Test B0="; check(val, 0); print ", "; + val = test_jump1(); + print "B1="; check(val, 1); print "^"; + + val = test_var_jump0(); + print "Test C0="; check(val, 0); print ", "; + val = test_var_jump1(); + print "C1="; check(val, 1); print "^"; + + val = test_var_jump(0); + print "Test D0="; check(val, 0); print ", "; + val = test_var_jump(1); + print "D1="; check(val, 1); print "^"; + + val = test_computed_jump(2); + print "Test E0="; check(val, 2); print ", "; + val = test_computed_jump(5); + print "E1="; check(val, 3); print ", "; + val = test_computed_jump(8); + print "E2="; check(val, 4); print ", "; + val = test_computed_jump(11); + print "E3="; check(val, 5); print ", "; + val = test_computed_jump(14); + print "E4="; check(val, 6); print "^"; + + val = test_push_computed_jump(2); + print "Test F0="; check(val, 2); print ", "; + val = test_push_computed_jump(5); + print "F1="; check(val, 3); print ", "; + val = test_push_computed_jump(8); + print "F2="; check(val, 9); print "^"; + + print "^Jump-if-zero with various operand forms:^^"; + + val = test_jz0(0); + print "Test B0="; check(val, 0); print ", "; + val = test_jz1(0); + print "B1="; check(val, 1); print ", "; + val = test_jz1(1); + print "B2="; check(val, 99); print ", "; + val = test_jz1(-1); + print "B3="; check(val, 99); print "^"; + + val = test_push_computed_jz(0, 2); + print "Test F0="; check(val, 2); print ", "; + val = test_push_computed_jz(0, 5); + print "F1="; check(val, 3); print ", "; + val = test_push_computed_jz(0, 8); + print "F2="; check(val, 9); print ", "; + val = test_push_computed_jz(0, 10); + print "F3="; check(val, 5); print ", "; + val = test_push_computed_jz(123, 10); + print "F4="; check(val, 2); print ", "; + val = test_push_computed_jz(0, 0); + print "F5="; check(val, 0); print ", "; + val = test_push_computed_jz(0, 1); + print "F6="; check(val, 1); print "^"; + + print "^Jump-if-equal with various operand forms:^^"; + + val = test_jeq0(4, 4); + print "Test B0="; check(val, 0); print ", "; + val = test_jeq1(5, 5); + print "B1="; check(val, 1); print ", "; + val = test_jeq1(5, 0); + print "B2="; check(val, 99); print "^"; + + val = test_push_computed_jeq(7, 7, 2); + print "Test F0="; check(val, 2); print ", "; + val = test_push_computed_jeq(7, 7, 5); + print "F1="; check(val, 3); print ", "; + val = test_push_computed_jeq(7, 7, 8); + print "F2="; check(val, 9); print ", "; + val = test_push_computed_jeq(7, 7, 10); + print "F3="; check(val, 5); print ", "; + val = test_push_computed_jeq(7, 6, 10); + print "F4="; check(val, 2); print ", "; + val = test_push_computed_jeq(-1, -1, 1); + print "F5="; check(val, 1); print ", "; + val = test_push_computed_jeq(0, 0, 0); + print "F6="; check(val, 0); print "^"; + + count_failures(); + ]; + +[ test_jump0; + @"1:32" 0; + return 99; +]; + +[ test_jump1; + @"1:32" 1; + return 99; +]; + +[ test_var_jump loc; + @"1:32" loc; + return 99; +]; + +[ test_var_jump0 loc; + loc = 0; + @"1:32" loc; + return 99; +]; + +[ test_var_jump1 loc; + loc = 1; + @"1:32" loc; + return 99; +]; + +[ test_computed_jump loc; + @"1:32" loc; + @"1:49" 2; + @"1:49" 3; + @"1:49" 4; + @"1:49" 5; + @"1:49" 6; +]; + +[ test_push_computed_jump loc; + @copy 9 sp; + @"1:32" loc; + @"1:49" 2; + @"1:49" 3; + @"1:49" sp; + @"1:49" 5; + @"1:49" 6; +]; + +[ test_jz0 val; + @"2:34" val 0; + return 99; +]; + +[ test_jz1 val; + @"2:34" val 1; + return 99; +]; + +[ test_push_computed_jz val loc; + @copy 9 sp; + @"2:34" val loc; + @"1:49" 2; + @"1:49" 3; + @"1:49" sp; + @"1:49" 5; + @"1:49" 6; +]; + +[ test_jeq0 val1 val2; + @"3:36" val1 val2 0; + return 99; +]; + +[ test_jeq1 val1 val2; + @"3:36" val1 val2 1; + return 99; +]; + +[ test_push_computed_jeq val1 val2 loc; + @copy 9 sp; + @"3:36" val1 val2 loc; + @"1:49" 2; + @"1:49" 3; + @"1:49" sp; + @"1:49" 5; + @"1:49" 6; +]; + +Array branch_results --> 10; + +TestClass CompareTest + with name 'compare', + testfunc [; + print "Compare branches:^^"; + + test_branch_jgt(2, -1, 0, 1, 2, 3, $7fffffff, $80000000); + print "jgt 2: "; check_list(branch_results, 1, 1, 1, 0, 0, 0, 1); print "^"; + test_branch_jgt(-2, -3, -2, -1, 0, 1, 3, $7fffffff, $80000000); + print "jgt -2: "; check_list(branch_results, 1, 0, 0, 0, 0, 0, 0, 1); print "^"; + test_branch_jge(2, -1, 0, 1, 2, 3, $7fffffff, $80000000); + print "jge 2: "; check_list(branch_results, 1, 1, 1, 1, 0, 0, 1); print "^"; + test_branch_jge(-2, -3, -2, -1, 0, 1, 3, $7fffffff, $80000000); + print "jge -2: "; check_list(branch_results, 1, 1, 0, 0, 0, 0, 0, 1); print "^"; + + test_branch_jlt(2, -1, 0, 1, 2, 3, $7fffffff, $80000000); + print "jlt 2: "; check_list(branch_results, 0, 0, 0, 0, 1, 1, 0); print "^"; + test_branch_jlt(-2, -3, -2, -1, 0, 1, 3, $7fffffff, $80000000); + print "jlt -2: "; check_list(branch_results, 0, 0, 1, 1, 1, 1, 1, 0); print "^"; + test_branch_jle(2, -1, 0, 1, 2, 3, $7fffffff, $80000000); + print "jle 2: "; check_list(branch_results, 0, 0, 0, 1, 1, 1, 0); print "^"; + test_branch_jle(-2, -3, -2, -1, 0, 1, 3, $7fffffff, $80000000); + print "jle -2: "; check_list(branch_results, 0, 1, 1, 1, 1, 1, 1, 0); print "^"; + + test_branch_jgtu(2, -1, 0, 1, 2, 3, $7fffffff, $80000000); + print "jgtu 2: "; check_list(branch_results, 0, 1, 1, 0, 0, 0, 0); print "^"; + test_branch_jgtu(-2, -3, -2, -1, 0, 1, 3, $7fffffff, $80000000); + print "jgtu -2: "; check_list(branch_results, 1, 0, 0, 1, 1, 1, 1, 1); print "^"; + test_branch_jgeu(2, -1, 0, 1, 2, 3, $7fffffff, $80000000); + print "jgeu 2: "; check_list(branch_results, 0, 1, 1, 1, 0, 0, 0); print "^"; + test_branch_jgeu(-2, -3, -2, -1, 0, 1, 3, $7fffffff, $80000000); + print "jgeu -2: "; check_list(branch_results, 1, 1, 0, 1, 1, 1, 1, 1); print "^"; + + test_branch_jltu(2, -1, 0, 1, 2, 3, $7fffffff, $80000000); + print "jltu 2: "; check_list(branch_results, 1, 0, 0, 0, 1, 1, 1); print "^"; + test_branch_jltu(-2, -3, -2, -1, 0, 1, 3, $7fffffff, $80000000); + print "jltu -2: "; check_list(branch_results, 0, 0, 1, 0, 0, 0, 0, 0); print "^"; + test_branch_jleu(2, -1, 0, 1, 2, 3, $7fffffff, $80000000); + print "jleu 2: "; check_list(branch_results, 1, 0, 0, 1, 1, 1, 1); print "^"; + test_branch_jleu(-2, -3, -2, -1, 0, 1, 3, $7fffffff, $80000000); + print "jleu -2: "; check_list(branch_results, 0, 1, 1, 0, 0, 0, 0, 0); print "^"; + + count_failures(); + ]; + +[ test_branch_jgt _vararg_count val1 ix val2 res; + @copy sp val1; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val2; + res = 1; + @jgt val1 val2 ?YES; + res = 0; + .YES; + branch_results-->ix = res; + } +]; + +[ test_branch_jge _vararg_count val1 ix val2 res; + @copy sp val1; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val2; + res = 1; + @jge val1 val2 ?YES; + res = 0; + .YES; + branch_results-->ix = res; + } +]; + +[ test_branch_jlt _vararg_count val1 ix val2 res; + @copy sp val1; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val2; + res = 1; + @jlt val1 val2 ?YES; + res = 0; + .YES; + branch_results-->ix = res; + } +]; + +[ test_branch_jle _vararg_count val1 ix val2 res; + @copy sp val1; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val2; + res = 1; + @jle val1 val2 ?YES; + res = 0; + .YES; + branch_results-->ix = res; + } +]; + +[ test_branch_jgtu _vararg_count val1 ix val2 res; + @copy sp val1; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val2; + res = 1; + @jgtu val1 val2 ?YES; + res = 0; + .YES; + branch_results-->ix = res; + } +]; + +[ test_branch_jgeu _vararg_count val1 ix val2 res; + @copy sp val1; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val2; + res = 1; + @jgeu val1 val2 ?YES; + res = 0; + .YES; + branch_results-->ix = res; + } +]; + +[ test_branch_jltu _vararg_count val1 ix val2 res; + @copy sp val1; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val2; + res = 1; + @jltu val1 val2 ?YES; + res = 0; + .YES; + branch_results-->ix = res; + } +]; + +[ test_branch_jleu _vararg_count val1 ix val2 res; + @copy sp val1; + _vararg_count--; + + for (ix=0 : ix<_vararg_count : ix++) { + @copy sp val2; + res = 1; + @jleu val1 val2 ?YES; + res = 0; + .YES; + branch_results-->ix = res; + } +]; + +TestClass StackTest + with name 'stack', + testfunc [ val eight; + print "Stack operations:^^"; + + @stkcount val; + print "stkcount="; check(val, 0); print ", "; + @copy 5 sp; + @stkcount val; + print "stkcount="; check(val, 1); print ", "; + @copy 6 sp; + @stkcount val; + print "stkcount="; check(val, 2); print ", "; + @copy 77 sp; + @stkcount sp; + @copy sp val; + @copy sp 0; + print "stkcount="; check(val, 3); print ", "; + noop(); + @copy 7 sp; + noop(); + @stkcount val; + print "stkcount="; check(val, 3); print ", "; + noop(); + @stkcount sp; + @copy sp val; + print "stkcount="; check(val, 3); print ", "; + @stkcount testglobal; + @copy testglobal val; + print "stkcount="; check(val, 3); print "^"; + + ! 5 6 7 + noop(); + @stkswap; + @sub sp sp val; + print "sp-sp="; check(val, -1); print ", "; + ! 5 + noop(); + @copy 2 sp; + @stkswap; + @sub sp sp val; + print "sp-sp="; check(val, 3); print ", "; + ! + @copy 5 sp; + @copy 4 sp; + @stkswap; + @sub sp sp val; + print "sp-sp="; check(val, 1); print "^"; + + eight = 8; + + @copy 7 sp; @copy eight sp; @copy 9 sp; + @stkpeek 0 val; + print "peek 0="; check(val, 9); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; @copy 9 sp; + @stkpeek 1 val; + print "peek 1="; check(val, 8); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; @copy 9 sp; + @stkpeek 2 val; + print "peek 2="; check(val, 7); print ", "; + @copy sp val; @copy sp val; @copy sp val; + ! + @copy 7 sp; @copy eight sp; @copy 9 sp; + noop(); + @stkpeek 0 val; + print "peek 0="; check(val, 9); print ", "; + noop(); + @stkpeek 1 val; + print "peek 1="; check(val, 8); print ", "; + noop(); + @stkpeek 2 val; + print "peek 2="; check(val, 7); print ", "; + @copy sp val; @copy sp val; @copy sp val; + ! + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + @stkpeek 0 val; + print "peek 0="; check(val, 9); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + @stkpeek 1 val; + print "peek 1="; check(val, 8); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + @stkpeek 2 val; + print "peek 2="; check(val, 7); print "^"; + @copy sp val; @copy sp val; @copy sp val; + + @stkcount val; + print "count="; check(val, 0); print "^"; + + @copy 7 sp; @copy eight sp; @copy 9 sp; + @stkpeek 0 sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; @copy 9 sp; + @stkpeek 1 sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; @copy 9 sp; + @stkpeek 2 sp; @copy sp val; + print "peek 2="; check(val, 7); print ", "; + @copy sp val; @copy sp val; @copy sp val; + ! + @copy 7 sp; @copy eight sp; @copy 9 sp; + noop(); + @stkpeek 0 sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + noop(); + @stkpeek 1 sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + noop(); + @stkpeek 2 sp; @copy sp val; + print "peek 2="; check(val, 7); print ", "; + @copy sp val; @copy sp val; @copy sp val; + ! + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + @stkpeek 0 sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + @stkpeek 1 sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + @stkpeek 2 sp; @copy sp val; + print "peek 2="; check(val, 7); print "^"; + @copy sp val; @copy sp val; @copy sp val; + + @stkcount val; + print "count="; check(val, 0); print "^"; + + @copy 7 sp; @copy eight sp; @copy 9 sp; + testglobal=0; @stkpeek testglobal sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; @copy 9 sp; + testglobal=1; @stkpeek testglobal sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; @copy 9 sp; + testglobal=2; @stkpeek testglobal sp; @copy sp val; + print "peek 2="; check(val, 7); print ", "; + @copy sp val; @copy sp val; @copy sp val; + ! + @copy 7 sp; @copy eight sp; @copy 9 sp; + noop(); + testglobal=0; @stkpeek testglobal sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + noop(); + testglobal=1; @stkpeek testglobal sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + noop(); + testglobal=2; @stkpeek testglobal sp; @copy sp val; + print "peek 2="; check(val, 7); print ", "; + @copy sp val; @copy sp val; @copy sp val; + ! + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + testglobal=0; @stkpeek testglobal sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + testglobal=1; @stkpeek testglobal sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + testglobal=2; @stkpeek testglobal sp; @copy sp val; + print "peek 2="; check(val, 7); print "^"; + @copy sp val; @copy sp val; @copy sp val; + + @stkcount val; + print "count="; check(val, 0); print "^"; + + @copy 7 sp; @copy eight sp; @copy 9 sp; + testglobal=0; @stkpeek testglobal val; + print "peek 0="; check(val, 9); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; @copy 9 sp; + testglobal=1; @stkpeek testglobal val; + print "peek 1="; check(val, 8); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; @copy 9 sp; + testglobal=2; @stkpeek testglobal val; + print "peek 2="; check(val, 7); print ", "; + @copy sp val; @copy sp val; @copy sp val; + ! + @copy 7 sp; @copy eight sp; @copy 9 sp; + noop(); + testglobal=0; @stkpeek testglobal val; + print "peek 0="; check(val, 9); print ", "; + noop(); + testglobal=1; @stkpeek testglobal val; + print "peek 1="; check(val, 8); print ", "; + noop(); + testglobal=2; @stkpeek testglobal val; + print "peek 2="; check(val, 7); print ", "; + @copy sp val; @copy sp val; @copy sp val; + ! + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + testglobal=0; @stkpeek testglobal val; + print "peek 0="; check(val, 9); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + testglobal=1; @stkpeek testglobal val; + print "peek 1="; check(val, 8); print ", "; + @copy sp val; @copy sp val; @copy sp val; + @copy 7 sp; @copy eight sp; noop(); @copy 9 sp; + testglobal=2; @stkpeek testglobal val; + print "peek 2="; check(val, 7); print "^"; + @copy sp val; @copy sp val; @copy sp val; + + @stkcount val; + print "count="; check(val, 0); print "^"; + + @copy 7 sp; @copy eight sp; @copy 9 sp; + @copy 1 sp; + @stkpeek sp sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + @copy 1 sp; + noop(); + @stkpeek sp sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + noop(); + @copy 1 sp; + @stkpeek sp sp; @copy sp val; + print "peek 1="; check(val, 8); print ", "; + ! + @copy 0 sp; + @stkpeek sp sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + @copy 0 sp; + noop(); + @stkpeek sp sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + noop(); + @copy 0 sp; + @stkpeek sp sp; @copy sp val; + print "peek 0="; check(val, 9); print ", "; + ! + testglobal = 2; + @copy testglobal sp; + @stkpeek sp sp; @copy sp val; + print "peek 2="; check(val, 7); print ", "; + @copy testglobal sp; + noop(); + @stkpeek sp sp; @copy sp val; + print "peek 2="; check(val, 7); print ", "; + noop(); + @copy testglobal sp; + @stkpeek sp sp; @copy sp val; + print "peek 2="; check(val, 7); print "^"; + ! + @copy sp val; @copy sp val; @copy sp val; + + @stkcount val; + print "count="; check(val, 0); print "^"; + + @copy 2 sp; @copy 3 sp; @copy 4 sp; + @stkcount val; + @call arghasher val val; + print "hash(4,3,2)="; check(val, 16); print ", "; + @copy 2 sp; @copy 3 sp; @copy 5 sp; + @stkcopy 3; + @stkcount val; + @call arghasher val val; + print "hash(5,3,2,5,3,2)="; check(val, 64); print ", "; + @copy 2 sp; @copy 3 sp; @copy 4 sp; noop(); + @stkcopy 3; + @stkcount val; + @call arghasher val val; + print "hash(4,3,2,4,3,2)="; check(val, 59); print ", "; + @copy 2 sp; @copy 3 sp; noop(); @copy 5 sp; + @stkcopy 3; + @stkcount val; + @call arghasher val val; + print "hash(5,3,2,5,3,2)="; check(val, 64); print "^"; + + @stkcopy 0; + @stkcount val; + print "stkcount="; check(val, 0); print "^"; + + testglobal = 3; + @copy 2 sp; @copy 3 sp; @copy 5 sp; + @stkcopy testglobal; + @stkcount val; + @call arghasher val val; + print "hash(5,3,2,5,3,2)="; check(val, 64); print ", "; + @copy 2 sp; @copy 3 sp; @copy 4 sp; noop(); + @stkcopy testglobal; + @stkcount val; + @call arghasher val val; + print "hash(4,3,2,4,3,2)="; check(val, 59); print ", "; + @copy 2 sp; @copy 3 sp; noop(); @copy 5 sp; + @stkcopy testglobal; + @stkcount val; + @call arghasher val val; + print "hash(5,3,2,5,3,2)="; check(val, 64); print "^"; + + @stkcount val; + print "stkcount="; check(val, 0); print "^"; + + @copy 5 sp; @copy 4 sp; @copy 3 sp; + @copy 2 sp; + @stkcopy sp; + @stkcount val; + @call arghasher val val; + print "hash(3,4,3,4,5)="; check(val, 61); print ", "; + @copy 5 sp; @copy 4 sp; noop(); @copy 3 sp; + @copy 2 sp; + @stkcopy sp; + @stkcount val; + @call arghasher val val; + print "hash(3,4,3,4,5)="; check(val, 61); print ", "; + @copy 5 sp; @copy 4 sp; @copy 3 sp; + @copy 2 sp; noop(); + @stkcopy sp; + @stkcount val; + @call arghasher val val; + print "hash(3,4,3,4,5)="; check(val, 61); print ", "; + @copy 5 sp; @copy 4 sp; @copy 3 sp; + noop(); @copy 2 sp; + @stkcopy sp; + @stkcount val; + @call arghasher val val; + print "hash(3,4,3,4,5)="; check(val, 61); print "^"; + + @stkcount val; + print "stkcount="; check(val, 0); print "^"; + + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkcount val; + @call arghasher val val; + print "hash(6,4,3,2,1)="; check(val, 36); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkroll 0 1; + @stkcount val; + @call arghasher val val; + print "hash(6,4,3,2,1)="; check(val, 36); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkroll 2 4; + @stkcount val; + @call arghasher val val; + print "hash(6,4,3,2,1)="; check(val, 36); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkroll 3 1; + @stkcount val; + @call arghasher val val; + print "hash(4,3,6,2,1)="; check(val, 41); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkroll 3 (-1); + @stkcount val; + @call arghasher val val; + print "hash(3,6,4,2,1)="; check(val, 40); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkroll 3 (-2); + @stkcount val; + @call arghasher val val; + print "hash(4,3,6,2,1)="; check(val, 41); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkroll 3 2; + @stkcount val; + @call arghasher val val; + print "hash(3,6,4,2,1)="; check(val, 40); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkroll 3 3; + @stkcount val; + @call arghasher val val; + print "hash(6,4,3,2,1)="; check(val, 36); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @stkroll 3 (-6); + @stkcount val; + @call arghasher val val; + print "hash(6,4,3,2,1)="; check(val, 36); print "^"; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @copy 1 sp; @copy 4 sp; + @stkroll sp sp; + @stkcount val; + @call arghasher val val; + print "hash(4,3,2,6,1)="; check(val, 45); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @copy (-1) sp; @copy 4 sp; + @stkroll sp sp; + @stkcount val; + @call arghasher val val; + print "hash(2,6,4,3,1)="; check(val, 43); print "^"; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @copy 1 sp; @copy 4 sp; + noop(); + @stkroll sp sp; + @stkcount val; + @call arghasher val val; + print "hash(4,3,2,6,1)="; check(val, 45); print ", "; + @copy 1 sp; @copy 2 sp; @copy 3 sp; @copy 4 sp; @copy 6 sp; + @copy (-1) sp; @copy 4 sp; + noop(); + @stkroll sp sp; + @stkcount val; + @call arghasher val val; + print "hash(2,6,4,3,1)="; check(val, 43); print "^"; + + count_failures(); + ]; + +TestClass GestaltTest + with name 'gestalt', + testfunc [ val; + print "Gestalt:^^"; + + @gestalt 4 0 val; ! IOSystem + print "gestalt(4,0)="; check(val, 1); print ", "; + @gestalt 4 1 val; ! IOSystem + print "gestalt(4,1)="; check(val, 1); print ", "; + @gestalt 4 99 val; ! IOSystem + print "gestalt(4,99)="; check(val, 0); print "^"; + + @gestalt 1234 5678 val; + print "gestalt(1234,5678)="; check(val, 0); print "^"; + + testglobal = 0; + @gestalt 4 1 testglobal; ! IOSystem + print "gestalt(4,1)="; check(testglobal, 1); print "^"; + + @copy 99 sp; + @gestalt 4 1 sp; + @copy sp val; + print "gestalt(4,1)="; check(val, 1); print "^"; + @copy sp val; + print "guard="; check(val, 99); print "^"; + + count_failures(); + ]; + +TestClass ThrowTest + with name 'throw' 'catch' 'exception' 'continuation', + testfunc [ val tok; + print "Catch/throw:^^"; + + testglobal = 0; + val = test_catch_jump0(); + print "catch 0="; check(val, 0); print ", "; + print "token="; check(testglobal, 248+allstackdepth); print "^"; + + testglobal = 0; + val = test_catch_jump1(); + print "catch 1="; check(val, 1); print ", "; + print "token="; check(testglobal, 248+allstackdepth); print "^"; + + testglobal = 0; + val = test_catch_jump1sp(); + print "catch 1 sp="; check(val, 1); print ", "; + print "token="; check(testglobal, 248+allstackdepth); print "^"; + + testglobal = 0; + @copy 77 sp; + val = test_catch_discard(); + print "catch discard="; check(val, 100); print ", "; + print "token="; check(testglobal, 252+allstackdepth); print ", "; + @copy sp val; + print "guard="; check(val, 77); print "^"; + + testglobal = 0; + val = test_catch_computed(5); + print "catch computed="; check(val, 99); print ", "; + print "thrown="; check(testglobal, 97); print ", "; + print "token="; check(testglobal2, 256+allstackdepth); print "^"; + + testglobal = 0; + testglobal2 = 0; + val = 88; + @catch testglobal ?Catch1; + jump Throw1; + .Catch1; + testglobal2 = testglobal; + val = recurse_throw(testglobal, 100, 5); + testglobal = 0; + testglobal2 = 0; + .Throw1; + print "global catch="; check(testglobal, 105); print ", "; + print "token="; check(testglobal2, 220+allstackdepth); print ", "; + print "guard="; check(val, 88); print "^"; + + testglobal = 0; + testglobal2 = 0; + val = 87; + @catch testglobal ?Catch2; + jump Throw2; + .Catch2; + testglobal2 = testglobal; + val = recurse_throw_sp(testglobal, 100, 6); + testglobal = 0; + testglobal2 = 0; + .Throw2; + print "global catch="; check(testglobal, 106); print ", "; + print "token="; check(testglobal2, 220+allstackdepth); print ", "; + print "guard="; check(val, 87); print "^"; + + testglobal = 0; + testglobal2 = 0; + val = 86; + @catch testglobal ?Catch3; + jump Throw3; + .Catch3; + testglobal2 = testglobal; + val = recurse_throw_spnoop(testglobal, 100, 7); + testglobal = 0; + testglobal2 = 0; + .Throw3; + print "global catch="; check(testglobal, 107); print ", "; + print "token="; check(testglobal2, 220+allstackdepth); print ", "; + print "guard="; check(val, 86); print "^"; + + tok = 0; + testglobal2 = 0; + val = 88; + @catch tok ?Catch4; + jump Throw4; + .Catch4; + testglobal2 = tok; + val = recurse_throw(tok, 100, 5); + tok = 0; + testglobal2 = 0; + .Throw4; + print "local catch="; check(tok, 105); print ", "; + print "token="; check(testglobal2, 220+allstackdepth); print ", "; + print "guard="; check(val, 88); print "^"; + + tok = 0; + testglobal = 0; + testglobal2 = 0; + val = 87; + @catch sp ?Catch5; + testglobal++; + jump Throw5; + .Catch5; + @copy sp testglobal2; + val = recurse_throw(testglobal2, 100, 4); + tok = 0; + testglobal2 = 0; + .Throw5; + @copy sp tok; + print "local catch="; check(tok, 104); print ", "; + print "token="; check(testglobal2, 220+allstackdepth); print ", "; + print "count="; check(testglobal, 1); print ", "; + print "guard="; check(val, 87); print "^"; + + count_failures(); + ]; + +[ test_catch_jump0; + @"2:50" testglobal 0; + testglobal = 98; + return 99; +]; + +[ test_catch_jump1; + noop(); + @"2:50" testglobal 1; + testglobal = 98; + return 99; +]; + +[ test_catch_jump1sp; + @copy 1 sp; + noop(); + @"2:50" testglobal sp; + testglobal = 98; + return 99; +]; + +[ test_catch_discard; + @catch testglobal ?Catch; + testglobal = 98; + return 99; + .Catch; + return 100; +]; + +[ test_catch_computed loc dummy; + @"2:50" testglobal loc; + @"1:49" 99; + !.Catch; + testglobal2 = testglobal; + @"2:51" 97 testglobal; + testglobal = 0; + dummy = 0; + return 0; +]; + +[ recurse_throw token val depth; + if (depth == 0) + @throw val token; + else + recurse_throw(token, val+1, depth-1); + return 99; +]; + +[ recurse_throw_sp token val depth; + if (depth == 0) { + @copy token sp; + @copy val sp; + @throw sp sp; + } + else + recurse_throw(token, val+1, depth-1); + return 99; +]; + +[ recurse_throw_spnoop token val depth; + if (depth == 0) { + @copy token sp; + @copy val sp; + noop(); + @throw sp sp; + } + else + recurse_throw(token, val+1, depth-1); + return 99; +]; + +TestClass StreamNumTest + with name 'streamnum', + testfunc [ val; + print "Printing integers:^^"; + + testglobal = 0; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("0", val); print "^"; + testglobal = 1; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("1", val); print "^"; + testglobal = -1; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("-1", val); print "^"; + testglobal = 9999; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("9999", val); print "^"; + testglobal = -9999; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("-9999", val); print "^"; + testglobal = 1234579; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("1234579", val); print "^"; + testglobal = -97654321; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("-97654321", val); print "^"; + testglobal = $7FFFFFFF; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("2147483647", val); print "^"; + testglobal = $80000001; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("-2147483647", val); print "^"; + testglobal = $80000000; + val = string_to_array(numberprint, bigbuffer, BIGBUFSIZE); + check_str("-2147483648", val); print "^"; + + count_failures(); + ]; + +! The following is imported from encode-table. +! ----------- +Array encoding_table -> 0 0 3 178 0 0 0 133 0 0 0 12 0 0 0 0 21 0 0 0 + 199 0 0 0 0 30 0 0 0 98 0 0 0 0 39 0 0 0 63 0 0 0 0 48 0 + 0 0 61 0 0 0 0 57 0 0 0 59 2 115 2 121 2 123 0 0 0 0 72 0 0 + 0 74 2 125 0 0 0 0 83 0 0 0 85 2 101 0 0 0 0 94 0 0 0 96 2 + 97 2 98 0 0 0 0 107 0 0 0 175 0 0 0 0 116 0 0 0 151 0 0 0 0 + 125 0 0 0 138 0 0 0 0 134 0 0 0 136 2 100 2 105 0 0 0 0 147 0 0 + 0 149 2 110 2 111 0 0 0 0 160 0 0 0 173 0 0 0 0 169 0 0 0 171 2 + 112 2 116 2 34 0 0 0 0 184 0 0 0 197 0 0 0 0 193 0 0 0 195 2 91 + 2 93 2 58 0 0 0 0 208 0 0 2 110 0 0 0 0 217 0 0 0 218 1 0 0 + 0 0 227 0 0 1 31 0 0 0 0 236 0 0 1 29 0 0 0 0 245 0 0 0 250 + 9 0 0 0 0 0 0 0 1 3 0 0 1 16 0 0 0 1 12 0 0 1 14 2 84 + 2 232 0 0 0 1 25 0 0 1 27 2 236 2 242 2 46 0 0 0 1 40 0 0 1 + 179 0 0 0 1 49 0 0 1 104 0 0 0 1 58 0 0 1 79 0 0 0 1 67 0 + 0 1 69 2 249 3 99 111 110 116 97 105 110 115 0 0 0 0 1 88 0 0 1 99 3 + 115 117 98 115 116 114 105 110 103 0 4 0 0 0 101 0 0 0 1 113 0 0 1 132 0 + 0 0 1 122 0 0 1 127 4 0 0 0 111 4 0 0 3 177 0 0 0 1 141 0 0 + 1 146 4 0 0 48 169 5 0 0 0 115 0 0 0 101 0 0 0 118 0 0 0 101 0 + 0 0 114 0 0 0 97 0 0 0 108 0 0 0 0 0 0 0 1 188 0 0 2 23 0 + 0 0 1 197 0 0 1 252 0 0 0 1 206 0 0 1 247 5 0 0 0 115 0 0 0 + 117 0 0 0 98 0 0 0 115 0 0 0 116 0 0 0 114 0 0 0 105 0 0 0 110 + 0 0 0 103 0 0 0 0 8 0 0 0 0 0 0 0 2 5 0 0 2 10 8 0 0 + 0 0 10 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 2 32 0 0 2 71 0 + 0 0 2 41 0 0 2 58 10 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 + 10 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 2 80 0 0 2 97 10 0 0 + 0 0 0 0 0 2 0 0 0 0 0 0 0 0 11 0 0 0 0 0 0 0 1 0 0 + 0 0 0 0 0 2 119 0 0 3 71 0 0 0 2 128 0 0 2 248 0 0 0 2 137 + 0 0 2 213 0 0 0 2 146 0 0 2 200 0 0 0 2 155 0 0 2 198 0 0 0 + 2 164 0 0 2 181 11 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 11 0 + 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 2 10 0 0 0 2 209 0 0 2 + 211 2 39 2 96 0 0 0 2 222 0 0 2 235 0 0 0 2 231 0 0 2 233 2 99 + 2 102 0 0 0 2 244 0 0 2 246 2 103 2 106 0 0 0 3 1 0 0 3 36 0 + 0 0 3 10 0 0 3 23 0 0 0 3 19 0 0 3 21 2 107 2 109 0 0 0 3 + 32 0 0 3 34 2 113 2 114 0 0 0 3 45 0 0 3 58 0 0 0 3 54 0 0 + 3 56 2 117 2 118 0 0 0 3 67 0 0 3 69 2 119 2 120 0 0 0 3 80 0 + 0 3 143 0 0 0 3 89 0 0 3 130 0 0 0 3 98 0 0 3 111 0 0 0 3 + 107 0 0 3 109 2 122 2 224 0 0 0 3 120 0 0 3 125 9 0 0 0 0 9 0 + 0 0 0 0 0 0 3 139 0 0 3 141 2 32 2 48 0 0 0 3 152 0 0 3 165 + 0 0 0 3 161 0 0 3 163 2 49 2 50 0 0 0 3 174 0 0 3 176 2 104 2 + 108; +Array encoding_patches --> 8 13 17 22 26 31 35 40 44 49 53 64 + 68 75 79 86 90 99 103 108 112 117 121 126 130 139 143 152 156 + 161 165 176 180 185 189 200 204 209 213 219 223 228 232 237 241 251 + 255 260 264 273 277 288 292 297 301 306 310 315 319 336 340 361 365 + 370 374 389 393 436 440 445 449 454 458 509 513 536 540 545 549 584 + 588 623 627 632 636 641 645 650 654 659 663 668 672 713 717 726 730 + 735 739 748 752 761 765 770 774 779 783 792 796 805 809 814 818 827 + 831 840 844 849 853 858 862 867 871 880 884 899 903 912 916 921 925 + 934 938 0; +Global table_patched = false; + +! Call this before you do "@setstringtbl encoding_table". +[ patch_encoding_table addr ix; + if (table_patched) return; + table_patched = true; + ix = 0; + while (1) { + addr = encoding_patches-->ix; + if (addr == 0) break; + addr = addr + encoding_table; + addr-->0 = addr-->0 + encoding_table; + ix++; + } + addr = encoding_table + 246; addr-->0 = double_indirect+8; + addr = encoding_table + 504; addr-->0 = argprint; + addr = encoding_table + 518; addr-->0 = hello_str; + addr = encoding_table + 523; addr-->0 = argprint; + addr = encoding_table + 531; addr-->0 = 1; + addr = encoding_table + 554; addr-->0 = argprint; + addr = encoding_table + 562; addr-->0 = 1; + addr = encoding_table + 566; addr-->0 = 2; + addr = encoding_table + 571; addr-->0 = hello_str; + addr = encoding_table + 579; addr-->0 = 1; + addr = encoding_table + 593; addr-->0 = nativeprint; + addr = encoding_table + 601; addr-->0 = "foo"; + addr = encoding_table + 605; addr-->0 = "bar"; + addr = encoding_table + 610; addr-->0 = double_indirect+0; + addr = encoding_table + 618; addr-->0 = 1; + addr = encoding_table + 677; addr-->0 = double_indirect+4; + addr = encoding_table + 685; addr-->0 = 2; + addr = encoding_table + 689; addr-->0 = 3; + addr = encoding_table + 694; addr-->0 = double_indirect+8; + addr = encoding_table + 702; addr-->0 = hello_str; + addr = encoding_table + 706; addr-->0 = bye_str; + addr = encoding_table + 889; addr-->0 = double_indirect+0; + addr = encoding_table + 894; addr-->0 = double_indirect+4; +]; + +! Double-indirect references: (start out as all zeroes) +Array double_indirect --> 3 ; + +! String objects + +Array alphabet2_str -> $E1 28 63 17 216 116 246 137 243 197 191 148 100 + 101 181 6 234 102 187 219 195 67 0; +Array alphabet_str -> $E1 28 63 17 216 116 246 137 243 197 191 148 100 + 101 181 6 234 102 187 219 195 67 0; +Array bye_str -> $E1 60 100 1; +Array dindir012_str -> $E1 120 170 181 158 107 173 5 5; +Array dindir0_1_str -> $E1 120 123 191 223 20; +Array dindir0_str -> $E1 120 251 201 111 10; +Array dindir1_23_str -> $E1 248 248 128 63 20; +Array dindir1_str -> $E1 248 248 217 31 10; +Array dindir2_hello_bye_str -> $E1 248 250 160 191 20; +Array dindir2_str -> $E1 248 122 225 47 5; +Array dinquote2_str -> $E1 168 71 227 98 60 210 20; +Array hello_str -> $E1 31 251 127 57; +Array highbit_str -> $E1 199 210 178 242 134 0; +Array indirargprint_12_str -> $E1 166 199 6; +Array indirargprint_1_str -> $E1 166 219 6; +Array indirargprint_str -> $E1 166 211 6; +Array indirhello_1_str -> $E1 166 215 6; +Array indirhello_str -> $E1 166 203 6; +Array indirnativeprint_foobar_str -> $E1 166 207 6; +Array mix_str -> $E1 37 159 8 174 198 171 253 146 90 132 230 75 + 133 10 3 117 24; +Array newline_str -> $E1 195 0; +Array null_str -> $E1 1; +Array substring_str -> $E1 186 73 7; +Array subunistring_str -> $E1 186 67 7; +Array unicode_str -> $E1 220 177 181 45; +! ----------- + +Array cstring_str -> $E0 'C' ' ' 's' 't' 'r' 'i' 'n' 'g' '.' 0; +Array cunistring_str --> $E2000000 'C' ' ' $DC 'n' $EF 'c' 'o' $3B4 'e' ' ' $201C $30A9 $201D 0; + +Constant BIGBUFSIZE 256; +Array bigbuffer -> BIGBUFSIZE; +Array bigbuffer2 -> BIGBUFSIZE; +Array bigubuffer --> BIGBUFSIZE; +Array bigubuffer2 --> BIGBUFSIZE; + +TestClass StringsTest + with name 'strings' 'string', + testfunc [ val; + print "String table decoding:^^"; + patch_encoding_table(); + + print "Basic strings: "; + val = tablestring(hello_str); + check_str("hello", val); + print " is len "; check(val, 5); print ", "; + val = tablestring(bye_str); + check_str("bye", val); print ", "; + val = tablestring(null_str); + check_str("", val); print ", "; + val = tablestring(alphabet_str); + check_str("abcdefghijklmnopqrstuvwxyz", val); print ", "; + val = tablestring(highbit_str); + check_str("@@224@@232@@236@@242@@249", val); print ", "; + val = tablestring(newline_str); + check_str("^", val); print ", "; + val = tablestring(mix_str); + check_str("This contains several node types.^", val); print "^"; + + print "Unicode strings: "; + val = tableustring(hello_str); + check_ustr("hello", val); print ", "; + val = tableustring(alphabet2_str); + check_ustr("abcdefghijklmnopqrstuvwxyz", val); print ", "; + val = tableustring(unicode_str); + check_ustr("a@{e0}@{3b1}@{30a9}", val); print "^"; + + print "C-style strings: "; + val = tableustring(cstring_str); + check_ustr("C string.", val); print "^"; + val = tableustring(cunistring_str); + check_ustr("C @{DC}n@{EF}co@{3B4}e @{201C}@{30A9}@{201D}", val); print "^"; + + print "Substrings: "; + val = tablestring(substring_str); + check_str("~substring~", val); print ", "; + val = tablestring(subunistring_str); + check_str("~substring~", val); print "^"; + + print "References: "; + val = tablestring(indirhello_str); + check_str("[hello]", val); print ", "; + val = tablestring(indirhello_1_str); + check_str("[hello]", val); print ", "; + val = tablestring(indirargprint_str); + check_str("[]", val); print ", "; + val = tablestring(indirargprint_1_str); + check_str("[1]", val); print ", "; + val = tablestring(indirargprint_12_str); + check_str("[1 2]", val); print ", "; + val = tablestring(indirnativeprint_foobar_str); + check_str("[foo bar]", val); print "^"; + + print "Indirect references: "; + double_indirect-->0 = bye_str; + val = tablestring(dindir0_str); + check_str("{0:bye:0}", val); print ", "; + double_indirect-->0 = substring_str; + val = tablestring(dindir0_str); + check_str("{0:~substring~:0}", val); print ", "; + double_indirect-->0 = hello_str; + double_indirect-->1 = dindir0_str; + val = tablestring(dindir1_str); + check_str("{1:{0:hello:0}:1}", val); print ", "; + double_indirect-->0 = byehello_func; + val = tablestring(dindir1_str); + check_str("{1:{0:bye hello:0}:1}", val); print ", "; + double_indirect-->0 = argprint; + val = tablestring(dindir0_1_str); + check_str("{0:1:0}", val); print ", "; + double_indirect-->1 = argprint; + val = tablestring(dindir1_23_str); + check_str("{1:2 3:1}", val); print ", "; + double_indirect-->2 = argprintstr; + val = tablestring(dindir2_hello_bye_str); + check_str("{2:hello bye:2}", val); print ", "; + double_indirect-->2 = null_str; + val = tablestring(dinquote2_str); + check_str("{~'``'~}", val); print "^"; + + print "Multiple references: "; + double_indirect-->0 = hello_str; + double_indirect-->1 = bye_str; + double_indirect-->2 = cstring_str; + val = tablestring(dindir012_str); + check_str("{hello...bye...C string.}", val); print ", "; + testglobal = 0; + double_indirect-->0 = dindir1_str; + double_indirect-->1 = counterprint; + double_indirect-->2 = byehello_func; + val = tablestring(dindir012_str); + check_str("{{1:+0:1}...+1...bye hello}", val); print ", "; + print "counter="; check(testglobal, 2); print "^"; + + print "Indirect references with unicode: "; + double_indirect-->2 = unicode_str; + val = tableustring(dindir2_str); + check_ustr("{2:a@{e0}@{3b1}@{30a9}:2}", val); print "^"; + + count_failures(); + ]; + +[ tablestring val len; + @setstringtbl encoding_table; + len = string_to_array(val, bigbuffer, BIGBUFSIZE); + val = HDR_DECODINGTBL-->0; + @setstringtbl val; + return len; +]; + +[ tableustring val len; + @setstringtbl encoding_table; + len = string_to_uniarray(val, bigubuffer, BIGBUFSIZE); + val = HDR_DECODINGTBL-->0; + @setstringtbl val; + return len; +]; + +[ argprint _vararg_count ix; + for (ix=0 : ix<_vararg_count : ix++) { + if (ix) @streamchar 32; + @streamnum sp; + } +]; + +[ argprintstr _vararg_count ix; + for (ix=0 : ix<_vararg_count : ix++) { + if (ix) @streamchar 32; + @streamstr sp; + } +]; + +[ nativeprint _vararg_count ix val; + val = HDR_DECODINGTBL-->0; + @setstringtbl val; + for (ix=0 : ix<_vararg_count : ix++) { + if (ix) @streamchar 32; + @streamstr sp; + } + @setstringtbl encoding_table; +]; + +[ numberprint; + @streamnum testglobal; +]; + +[ counterprint; + @streamchar '+'; + @streamnum testglobal; + testglobal++; +]; + +[ byehello_func; + @streamstr bye_str; + @streamchar 32; + @streamstr hello_str; +]; + +Constant RAMSTRINGBUFLEN 16; +Array ramstringbuf -> RAMSTRINGBUFLEN; + +TestClass RamStringsTest + with name 'ramstrings' 'ramstring', + testfunc [ val str ix; + print "String table decoding in RAM:^^"; + + str = "Decode test."; + val = string_to_array(str, bigbuffer, BIGBUFSIZE); + check_str(str, val); print "^"; + + str = "Another test."; + for (ix=0 : ixix = str->ix; + val = string_to_array(ramstringbuf, bigbuffer, BIGBUFSIZE); + check_str(str, val); print "^"; + + str = "Third test."; + for (ix=0 : ixix = str->ix; + val = string_to_array(ramstringbuf, bigbuffer, BIGBUFSIZE); + check_str(str, val); print "^"; + + str = ""; + for (ix=0 : ixix = str->ix; + val = string_to_array(ramstringbuf, bigbuffer, BIGBUFSIZE); + check_str(str, val); print "^"; + + count_failures(); + ]; + +TestClass IOSysTest + with name 'iosys', + testfunc [ val; + print "I/O mode switching:^^"; + + @setiosys 0 0; + val = string_to_array("static null", bigbuffer, BIGBUFSIZE); + @setiosys 2 0; + check_str("", val); print ", "; + + @setiosys 2 0; + val = string_to_array("static glk", bigbuffer, BIGBUFSIZE); + @setiosys 2 0; + check_str("static glk", val); print ", "; + + @setiosys 1 prependequal; + val = string_to_array("static filter", bigbuffer, BIGBUFSIZE); + @setiosys 2 0; + check_str("=s=t=a=t=i=c= =f=i=l=t=e=r", val); print "^"; + + @setiosys 1 prependuequal; + val = string_to_uniarray(cunistring_str, bigubuffer, BIGBUFSIZE); + @setiosys 2 0; + check_ustr("=C= =@{DC}=n=@{EF}=c=o=@{3B4}=e= =@{201C}=@{30A9}=@{201D}", val); print "^"; + + testglobal=0; testglobal2=0; + @setiosys testglobal testglobal2; + val = string_to_array(iosys_tester, bigbuffer, BIGBUFSIZE); + @setiosys 2 0; + check_str("", val); print ", "; + print "guard="; check(testglobal, 99); print "^"; + + @setiosys 0 0; + testglobal=2; testglobal2=0; + @setiosys testglobal testglobal2; + val = string_to_array(iosys_tester, bigbuffer, BIGBUFSIZE); + @setiosys 2 0; + check_str("string, chr 0, -100 -2", val); print ", "; + print "guard="; check(testglobal, 99); print "^"; + + testglobal=1; testglobal2=surroundbracket; + @setiosys testglobal testglobal2; + val = string_to_array(iosys_tester, bigbuffer, BIGBUFSIZE); + @setiosys 2 0; + check_str("<,>< >< ><0><,>< ><-><1><0><0>< ><-><2>", val); print ", "; + print "guard="; check(testglobal, 99); print "^"; + + testglobal=1; testglobal2=surroundbracket; + @setiosys testglobal testglobal2; + val = string_to_uniarray(iosys_tester, bigubuffer, BIGBUFSIZE); + @setiosys 2 0; + check_ustr("<,>< >< ><0><,>< ><-><1><0><0>< ><-><2>", val); print ", "; + print "guard="; check(testglobal, 99); print "^"; + + @getiosys testglobal testglobal2; + print "current="; check(testglobal, 2); print ", "; + check(testglobal2, 0); print "^"; + + @setiosys 1 appendequal; + @getiosys sp sp; + @setiosys 2 0; + @stkswap; + @copy sp val; + print "current="; check(val, 1); print ", "; + @copy sp val; + check(val, appendequal); print "^"; + + print "Changing in mid-string: "; + @setiosys 1 surroundonce; + val = string_to_array(printhash_func, bigbuffer, BIGBUFSIZE); + @getiosys testglobal testglobal2; + print "current="; check(testglobal, 2); print ", "; + check(testglobal2, 0); print ", "; + check_str("<#>.", val); print ", "; + @setiosys 1 surroundonce; + val = string_to_array("abcde", bigbuffer, BIGBUFSIZE); + @getiosys testglobal testglobal2; + print "current="; check(testglobal, 2); print ", "; + check(testglobal2, 0); print ", "; + check_str("bcde", val); print ", "; + @setiosys 1 surroundonce; + val = string_to_array(print123_func, bigbuffer, BIGBUFSIZE); + @getiosys testglobal testglobal2; + print "current="; check(testglobal, 2); print ", "; + check(testglobal2, 0); print ", "; + check_str("<1>23", val); print "^"; + + count_failures(); + ]; + +TestClass IOSys2Test + with name 'iosys2', + testfunc [ val; + print "I/O mode with different store operands:^"; + print "This tests for a bug in older Glulxe (version 0.4.5 and + earlier). Calling @@64getiosys with two different store + operands (e.g., a local variable and a global variable) + did the wrong thing in those releases. + Because the bug has been around for so long, + the spec recommends not doing what this test does.^^"; + + val = -1; + testglobal = -1; + @getiosys testglobal val; + print "current="; check(testglobal, 2); print ", "; + check(val, 0); print "^"; + + count_failures(); + ]; + +Array ccomma_str -> $E0 ',' ' ' 0; + +[ iosys_tester loc; + print "string"; + @streamstr ccomma_str; + @streamchar 'c'; @streamchar 'h'; @streamchar 'r'; @streamchar ' '; + @streamnum 0; + @streamunichar ','; + @streamunichar ' '; + @streamnum (-100); + loc = ' '; + @streamchar loc; + loc = 2; + loc = 0-loc; + @streamnum loc; + testglobal = 99; +]; + +[ printhash_func; + @streamchar '#'; + @streamchar '.'; +]; + +[ print123_func; + @streamnum 123; +]; + +TestClass FilterTest + with name 'filter' 'filterio', + testfunc [ val; + print "Filter iosys mode:^^"; + patch_encoding_table(); + + print "Basic strings: "; + val = tablefilterstring(hello_str); + check_str("=h=e=l=l=o", val); print ", "; + val = tablefilterrstring(bye_str); + check_str("b=y=e=", val); print ", "; + val = tablefilterstring(mix_str); + check_str("=T=h=i=s= =c=o=n=t=a=i=n=s= =s=e=v=e=r=a=l= =n=o=d=e= =t=y=p=e=s=.=^", val); print ", "; + val = tablefilterstring(cunistring_str); + check_str("=C= =@{DC}=n=@{EF}=c=o=@{B4}=e= =@{1C}=@{A9}=@{1D}", val); print "^"; + + print "References: "; + val = tablefilterstring(indirhello_str); + check_str("=[=h=e=l=l=o=]", val); print ", "; + val = tablefilterstring(indirargprint_12_str); + check_str("=[=1= =2=]", val); print ", "; + val = tablefilterstring(indirnativeprint_foobar_str); + check_str("=[=f=o=o= =b=a=r=]", val); print "^"; + + print "Multiple references: "; + double_indirect-->0 = hello_str; + double_indirect-->1 = bye_str; + double_indirect-->2 = cstring_str; + val = tablefilterstring(dindir012_str); + check_str("={=h=e=l=l=o=.=.=.=b=y=e=.=.=.=C= =s=t=r=i=n=g=.=}", val); print ", "; + double_indirect-->0 = bracketfilter; + double_indirect-->1 = indirhello_str; + double_indirect-->2 = indirargprint_12_str; + val = tablefilterstring(dindir012_str); + check_str("={<.><.><.><[><]><.><.><.><[><1>< ><2><]><}>", val); print ", "; + testglobal = 0; + double_indirect-->0 = dindir1_str; + double_indirect-->1 = counterprint; + double_indirect-->2 = byehello_func; + val = tablefilterstring(dindir012_str); + check_str("={={=1=:=+=0=:=1=}=.=.=.=+=1=.=.=.=b=y=e= =h=e=l=l=o=}", val); print ", "; + print "counter="; check(testglobal, 2); print ", "; + testglobal = 0; + double_indirect-->0 = cstring_str; + double_indirect-->1 = counterprint; + double_indirect-->2 = cunistring_str; + val = tablefilterstring(dindir012_str); + check_str("={=C= =s=t=r=i=n=g=.=.=.=.=+=0=.=.=.=C= =@{DC}=n=@{EF}=c=o=@{B4}=e= =@{1C}=@{A9}=@{1D}=}", val); print ", "; + print "counter="; check(testglobal, 1); print "^"; + + count_failures(); + ]; + +[ tablefilterstring val len; + @setstringtbl encoding_table; + @setiosys 1 prependequal; + len = string_to_array(val, bigbuffer, BIGBUFSIZE); + val = HDR_DECODINGTBL-->0; + @setiosys 2 0; + @setstringtbl val; + return len; +]; + +[ tablefilterrstring val len; + @setiosys 1 appendequal; + @setstringtbl encoding_table; + len = string_to_array(val, bigbuffer, BIGBUFSIZE); + val = HDR_DECODINGTBL-->0; + @setstringtbl val; + @setiosys 2 0; + return len; +]; + +[ bracketfilter; + @setiosys 1 surroundbracket; +]; + +[ prependequal ch; + glk($0080, '='); ! put_char + glk($0080, ch); ! put_char +]; + +[ prependuequal ch; + glk($0080, '='); ! put_char + glk($0128, ch); ! put_char_uni +]; + +[ appendequal ch; + glk($0080, ch); ! put_char + glk($0080, '='); ! put_char +]; + +[ surroundbracket ch; + glk($0080, '<'); ! put_char + glk($0080, ch); ! put_char + glk($0080, '>'); ! put_char +]; + +[ surroundonce ch; + @setiosys 2 0; + @streamchar '<'; + @streamchar ch; + @streamchar '>'; +]; + +TestClass NullIOTest + with name 'nullio', + testfunc [ val; + print "Null iosys mode:^^"; + patch_encoding_table(); + + print "Basic strings: "; + val = tablenullstring(hello_str); + check_str("", val); print ", "; + val = tablenullrstring(bye_str); + check_str("", val); print ", "; + val = tablenullstring(mix_str); + check_str("", val); print ", "; + val = tablenullstring(cunistring_str); + check_str("", val); print "^"; + + print "References: "; + val = tablenullstring(indirhello_str); + check_str("", val); print ", "; + val = tablenullstring(indirargprint_12_str); + check_str("", val); print ", "; + val = tablenullstring(indirnativeprint_foobar_str); + check_str("", val); print "^"; + + print "Multiple references: "; + double_indirect-->0 = hello_str; + double_indirect-->1 = bye_str; + double_indirect-->2 = cstring_str; + val = tablenullstring(dindir012_str); + check_str("", val); print ", "; + double_indirect-->0 = indirhello_str; + double_indirect-->1 = bracketfilter; + double_indirect-->2 = indirargprint_12_str; + val = tablenullstring(dindir012_str); + check_str("<.><.><.><[><1>< ><2><]><}>", val); print ", "; + testglobal = 0; + double_indirect-->0 = dindir1_str; + double_indirect-->1 = counterprint; + double_indirect-->2 = byehello_func; + val = tablenullstring(dindir012_str); + check_str("", val); print ", "; + print "counter="; check(testglobal, 2); print ", "; + testglobal = 0; + double_indirect-->0 = cunistring_str; + double_indirect-->1 = counterprint; + double_indirect-->2 = cstring_str; + val = tablenullstring(dindir012_str); + check_str("", val); print ", "; + print "counter="; check(testglobal, 1); print "^"; + + count_failures(); + ]; + +[ tablenullstring val len; + @setstringtbl encoding_table; + @setiosys 0 0; + len = string_to_array(val, bigbuffer, BIGBUFSIZE); + val = HDR_DECODINGTBL-->0; + @setiosys 2 0; + @setstringtbl val; + return len; +]; + +[ tablenullrstring val len; + @setiosys 0 0; + @setstringtbl encoding_table; + len = string_to_array(val, bigbuffer, BIGBUFSIZE); + val = HDR_DECODINGTBL-->0; + @setstringtbl val; + @setiosys 2 0; + return len; +]; + +TestClass GlkTest + with name 'glk', + testfunc [ val addr strlen; + print "Glk opcode:^^"; + + @copy 'A' sp; + @glk $A0 1 val; + print "lowercase 'A'="; check(val, 'a'); print ", "; + testglobal = 'B'; + @copy testglobal sp; + @glk $A0 1 val; + print "lowercase 'B'="; check(val, 'b'); print ", "; + testglobal = 'C'; + @copy testglobal sp; + val = noop(); + @glk $A0 1 val; + print "lowercase 'C'="; check(val, 'c'); print "^"; + + @copy 'A' sp; + @glk $A0 1 sp; + @copy sp val; + print "lowercase 'A'="; check(val, 'a'); print ", "; + testglobal = 'B'; + @copy testglobal sp; + @glk $A0 1 sp; + @copy sp val; + print "lowercase 'B'="; check(val, 'b'); print ", "; + testglobal = 'C'; + @copy testglobal sp; + val = noop(); + @glk $A0 1 sp; + @copy sp val; + print "lowercase 'C'="; check(val, 'c'); print "^"; + + @copy 'D' sp; + testglobal = 1; + @glk $A0 testglobal val; + print "lowercase 'D'="; check(val, 'd'); print ", "; + @copy 'E' sp; + @copy 1 sp; + @glk $A0 sp val; + print "lowercase 'E'="; check(val, 'e'); print ", "; + @copy 'F' sp; + @copy 1 sp; + val = noop(); + @glk $A0 sp val; + print "lowercase 'F'="; check(val, 'f'); print "^"; + + @copy 'D' sp; + testglobal2 = $A0; + testglobal = 1; + @glk testglobal2 testglobal val; + print "lowercase 'D'="; check(val, 'd'); print ", "; + @copy 'E' sp; + @copy 1 sp; + @copy $A0 sp; + @glk sp sp val; + print "lowercase 'E'="; check(val, 'e'); print ", "; + @copy 'F' sp; + @copy 1 sp; + @copy $A0 sp; + val = noop(); + @glk sp sp val; + print "lowercase 'F'="; check(val, 'f'); print "^"; + + @copy 999 sp; + @copy 'G' sp; + testglobal2 = $A0; + testglobal = 1; + @glk testglobal2 testglobal sp; + @copy sp val; + print "lowercase 'G'="; check(val, 'g'); print ", "; + @copy 'H' sp; + @copy 1 sp; + @copy $A0 sp; + @glk sp sp sp; + @copy sp val; + print "lowercase 'H'="; check(val, 'h'); print ", "; + @copy 'I' sp; + @copy 1 sp; + @copy $A0 sp; + val = noop(); + @glk sp sp sp; + @copy sp val; + print "lowercase 'I'="; check(val, 'i'); print "^"; + @copy sp val; + print "guard="; check(val, 999); print "^"; + + addr = #globals_array + (4 * #g$testglobal); + testglobal = 0; + @copy addr sp; + @copy 0 sp; + @glk $20 2 val; + print "window="; check(val, gg_mainwin); print ", rock="; check(testglobal, GG_MAINWIN_ROCK); print "^"; + + testglobal = 0; + @copy addr sp; + @copy 0 sp; + @copy 2 sp; + @copy $20 sp; + @glk sp sp val; + print "window="; check(val, gg_mainwin); print ", rock="; check(testglobal, GG_MAINWIN_ROCK); print "^"; + + testglobal = 0; + @copy addr sp; + @copy 0 sp; + @copy 2 sp; + @copy $20 sp; + noop(); + @glk sp sp val; + print "window="; check(val, gg_mainwin); print ", rock="; check(testglobal, GG_MAINWIN_ROCK); print "^"; + + testglobal = 0; + @copy (-1) sp; + @copy 0 sp; + @glk $20 2 sp; + @copy sp val; + @copy sp testglobal; + print "window="; check(val, gg_mainwin); print ", rock="; check(testglobal, GG_MAINWIN_ROCK); print "^"; + + gg_arguments-->0 = 1; gg_arguments-->1 = 2; gg_arguments-->2 = 3; gg_arguments-->3 = 4; + @copy gg_arguments sp; + @glk $C1 1 val; + print "select_poll="; check(val, 0); print ", result="; check(gg_arguments-->0, 0); check(gg_arguments-->1, 0); check(gg_arguments-->2, 0); check(gg_arguments-->3, 0); print "^"; + + @copy 999 sp; + @copy (-1) sp; + @glk $C1 1 val; + print "select_poll="; check(val, 0); print ", result="; + @copy sp val; check(val, 0); @copy sp val; check(val, 0); @copy sp val; check(val, 0); @copy sp val; check(val, 0); print "^"; + @copy sp val; + print "guard="; check(val, 999); print "^"; + + strlen = string_to_uniarray("UP-case @{C3}@{E4}@{394}@{3B5}@{414}.", bigubuffer, BIGBUFSIZE); + @copy strlen sp; + @copy BIGBUFSIZE sp; + @copy bigubuffer sp; + @glk $120 3 val; + print "len="; check(val, strlen); print " "; + check_ustr("up-case @{E3}@{E4}@{3B4}@{3B5}@{434}.", val); + + count_failures(); + ]; + +TestClass GiDispaTest + with name 'gidispa' 'dispa', + testfunc [ val; + print "Glk dispatch layer:^^"; + + val = string_to_uniarray(gidispa_testfunc, bigubuffer, BIGBUFSIZE); + check_ustr("XYZ@{42F} C string. C @{DC}n@{EF}co@{3B4}e @{201C}@{30A9}@{201D} 123 @{2155}@{2156}@{2157}.", val); print "^"; + print "length: "; check(val, 37); print "^"; + + count_failures(); + ]; + +Array gidispa_bytebuf -> '1' '2' '3' '4'; +Array gidispa_wordbuf --> $2155 $2156 $2157 $2158; + +[ gidispa_testfunc; + glk($0080, 'X'); ! put_char + glk($0080, 'Y'+$FE00); ! put_char + glk($0128, 'Z'); ! put_char_uni + glk($0128, $042F); ! put_char_uni + print " "; + glk($0082, cstring_str); ! put_string + print " "; + glk($0129, cunistring_str); ! put_string_uni + print " "; + glk($0084, gidispa_bytebuf, 3); ! put_buffer + print " "; + glk($012A, gidispa_wordbuf, 3); ! put_buffer + @streamchar '.'; +]; + +Array histogram --> 16; + +TestClass RandomTest + with name 'random', + testfunc [ val ix hibit lobit; + print "Random-number generator:^"; + print "NOTE: Tests may, very occasionally, fail through sheer bad + luck. If so, try this test again.^^"; + + @setrandom 0; + + for (ix=0 : ix<4 : ix++) { + histogram-->ix = 0; + } + for (ix=0 : ix<240 : ix++) { + @random 4 val; + (histogram-->val)++; + } + print "Random 4: "; + for (ix=0 : ix<4 : ix++) { + print ix, "="; check_range(histogram-->ix, 30, 90); print ", "; + } + print "^"; + + for (ix=0 : ix<5 : ix++) { + histogram-->ix = 0; + } + for (ix=0 : ix<240 : ix++) { + @random (-5) val; + val = -val; + (histogram-->val)++; + } + print "Random -5: "; + for (ix=0 : ix<5 : ix++) { + print ix, "="; check_range(histogram-->ix, 24, 72); print ", "; + } + print "^"; + + for (ix=0 : ix<4 : ix++) { + histogram-->ix = 0; + } + hibit = 0; + lobit = 0; + for (ix=0 : ix<240 : ix++) { + @random 0 val; + if (val < 0) + hibit++; + else + lobit++; + val = val & 3; + (histogram-->val)++; + } + print "Random 0: "; + for (ix=0 : ix<4 : ix++) { + print ix, "="; check_range(histogram-->ix, 30, 90); print ", "; + } + print "lobit="; check_range(lobit, 100, 140); print ", "; + print "hibit="; check_range(hibit, 100, 140); print ", "; + print "^"; + + testglobal = 4; + for (ix=0 : ix<4 : ix++) { + histogram-->ix = 0; + } + for (ix=0 : ix<240 : ix++) { + @random testglobal val; + (histogram-->val)++; + } + print "Random 4 global: "; + for (ix=0 : ix<4 : ix++) { + print ix, "="; check_range(histogram-->ix, 30, 90); print ", "; + } + print "^"; + + testglobal = -5; + for (ix=0 : ix<5 : ix++) { + histogram-->ix = 0; + } + for (ix=0 : ix<240 : ix++) { + @random testglobal val; + val = -val; + (histogram-->val)++; + } + print "Random -5 global: "; + for (ix=0 : ix<5 : ix++) { + print ix, "="; check_range(histogram-->ix, 24, 72); print ", "; + } + print "^"; + + testglobal = 0; + for (ix=0 : ix<4 : ix++) { + histogram-->ix = 0; + } + hibit = 0; + lobit = 0; + for (ix=0 : ix<240 : ix++) { + @random testglobal val; + if (val < 0) + hibit++; + else + lobit++; + val = val & 3; + (histogram-->val)++; + } + print "Random 0 global: "; + for (ix=0 : ix<4 : ix++) { + print ix, "="; check_range(histogram-->ix, 30, 90); print ", "; + } + print "lobit="; check_range(lobit, 100, 140); print ", "; + print "hibit="; check_range(hibit, 100, 140); print ", "; + print "^"; + + hibit = 0; + lobit = $FFFFFFFF; + for (ix=0 : ix<24 : ix++) { + @random 0 val; + hibit = hibit | val; + lobit = lobit & val; + } + print "Accumulated bits: hi="; check(hibit, $FFFFFFFF); print ", "; + print "lo="; check(lobit, 0); print ", "; + print "^"; + + count_failures(); + ]; + +TestClass DRandomTest + with name 'nonrandom' 'detrandom' 'deterministic', + testfunc [ val ix orig0; + print "Random numbers in deterministic mode:^^"; + + @setrandom 1; + for (ix=0 : ix<16 : ix++) { + @random 0 val; + histogram-->ix = val; + } + orig0 = histogram-->0; + @setrandom 1; + print "setrandom 1: "; + for (ix=0 : ix<16 : ix++) { + @random 0 val; + check(val, histogram-->ix); print ", "; + } + print "^"; + + @setrandom 100; + for (ix=0 : ix<16 : ix++) { + @random 0 val; + histogram-->ix = val; + } + @setrandom 100; + print "setrandom 100: "; + for (ix=0 : ix<16 : ix++) { + @random 0 val; + check(val, histogram-->ix); print ", "; + } + print "^"; + val = (orig0 ~= histogram-->0); + print "Sequences different: "; check(val, 1); print "^"; + + count_failures(); + ]; + +Array search_a -> $1 $3 $5 $7 $9 $2 $4 $6 $8 $A $80 $90 $A0 $A1 $30 $31 + $20 $0 $0 $0 $31 $0 $0 $1 $FF $FE $FD $FC $0 $0 $1 $2; +Array search_b -> $1 $3 $5 $7 $9 $B $D $F $20 $21 $28 $2D $2E $2F $30 $31 + $40 $42 $44 $46 $50 $53 $57 $59 $E0 $E1 $E2 $E3 $FC $FD $FE $FF; +Array search_c --> $01030507 0 $080A8090 0 $20000000 0 $FFFEFDFC 0 + $31020406 0 $A0A13031 0 $31000001 0 $00000102 0; + +TestClass SearchTest + with name 'search', + testfunc [ val ix; + print "Search opcodes:^^"; + + if (search_c-->1 == 0) { + search_c-->1 = search_c + 4*14; + search_c-->15 = search_c + 4*2; + search_c-->3 = search_c + 4*12; + search_c-->13 = search_c + 4*4; + search_c-->5 = search_c + 4*10; + search_c-->11 = search_c + 4*6; + search_c-->7 = search_c + 4*8; + } + + print "Linear:^"; + + @linearsearch $A1 1 search_a 1 32 0 0 val; + print "got "; check(val, search_a+13); print ", "; + @linearsearch $A1 1 search_a 1 32 0 4 val; + print "got "; check(val, 13); print ", "; + @linearsearch $A1 1 search_a 1 8 0 0 val; + print "got "; check(val, 0); print ", "; + @linearsearch $A1 1 search_a 1 8 0 4 val; + print "got "; check(val, -1); print "^"; + + @linearsearch $FFA1 1 search_a 1 32 0 0 val; + print "got "; check(val, search_a+13); print ", "; + @linearsearch $FF8097A1 1 search_a 1 32 0 4 val; + print "got "; check(val, 13); print "^"; + + @push 999; + @push 0; @push 0; @push 32; @push 1; @push search_a; @push 1; @push $31; + @linearsearch sp sp sp sp sp sp sp val; + print "got "; check(val, search_a+15); print ", "; + @push 4; @push 0; @push 32; @push 1; @push search_a; @push 1; @push $31; + @linearsearch sp sp sp sp sp sp sp sp; + @copy sp val; + print "got "; check(val, 15); print ", "; + @copy sp val; + print "guard="; check(val, 999); print "^"; + + destarray->0 = $A1; + @linearsearch destarray 1 search_a 1 32 0 1 val; + print "got "; check(val, search_a+13); print ", "; + @linearsearch destarray 1 search_a 1 32 0 5 val; + print "got "; check(val, 13); print ", "; + @linearsearch destarray 1 search_a 1 8 0 1 val; + print "got "; check(val, 0); print ", "; + @linearsearch destarray 1 search_a 1 8 0 5 val; + print "got "; check(val, -1); print "^"; + + @linearsearch $FC 1 search_a 1 32 0 2 val; + print "got "; check(val, 0); print ", "; + @linearsearch $FC 1 search_a 1 32 0 6 val; + print "got "; check(val, -1); print ", "; + @linearsearch $00 1 search_a 1 32 0 2 val; + print "got "; check(val, search_a+17); print ", "; + @linearsearch $00 1 search_a 1 32 0 6 val; + print "got "; check(val, 17); print "^"; + + @linearsearch $FC 1 search_a 1 (-1) 0 2 val; + print "got "; check(val, 0); print ", "; + @linearsearch $FC 1 search_a 1 (-1) 0 6 val; + print "got "; check(val, -1); print ", "; + @linearsearch $80 1 search_a 1 (-1) 0 2 val; + print "got "; check(val, search_a+10); print ", "; + @linearsearch $80 1 search_a 1 (-1) 0 6 val; + print "got "; check(val, 10); print "^"; + + @linearsearch $A0A1 2 search_a 2 16 0 0 val; + print "got "; check(val, search_a+12); print ", "; + @linearsearch $A0A1 2 search_a 2 16 0 4 val; + print "got "; check(val, 6); print ", "; + @linearsearch $FFFFA0A1 2 search_a 2 16 0 4 val; + print "got "; check(val, 6); print ", "; + @linearsearch $A0A2 2 search_a 2 16 0 4 val; + print "got "; check(val, -1); print ", "; + @linearsearch $A130 2 search_a 4 8 1 0 val; + print "got "; check(val, search_a+12); print ", "; + @linearsearch $FEFDA130 2 search_a 4 8 1 4 val; + print "got "; check(val, 3); print "^"; + + destarray->0 = $A0; + destarray->1 = $A1; + @linearsearch destarray 2 search_a 2 16 0 1 val; + print "got "; check(val, search_a+12); print ", "; + @linearsearch destarray 2 search_a 2 16 0 5 val; + print "got "; check(val, 6); print ", "; + destarray->0 = $A1; + destarray->1 = $30; + @linearsearch destarray 2 search_a 4 8 1 1 val; + print "got "; check(val, search_a+12); print ", "; + @linearsearch destarray 2 search_a 4 8 1 5 val; + print "got "; check(val, 3); print "^"; + + @linearsearch $FEFD 2 search_a 4 8 1 0 val; + print "got "; check(val, search_a+24); print ", "; + @linearsearch $FEFD 2 search_a 4 8 1 4 val; + print "got "; check(val, 6); print ", "; + @linearsearch $FEFD 2 search_a 4 8 1 2 val; + print "got "; check(val, 0); print ", "; + @linearsearch $FEFD 2 search_a 4 8 1 6 val; + print "got "; check(val, -1); print "^"; + + @linearsearch $09020406 4 search_a 4 8 0 0 val; + print "got "; check(val, search_a+4); print ", "; + @linearsearch $09020406 4 search_a 4 8 0 4 val; + print "got "; check(val, 1); print ", "; + @linearsearch $09020409 4 search_a 4 8 0 0 val; + print "got "; check(val, 0); print ", "; + @linearsearch $09020409 4 search_a 4 8 0 4 val; + print "got "; check(val, -1); print "^"; + + histogram-->0 = $080A8090; + @linearsearch histogram 4 search_a 4 8 0 1 val; + print "got "; check(val, search_a+8); print ", "; + @linearsearch histogram 4 search_a 4 8 0 5 val; + print "got "; check(val, 2); print ", "; + histogram-->0 = $080A8000; + @linearsearch histogram 4 search_a 4 8 0 1 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $000A8090; + @linearsearch histogram 4 search_a 4 8 0 5 val; + print "got "; check(val, -1); print "^"; + + @linearsearch $FDFC0000 4 search_a 5 6 1 0 val; + print "got "; check(val, search_a+25); print ", "; + @linearsearch $FDFC0000 4 search_a 5 6 1 4 val; + print "got "; check(val, 5); print ", "; + histogram-->0 = $FDFC0000; + @linearsearch histogram 4 search_a 5 6 1 1 val; + print "got "; check(val, search_a+25); print ", "; + @linearsearch histogram 4 search_a 5 6 1 5 val; + print "got "; check(val, 5); print "^"; + + histogram-->0 = $FEFDFC00; + histogram-->1 = $00019999; + @linearsearch histogram 6 search_a 8 4 1 1 val; + print "got "; check(val, search_a+24); print ", "; + @linearsearch histogram 6 search_a 8 4 1 5 val; + print "got "; check(val, 3); print ", "; + @linearsearch histogram 8 search_a 8 4 1 1 val; + print "got "; check(val, 0); print ", "; + @linearsearch histogram 8 search_a 8 4 1 5 val; + print "got "; check(val, -1); print ", "; + histogram-->0 = $FEFDFC00; + histogram-->1 = $00020000; + @linearsearch histogram 6 search_a 8 4 1 1 val; + print "got "; check(val, 0); print ", "; + @linearsearch histogram 6 search_a 8 4 1 5 val; + print "got "; check(val, -1); print ", "; + histogram-->0 = $0EFDFC00; + histogram-->1 = $00010000; + @linearsearch histogram 6 search_a 8 4 1 1 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $FEFDFC01; + histogram-->1 = $00010000; + @linearsearch histogram 6 search_a 8 4 1 5 val; + print "got "; check(val, -1); print "^"; + + histogram-->0 = $01030507; + histogram-->1 = $09020406; + @linearsearch histogram 8 search_a 16 2 0 1 val; + print "got "; check(val, search_a+0); print ", "; + @linearsearch histogram 8 search_a 16 2 0 5 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $080A8090; + histogram-->1 = $A0A13031; + @linearsearch histogram 8 search_a 16 2 0 1 val; + print "got "; check(val, 0); print ", "; + @linearsearch histogram 8 search_a 16 2 0 5 val; + print "got "; check(val, -1); print ", "; + @linearsearch histogram 8 search_a 16 2 8 1 val; + print "got "; check(val, search_a+0); print ", "; + @linearsearch histogram 8 search_a 16 2 8 5 val; + print "got "; check(val, 0); print "^"; + + print "Binary:^"; + + @binarysearch $2F 1 search_b 1 32 0 0 val; + print "got "; check(val, search_b+13); print ", "; + @binarysearch $2F 1 search_b 1 32 0 4 val; + print "got "; check(val, 13); print ", "; + @binarysearch $2F 1 search_b 1 8 0 0 val; + print "got "; check(val, 0); print ", "; + @binarysearch $2F 1 search_b 1 8 0 4 val; + print "got "; check(val, -1); print "^"; + + @binarysearch $FF2F 1 search_b 1 32 0 0 val; + print "got "; check(val, search_b+13); print ", "; + @binarysearch $FF80972F 1 search_b 1 32 0 4 val; + print "got "; check(val, 13); print "^"; + + @push 999; + @push 0; @push 0; @push 32; @push 1; @push search_b; @push 1; @push $31; + @binarysearch sp sp sp sp sp sp sp val; + print "got "; check(val, search_b+15); print ", "; + @push 4; @push 0; @push 32; @push 1; @push search_b; @push 1; @push $31; + @binarysearch sp sp sp sp sp sp sp sp; + @copy sp val; + print "got "; check(val, 15); print ", "; + @copy sp val; + print "guard="; check(val, 999); print "^"; + + print "got "; + for (ix=0 : ix<32 : ix++) { + val = search_b->ix; + @binarysearch val 1 search_b 1 32 0 0 val; + check(val, search_b+ix); print ", "; + } + print "^"; + print "got "; + for (ix=0 : ix<31 : ix++) { + val = search_b->ix; + @binarysearch val 1 search_b 1 31 0 0 val; + check(val, search_b+ix); print ", "; + } + print "^"; + + destarray->0 = $2F; + @binarysearch destarray 1 search_b 1 32 0 1 val; + print "got "; check(val, search_b+13); print ", "; + @binarysearch destarray 1 search_b 1 32 0 5 val; + print "got "; check(val, 13); print ", "; + @binarysearch destarray 1 search_b 1 8 0 1 val; + print "got "; check(val, 0); print ", "; + @binarysearch destarray 1 search_b 1 8 0 5 val; + print "got "; check(val, -1); print "^"; + + @binarysearch $2E2F 2 search_b 2 16 0 0 val; + print "got "; check(val, search_b+12); print ", "; + @binarysearch $2E2F 2 search_b 2 16 0 4 val; + print "got "; check(val, 6); print ", "; + @binarysearch $FFFF2E2F 2 search_b 2 16 0 4 val; + print "got "; check(val, 6); print ", "; + @binarysearch $2E2E 2 search_b 2 16 0 4 val; + print "got "; check(val, -1); print ", "; + @binarysearch $2F30 2 search_b 4 8 1 0 val; + print "got "; check(val, search_b+12); print ", "; + @binarysearch $FEFD2F30 2 search_b 4 8 1 4 val; + print "got "; check(val, 3); print "^"; + + destarray->0 = $2E; + destarray->1 = $2F; + @binarysearch destarray 2 search_b 2 16 0 1 val; + print "got "; check(val, search_b+12); print ", "; + @binarysearch destarray 2 search_b 2 16 0 5 val; + print "got "; check(val, 6); print ", "; + destarray->0 = $2F; + destarray->1 = $30; + @binarysearch destarray 2 search_b 4 8 1 1 val; + print "got "; check(val, search_b+12); print ", "; + @binarysearch destarray 2 search_b 4 8 1 5 val; + print "got "; check(val, 3); print "^"; + + @binarysearch $E1E2 2 search_b 4 8 1 0 val; + print "got "; check(val, search_b+24); print ", "; + @binarysearch $E1E2 2 search_b 4 8 1 4 val; + print "got "; check(val, 6); print "^"; + + @binarysearch $090B0D0F 4 search_b 4 8 0 0 val; + print "got "; check(val, search_b+4); print ", "; + @binarysearch $090B0D0F 4 search_b 4 8 0 4 val; + print "got "; check(val, 1); print ", "; + @binarysearch $090B0D0E 4 search_b 4 8 0 0 val; + print "got "; check(val, 0); print ", "; + @binarysearch $090B0D0E 4 search_b 4 8 0 4 val; + print "got "; check(val, -1); print "^"; + + histogram-->0 = $2021282D; + @binarysearch histogram 4 search_b 4 8 0 1 val; + print "got "; check(val, search_b+8); print ", "; + @binarysearch histogram 4 search_b 4 8 0 5 val; + print "got "; check(val, 2); print ", "; + histogram-->0 = $20212800; + @binarysearch histogram 4 search_b 4 8 0 1 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $0021282D; + @binarysearch histogram 4 search_b 4 8 0 5 val; + print "got "; check(val, -1); print "^"; + + @binarysearch $E2E3FCFD 4 search_b 5 6 1 0 val; + print "got "; check(val, search_b+25); print ", "; + @binarysearch $E2E3FCFD 4 search_b 5 6 1 4 val; + print "got "; check(val, 5); print ", "; + histogram-->0 = $E2E3FCFD; + @binarysearch histogram 4 search_b 5 6 1 1 val; + print "got "; check(val, search_b+25); print ", "; + @binarysearch histogram 4 search_b 5 6 1 5 val; + print "got "; check(val, 5); print "^"; + + histogram-->0 = $E1E2E3FC; + histogram-->1 = $FDFE9999; + @binarysearch histogram 6 search_b 8 4 1 1 val; + print "got "; check(val, search_b+24); print ", "; + @binarysearch histogram 6 search_b 8 4 1 5 val; + print "got "; check(val, 3); print ", "; + @binarysearch histogram 8 search_b 8 4 1 1 val; + print "got "; check(val, 0); print ", "; + @binarysearch histogram 8 search_b 8 4 1 5 val; + print "got "; check(val, -1); print ", "; + histogram-->0 = $E1E2E3FC; + histogram-->1 = $FDFD0000; + @binarysearch histogram 6 search_b 8 4 1 1 val; + print "got "; check(val, 0); print ", "; + @binarysearch histogram 6 search_b 8 4 1 5 val; + print "got "; check(val, -1); print ", "; + histogram-->0 = $01E2E3FC; + histogram-->1 = $FDFE0000; + @binarysearch histogram 6 search_b 8 4 1 1 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $FEFDFC01; + histogram-->1 = $FDFE0000; + @binarysearch histogram 6 search_b 8 4 1 5 val; + print "got "; check(val, -1); print "^"; + + histogram-->0 = $01030507; + histogram-->1 = $090B0D0F; + @binarysearch histogram 8 search_b 16 2 0 1 val; + print "got "; check(val, search_b+0); print ", "; + @binarysearch histogram 8 search_b 16 2 0 5 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $2021282D; + histogram-->1 = $2E2F3031; + @binarysearch histogram 8 search_b 16 2 0 1 val; + print "got "; check(val, 0); print ", "; + @binarysearch histogram 8 search_b 16 2 0 5 val; + print "got "; check(val, -1); print ", "; + @binarysearch histogram 8 search_b 16 2 8 1 val; + print "got "; check(val, search_b+0); print ", "; + @binarysearch histogram 8 search_b 16 2 8 5 val; + print "got "; check(val, 0); print "^"; + + print "Linked:^"; + + @linkedsearch $01 1 search_c 0 4 0 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $FFFFFFFF01 1 search_c 0 4 0 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $31 1 search_c 0 4 0 val; + print "got "; check(val, search_c+6*8); print ", "; + @linkedsearch $00 1 search_c 0 4 0 val; + print "got "; check(val, search_c+7*8); print ", "; + @linkedsearch $08 1 search_c 0 4 0 val; + print "got "; check(val, search_c+1*8); print ", "; + @linkedsearch $A1 1 search_c 0 4 0 val; + print "got "; check(val, 0); print "^"; + + @linkedsearch $01 1 search_c 0 4 2 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $31 1 search_c 0 4 2 val; + print "got "; check(val, 0); print ", "; + @linkedsearch $00 1 search_c 0 4 2 val; + print "got "; check(val, search_c+7*8); print ", "; + @linkedsearch $08 1 search_c 0 4 2 val; + print "got "; check(val, 0); print ", "; + @linkedsearch $A1 1 search_c 0 4 2 val; + print "got "; check(val, 0); print "^"; + + @linkedsearch $0103 2 search_c 0 4 0 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $FFFF0103 2 search_c 0 4 0 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $3100 2 search_c 0 4 0 val; + print "got "; check(val, search_c+6*8); print ", "; + @linkedsearch $0000 2 search_c 0 4 0 val; + print "got "; check(val, search_c+7*8); print ", "; + @linkedsearch $080A 2 search_c 0 4 0 val; + print "got "; check(val, search_c+1*8); print ", "; + @linkedsearch $A130 2 search_c 0 4 0 val; + print "got "; check(val, 0); print ", "; + @linkedsearch $0104 2 search_c 0 4 0 val; + print "got "; check(val, 0); print ", "; + @linkedsearch $0203 2 search_c 0 4 0 val; + print "got "; check(val, 0); print "^"; + + @linkedsearch $0103 2 search_c 0 4 2 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $3100 2 search_c 0 4 2 val; + print "got "; check(val, 0); print ", "; + @linkedsearch $0000 2 search_c 0 4 2 val; + print "got "; check(val, search_c+7*8); print ", "; + @linkedsearch $080A 2 search_c 0 4 2 val; + print "got "; check(val, 0); print ", "; + @linkedsearch $A130 2 search_c 0 4 2 val; + print "got "; check(val, 0); print "^"; + + @linkedsearch $0305 2 search_c 1 4 0 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $0001 2 search_c 1 4 0 val; + print "got "; check(val, search_c+7*8); print ", "; + @linkedsearch $0000 2 search_c 1 4 0 val; + print "got "; check(val, search_c+6*8); print ", "; + @linkedsearch $FEFD 2 search_c 1 4 0 val; + print "got "; check(val, search_c+3*8); print ", "; + @linkedsearch $0103 2 search_c 1 4 0 val; + print "got "; check(val, 0); print "^"; + + @linkedsearch $0305 2 search_c 1 4 2 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $0001 2 search_c 1 4 2 val; + print "got "; check(val, search_c+7*8); print ", "; + @linkedsearch $0000 2 search_c 1 4 2 val; + print "got "; check(val, search_c+6*8); print ", "; + @linkedsearch $FEFD 2 search_c 1 4 2 val; + print "got "; check(val, 0); print ", "; + @linkedsearch $0103 2 search_c 1 4 2 val; + print "got "; check(val, 0); print "^"; + + @linkedsearch $01030507 4 search_c 0 4 0 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $31000001 4 search_c 0 4 0 val; + print "got "; check(val, search_c+6*8); print ", "; + @linkedsearch $00000102 4 search_c 0 4 0 val; + print "got "; check(val, search_c+7*8); print ", "; + @linkedsearch $080A8090 4 search_c 0 4 0 val; + print "got "; check(val, search_c+1*8); print ", "; + @linkedsearch $A0A23031 4 search_c 0 4 0 val; + print "got "; check(val, 0); print "^"; + + @linkedsearch $01030507 4 search_c 0 4 2 val; + print "got "; check(val, search_c+0); print ", "; + @linkedsearch $31000001 4 search_c 0 4 2 val; + print "got "; check(val, search_c+6*8); print ", "; + @linkedsearch $00000102 4 search_c 0 4 2 val; + print "got "; check(val, search_c+7*8); print ", "; + @linkedsearch $080A8090 4 search_c 0 4 2 val; + print "got "; check(val, search_c+1*8); print ", "; + @linkedsearch $A0A23031 4 search_c 0 4 2 val; + print "got "; check(val, 0); print "^"; + + histogram-->0 = $01000000; + @linkedsearch histogram 1 search_c 0 4 1 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $01FFFFFF; + @linkedsearch histogram 1 search_c 0 4 1 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $31000000; + @linkedsearch histogram 1 search_c 0 4 1 val; + print "got "; check(val, search_c+6*8); print ", "; + histogram-->0 = $00000000; + @linkedsearch histogram 1 search_c 0 4 1 val; + print "got "; check(val, search_c+7*8); print ", "; + histogram-->0 = $08000000; + @linkedsearch histogram 1 search_c 0 4 1 val; + print "got "; check(val, search_c+1*8); print ", "; + histogram-->0 = $A1000000; + @linkedsearch histogram 1 search_c 0 4 1 val; + print "got "; check(val, 0); print "^"; + + histogram-->0 = $01000000; + @linkedsearch histogram 1 search_c 0 4 3 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $31000000; + @linkedsearch histogram 1 search_c 0 4 3 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $00000000; + @linkedsearch histogram 1 search_c 0 4 3 val; + print "got "; check(val, search_c+7*8); print ", "; + histogram-->0 = $08000000; + @linkedsearch histogram 1 search_c 0 4 3 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $A1000000; + @linkedsearch histogram 1 search_c 0 4 3 val; + print "got "; check(val, 0); print "^"; + + histogram-->0 = $01030000; + @linkedsearch histogram 2 search_c 0 4 1 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $0103FFFF; + @linkedsearch histogram 2 search_c 0 4 1 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $31000000; + @linkedsearch histogram 2 search_c 0 4 1 val; + print "got "; check(val, search_c+6*8); print ", "; + histogram-->0 = $00000000; + @linkedsearch histogram 2 search_c 0 4 1 val; + print "got "; check(val, search_c+7*8); print ", "; + histogram-->0 = $080A0000; + @linkedsearch histogram 2 search_c 0 4 1 val; + print "got "; check(val, search_c+1*8); print ", "; + histogram-->0 = $A1300000; + @linkedsearch histogram 2 search_c 0 4 1 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $01040000; + @linkedsearch histogram 2 search_c 0 4 1 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $02030000; + @linkedsearch histogram 2 search_c 0 4 1 val; + print "got "; check(val, 0); print "^"; + + histogram-->0 = $01030000; + @linkedsearch histogram 2 search_c 0 4 3 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $31000000; + @linkedsearch histogram 2 search_c 0 4 3 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $00000000; + @linkedsearch histogram 2 search_c 0 4 3 val; + print "got "; check(val, search_c+7*8); print ", "; + histogram-->0 = $080A0000; + @linkedsearch histogram 2 search_c 0 4 3 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $A1300000; + @linkedsearch histogram 2 search_c 0 4 3 val; + print "got "; check(val, 0); print "^"; + + histogram-->0 = $03050000; + @linkedsearch histogram 2 search_c 1 4 1 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $00010000; + @linkedsearch histogram 2 search_c 1 4 1 val; + print "got "; check(val, search_c+7*8); print ", "; + histogram-->0 = $00000000; + @linkedsearch histogram 2 search_c 1 4 1 val; + print "got "; check(val, search_c+6*8); print ", "; + histogram-->0 = $FEFD0000; + @linkedsearch histogram 2 search_c 1 4 1 val; + print "got "; check(val, search_c+3*8); print ", "; + histogram-->0 = $01030000; + @linkedsearch histogram 2 search_c 1 4 1 val; + print "got "; check(val, 0); print "^"; + + histogram-->0 = $03050000; + @linkedsearch histogram 2 search_c 1 4 3 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $00010000; + @linkedsearch histogram 2 search_c 1 4 3 val; + print "got "; check(val, search_c+7*8); print ", "; + histogram-->0 = $00000000; + @linkedsearch histogram 2 search_c 1 4 3 val; + print "got "; check(val, search_c+6*8); print ", "; + histogram-->0 = $FEFD0000; + @linkedsearch histogram 2 search_c 1 4 3 val; + print "got "; check(val, 0); print ", "; + histogram-->0 = $01030000; + @linkedsearch histogram 2 search_c 1 4 3 val; + print "got "; check(val, 0); print "^"; + + histogram-->0 = $01030507; + @linkedsearch histogram 4 search_c 0 4 1 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $31000001; + @linkedsearch histogram 4 search_c 0 4 1 val; + print "got "; check(val, search_c+6*8); print ", "; + histogram-->0 = $00000102; + @linkedsearch histogram 4 search_c 0 4 1 val; + print "got "; check(val, search_c+7*8); print ", "; + histogram-->0 = $080A8090; + @linkedsearch histogram 4 search_c 0 4 1 val; + print "got "; check(val, search_c+1*8); print ", "; + histogram-->0 = $A0A23031; + @linkedsearch histogram 4 search_c 0 4 1 val; + print "got "; check(val, 0); print "^"; + + histogram-->0 = $01030507; + @linkedsearch histogram 4 search_c 0 4 3 val; + print "got "; check(val, search_c+0); print ", "; + histogram-->0 = $31000001; + @linkedsearch histogram 4 search_c 0 4 3 val; + print "got "; check(val, search_c+6*8); print ", "; + histogram-->0 = $00000102; + @linkedsearch histogram 4 search_c 0 4 3 val; + print "got "; check(val, search_c+7*8); print ", "; + histogram-->0 = $080A8090; + @linkedsearch histogram 4 search_c 0 4 3 val; + print "got "; check(val, search_c+1*8); print ", "; + histogram-->0 = $A0A23031; + @linkedsearch histogram 4 search_c 0 4 3 val; + print "got "; check(val, 0); print "^"; + + @push 999; + @push 0; @push 4; @push 0; @push search_c; @push 1; @push $31; + @linkedsearch sp sp sp sp sp sp val; + print "got "; check(val, search_c+6*8); print ", "; + @push 0; @push 4; @push 0; @push search_c; @push 1; @push $08; + @linkedsearch sp sp sp sp sp sp sp; + @copy sp val; + print "got "; check(val, search_c+1*8); print ", "; + @copy sp val; + print "guard="; check(val, 999); print "^"; + + count_failures(); + ]; + +[ fill_array_seq arr ix val; + for (ix=0 : ix<12 : ix++) { + val = ix+1; + @astoreb arr ix val; + } +]; + +[ fill_array_val arr val ix; + for (ix=0 : ix<12 : ix++) { + @astoreb arr ix val; + } +]; + +TestClass MemZeroTest + with name 'mzero' 'memzero', + testfunc [ addr val; + print "mzero opcode:^^"; + + @gestalt 6 0 val; ! MemCopy + if (~~val) { + print "This interpreter does not support @@64mzero.^"; + count_failures(); + return; + } + + fill_array_seq(destarray); + addr = destarray+4; + @mzero 0 addr; + print "0, arr+4: "; + check_bytelist(destarray, 1,2,3,4,5,6,7,8,9,10,11,12); print "^"; + + fill_array_seq(destarray); + addr = destarray+4; + @mzero 1 addr; + print "1, arr+4: "; + check_bytelist(destarray, 1,2,3,4,0,6,7,8,9,10,11,12); print "^"; + + fill_array_seq(destarray); + testglobal = destarray; + @mzero 6 testglobal; + print "6, arr+0: "; + check_bytelist(destarray, 0,0,0,0,0,0,7,8,9,10,11,12); print "^"; + + fill_array_seq(destarray); + addr = destarray+2; + @copy addr sp; + @copy 3 sp; + @mzero sp sp; + print "3, arr+2: "; + check_bytelist(destarray, 1,2,0,0,0,6,7,8,9,10,11,12); print "^"; + + fill_array_seq(destarray); + addr = destarray+3; + @copy addr sp; + @copy 4 sp; + noop(); + @mzero sp sp; + print "4, arr+3: "; + check_bytelist(destarray, 1,2,3,0,0,0,0,8,9,10,11,12); print "^"; + + count_failures(); + ]; + +TestClass MemCopyTest + with name 'mcopy' 'memcopy', + testfunc [ addr addr2 val; + print "mcopy opcode:^^"; + + @gestalt 6 0 val; ! MemCopy + if (~~val) { + print "This interpreter does not support @@64mcopy.^"; + count_failures(); + return; + } + + fill_array_seq(destarray); + addr = destarray+4; + addr2 = destarray+6; + @mcopy 0 addr addr2; + print "0, arr+4, arr+6: "; + check_bytelist(destarray, 1,2,3,4,5,6,7,8,9,10,11,12); print "^"; + + fill_array_seq(destarray); + addr = destarray+8; + addr2 = destarray+6; + @mcopy 0 addr addr2; + print "0, arr+8, arr+6: "; + check_bytelist(destarray, 1,2,3,4,5,6,7,8,9,10,11,12); print "^"; + + fill_array_seq(destarray); + addr = destarray+4; + addr2 = destarray+4; + @mcopy 4 addr addr2; + print "4, arr+4, arr+4: "; + check_bytelist(destarray, 1,2,3,4,5,6,7,8,9,10,11,12); print "^"; + + fill_array_seq(destarray); + addr = destarray+4; + addr2 = destarray+6; + @mcopy 5 addr addr2; + print "5, arr+4, arr+6: "; + check_bytelist(destarray, 1,2,3,4,5,6,5,6,7,8,9,12); print "^"; + + fill_array_seq(destarray); + addr = destarray+6; + addr2 = destarray+4; + @mcopy 5 addr addr2; + print "5, arr+6, arr+4: "; + check_bytelist(destarray, 1,2,3,4,7,8,9,10,11,10,11,12); print "^"; + + fill_array_seq(destarray); + testglobal = destarray+1; + testglobal2 = destarray+8; + @mcopy 3 testglobal testglobal2; + print "3, arr+1, arr+8: "; + check_bytelist(destarray, 1,2,3,4,5,6,7,8,2,3,4,12); print "^"; + + fill_array_seq(destarray); + val = destarray+1; + @copy val sp; + val = destarray+8; + @copy val sp; + @copy 3 sp; + @mcopy sp sp sp; + print "3, arr+8, arr+1: "; + check_bytelist(destarray, 1,9,10,11,5,6,7,8,9,10,11,12); print "^"; + + fill_array_seq(destarray); + val = destarray+1; + @copy val sp; + val = destarray+8; + @copy val sp; + @copy 2 sp; + noop(); + @mcopy sp sp sp; + print "2, arr+8, arr+1: "; + check_bytelist(destarray, 1,9,10,4,5,6,7,8,9,10,11,12); print "^"; + + count_failures(); + ]; + +TestClass UndoTest + with name 'undo', + testfunc [ val loc; + print "Undo:^^"; + + @gestalt 3 0 val; ! Undo + if (val) + print "Interpreter claims to support undo.^^"; + else + print "Interpreter claims to not support undo. (Continuing test anyway...)^^"; + + @restoreundo val; + print "Restore without saveundo: "; check(val, 1); print "^"; + + testglobal = 0; + @restoreundo testglobal; + print "Restore without saveundo: "; check(testglobal, 1); print "^"; + + val = 0; + @restoreundo sp; + @copy sp val; + print "Restore without saveundo: "; check(val, 1); print "^"; + + loc = 99; + testglobal = 999; + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + loc = 77; + testglobal = 777; + failures++; + print "Restoring undo...^"; + @restoreundo val; + if (val == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + print "loc="; check(loc, 99); print " glob="; check(testglobal, 999); print "^"; + + loc = 98; + testglobal = 998; + @saveundo testglobal2; + if (testglobal2 == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (testglobal2 == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + loc = 77; + testglobal = 777; + failures++; + print "Restoring undo...^"; + @restoreundo testglobal2; + if (testglobal2 == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", testglobal2, "^"; + } + failures++; + count_failures(); + return; + } + else if (testglobal2 ~= -1) { + print "Unknown @@64saveundo return value: ", testglobal2, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(testglobal2, -1); print ".^"; + print "loc="; check(loc, 98); print " glob="; check(testglobal, 998); print "^"; + + loc = 97; + testglobal = 997; + val = undo_depth_check(); + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + loc = 77; + testglobal = 777; + failures++; + print "Restoring undo...^"; + @restoreundo val; + if (val == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + print "loc="; check(loc, 97); print " glob="; check(testglobal, 997); print "^"; + + + loc = 98; + testglobal = 998; + testglobal2 = -99; + @saveundo sp; + @pull testglobal2; + if (testglobal2 == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (testglobal2 == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + loc = 77; + testglobal = 777; + testglobal2 = -99; + failures++; + print "Restoring undo...^"; + @restoreundo sp; + @pull testglobal2; + if (testglobal2 == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", testglobal2, "^"; + } + failures++; + count_failures(); + return; + } + else if (testglobal2 ~= -1) { + print "Unknown @@64saveundo return value: ", testglobal2, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(testglobal2, -1); print ".^"; + print "loc="; check(loc, 98); print " glob="; check(testglobal, 998); print "^"; + + @push 9; + loc = 99; + testglobal = 999; + testglobal2 = -999; + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + loc = 77; + testglobal = 777; + testglobal2 = -777; + @pull val; + print "guard="; check(val, 9); print "^"; + val = 7; + failures++; + print "Restoring undo...^"; + @restoreundo testglobal2; + if (testglobal2 == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", testglobal2, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + print "loc="; check(loc, 99); print " glob="; check(testglobal, 999); print " glob2="; check(testglobal2, -999); print "^"; + + @pull val; + print "guard="; check(val, 9); print "^"; + + count_failures(); + ]; + +[ undo_depth_check; + return undo_depth_check2(11, 22, 33); +]; + +[ undo_depth_check2 foo bar baz val; + bar = 1; + foo = bar; + baz = foo; + @saveundo val; + return val; +]; + +TestClass MultiUndoTest + with name 'multiundo', + testfunc [ val loc; + print "Multi-level undo:^^"; + + @gestalt 3 0 val; ! Undo + if (val) + print "Interpreter claims to support undo.^^"; + else + print "Interpreter claims to not support undo. (Continuing test anyway...)^^"; + + loc = 99; + testglobal = 999; + @saveundo val; + if (val == 1) { + print "First @@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo 1 saved...^"; + ! The following changes will be undone. + loc = 77; + testglobal = 777; + failures++; + + @saveundo val; + if (val == 1) { + print "Second @@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo 2 saved...^"; + ! The following changes will be undone. + loc = 55; + testglobal = 555; + failures++; + + print "Restoring undo 2...^"; + @restoreundo val; + if (val == 1) { + print "Second @@64restoreundo failed (value 1)!^"; + } + else { + print "Second @@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + + print "Undo 2 succeeded, return value "; check(val, -1); print ".^"; + print "loc="; check(loc, 77); print " glob="; check(testglobal, 777); print "^"; + + print "Restoring undo 1...^"; + @restoreundo val; + if (val == 1) { + print "First @@64restoreundo failed (value 1)!^"; + } + else { + print "First @@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo 1 succeeded, return value "; check(val, -1); print ".^"; + print "loc="; check(loc, 99); print " glob="; check(testglobal, 999); print "^"; + + count_failures(); + ]; + +! @hasundo/@discardundo are not yet supported by either Inform or interpreters. So this test is commented out for now. +#iftrue 0; + +TestClass ExtUndoTest + with name 'extundo', + testfunc [ val loc; + print "ExtUndo:^^"; + + @gestalt 12 0 val; ! ExtUndo + if (~~val) { + print "Interpreter claims to not support extended undo. Skipping test.^^"; + count_failures(); + return; + } + + @protect destarray 4; + + destarray->0 = 0; + destarray->1 = 0; ! protected failures + + print "No undo states: "; + @hasundo val; + print "val="; check(val, 1); + @hasundo testglobal; + print " testglobal="; check(testglobal, 1); print "^"; + + destarray->0 = destarray->0 + 1; + print "counter="; check(destarray->0, 1); print "^"; + + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + else if (val == 0) { + print "Undo saved...^"; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + else { + print "@@64saveundo restored when it should have been discarded.^"; + failures++; + count_failures(); + return; + } + + @hasundo val; + print "val="; check(val, 0); + @hasundo testglobal; + print " testglobal="; check(testglobal, 0); print "^"; + + destarray->0 = destarray->0 + 1; + print "counter="; check(destarray->0, 2); print "^"; + + @discardundo; + print "Undo discarded...^"; + + @hasundo val; + print "val="; check(val, 1); + @hasundo testglobal; + print " testglobal="; check(testglobal, 1); print "^"; + + destarray->0 = destarray->0 + 1; + print "counter="; check(destarray->0, 3); print "^"; + + print "^"; + + loc = 99; + testglobal = 999; + @saveundo val; + if (val == 1) { + print "First @@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo 1 saved...^"; + ! The following changes will be undone. + loc = 77; + testglobal = 777; + + destarray->0 = destarray->0 + 1; + print "counter="; check(destarray->0, 4); print "^"; + + @saveundo val; + if (val == 1) { + print "Second @@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo 2 saved...^"; + ! The following changes will NOT be undone. + loc = 55; + testglobal = 555; + + destarray->0 = destarray->0 + 1; + print "counter="; check(destarray->0, 5); print "^"; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + + print "loc="; check(loc, 55); print " glob="; check(testglobal, 555); print "^"; + + @discardundo; + print "Undo 2 discarded...^"; + + destarray->0 = destarray->0 + 1; + print "counter="; check(destarray->0, 6); print "^"; + + @hasundo val; + print "val="; check(val, 0); + @hasundo testglobal2; + print " testglobal="; check(testglobal2, 0); print "^"; + + if (failures) + destarray->1 = destarray->1 + 1; + + print "Restoring undo 1...^"; + @restoreundo val; + if (val == 1) { + print "First @@64restoreundo failed (value 1)!^"; + } + else { + print "First @@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo 1 succeeded, return value "; check(val, -1); print ".^"; + print "loc="; check(loc, 99); print " glob="; check(testglobal, 999); print "^"; + + destarray->0 = destarray->0 + 1; + print "counter="; check(destarray->0, 7); print "^"; + + @protect 0 0; + + print "^"; + + print "End of test: "; + @hasundo val; + print "val="; check(val, 1); + @hasundo testglobal; + print " testglobal="; check(testglobal, 1); print "^"; + print "Protected failures="; check(destarray->1, 0); print "^"; + + count_failures(); + ]; + +#endif; ! @hasundo/@discardundo + +TestClass RestoreTest + with name 'restore', + testfunc [ res loc1 loc2; + print "Restore:^^"; + + if (gg_savefref) { + print "gg_savefref already existed!^"; + failures++; + count_failures(); + return; + } + + gg_savefref = glk($0060, 1, GG_SAVEFREF_ROCK); ! fileref_create_temp + if (~~gg_savefref) { + print "Unable to create fileref!^"; + failures++; + jump cleanup; + } + delete_if_exists(gg_savefref); + + print "Simple restore.^"; + loc1 = 111; + loc2 = 222; + testglobal = 333; + + gg_savestr = glk($0042, gg_savefref, $01, GG_SAVESTR_ROCK); ! stream_open_file + if (~~gg_savestr) { + print "Unable to open stream!^"; + failures++; + jump cleanup; + } + + print "Saving...^"; + @save gg_savestr res; + if (res == -1) { + ! Come back from @restore + print "Restore succeeded!^"; + + print "loc1="; check(loc1, 111); print " loc2="; check(loc2, 222); print " glob="; check(testglobal, 333); print "^"; + + GGRecoverObjects(); + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + + jump restore_2; + } + if (res) { + print "Save failed!^"; + failures++; + jump cleanup; + } + + print "Saved.^"; + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + + ! These values will be restored over + loc1 = 5; + loc2 = 6; + testglobal = 7; + + gg_savestr = glk($0042, gg_savefref, $02, GG_SAVESTR_ROCK); ! stream_open_file + if (~~gg_savestr) { + print "Unable to open stream!^"; + failures++; + jump cleanup; + } + + print "Restoring...^"; + @restore gg_savestr res; + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + print "Restore failed!^"; + failures++; + jump cleanup; + + .restore_2; + print "Restore with stack.^"; + + loc1 = 55555; + loc2 = 6666; + testglobal = 777; + @push 888888; + + gg_savestr = glk($0042, gg_savefref, $01, GG_SAVESTR_ROCK); ! stream_open_file + if (~~gg_savestr) { + print "Unable to open stream!^"; + failures++; + jump cleanup; + } + + print "Saving...^"; + @save gg_savestr res; + if (res == -1) { + ! Come back from @restore + print "Restore succeeded!^"; + + @pull testglobal2; + print "*sp="; check(testglobal2, 888888); print "^"; + print "loc1="; check(loc1, 55555); print " loc2="; check(loc2, 6666); print " glob="; check(testglobal, 777); print "^"; + + GGRecoverObjects(); + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + + jump restore_3; + } + if (res) { + print "Save failed!^"; + failures++; + jump cleanup; + } + + print "Saved.^"; + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + + ! These values will be restored over + loc1 = 1; + loc2 = 2; + testglobal = 3; + + gg_savestr = glk($0042, gg_savefref, $02, GG_SAVESTR_ROCK); ! stream_open_file + if (~~gg_savestr) { + print "Unable to open stream!^"; + failures++; + jump cleanup; + } + + print "Restoring...^"; + @restore gg_savestr res; + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + print "Restore failed!^"; + failures++; + jump cleanup; + + .restore_3; + print "Restore nested.^"; + + loc1 = 1; + loc2 = 2; + testglobal = 3; + + gg_savestr = glk($0042, gg_savefref, $01, GG_SAVESTR_ROCK); ! stream_open_file + if (~~gg_savestr) { + print "Unable to open stream!^"; + failures++; + jump cleanup; + } + + print "Saving...^"; + res = save_nested(); + if (res == -1) { + ! Come back from @restore + print "Restore succeeded!^"; + + print "loc1="; check(loc1, 1); print " loc2="; check(loc2, 2); print " glob="; check(testglobal, 3); print "^"; + + GGRecoverObjects(); + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + + jump restore_4; + } + if (res) { + print "Save failed!^"; + failures++; + jump cleanup; + } + + print "Saved.^"; + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + + ! These values will be restored over + loc1 = 5; + loc2 = 6; + testglobal = 7; + + gg_savestr = glk($0042, gg_savefref, $02, GG_SAVESTR_ROCK); ! stream_open_file + if (~~gg_savestr) { + print "Unable to open stream!^"; + failures++; + jump cleanup; + } + + print "Restoring...^"; + res = restore_nested(); + glk($0044, gg_savestr, 0); ! stream_close + gg_savestr = 0; + print "Restore failed!^"; + failures++; + jump cleanup; + + .restore_4; + print "Done.^"; + + .cleanup; + print "Cleaning up fileref.^"; + if (gg_savefref) { + delete_if_exists(gg_savefref); + glk($0063, gg_savefref); ! fileref_destroy + gg_savefref = 0; + } + + count_failures(); + ]; + +[ save_nested res locx locy; + locx = 10; + locy = 41; + + @save gg_savestr res; + if (res == -1) { + ! Come back from @restore + print "locx="; check(locx, 10); print " locy="; check(locy, 41); print "^"; + return res; + } + if (res) { + print "Save failed! (inner)^"; + return res; + } + + locx = 1; + locy = 1; + + return res; +]; + +[ restore_nested res; + @restore gg_savestr res; + print "Restore failed! (inner)^"; + return res; +]; + +[ delete_if_exists fref val; + val = glk($0067, fref); ! fileref_does_file_exist + if (val) { + print "(Deleting existing save file)^"; + glk($0066, fref); ! fileref_delete_file + } +]; + +TestClass VerifyTest + with name 'verify', + testfunc [ val; + print "Verify:^^"; + + @verify val; + print "verify="; check(val, 0); print "^"; + + @verify testglobal; + print "verify="; check(testglobal, 0); print "^"; + + @verify sp; + @copy sp val; + print "verify="; check(val, 0); print "^"; + + count_failures(); + ]; + +TestClass ProtectTest + with name 'protect', + testfunc [ val addr; + print "Protect:^^"; + + @gestalt 3 0 val; ! Undo + if (~~val) + print "Interpreter claims to not support undo. (Continuing test anyway...)^^"; + + addr = destarray+3; + @protect addr 6; + fill_array_seq(destarray); + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + fill_array_val(destarray, 99); + failures++; + print "Restoring undo...^"; + @restoreundo val; + if (val == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + + print "Protected 3,6: "; + check_bytelist(destarray, 1,2,3,99,99,99,99,99,99,10,11,12); print "^"; + + + addr = destarray+6; + @copy 1 sp; + @copy addr sp; + @protect sp sp; + fill_array_seq(destarray); + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + fill_array_val(destarray, 99); + failures++; + print "Restoring undo...^"; + @restoreundo val; + if (val == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + + print "Protected 6,1: "; + check_bytelist(destarray, 1,2,3,4,5,6,99,8,9,10,11,12); print "^"; + + + @protect 0 0; + fill_array_seq(destarray); + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + fill_array_val(destarray, 99); + failures++; + print "Restoring undo...^"; + @restoreundo val; + if (val == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + + print "Unprotected: "; + check_bytelist(destarray, 1,2,3,4,5,6,7,8,9,10,11,12); print "^"; + + + count_failures(); + ]; + +TestClass MemSizeTest + with name 'memsize' 'msize', + testfunc [ val res addr extstart endmem newendmem; + print "Memory-size extension:^^"; + + extstart = HDR_EXTSTART-->0; + endmem = HDR_ENDMEM-->0; + + @gestalt 2 0 val; ! ResizeMem + if (~~val) { + print "Interpreter claims to not support memory resizing.^^"; + @getmemsize val; + print "Initial memsize="; check_hex(val, endmem); print "^"; + print "Trying @@64setmemsize, which should fail...^"; + newendmem = endmem + $100; + @setmemsize newendmem res; + print "@@64setmemsize="; check(res, 1); print "^"; + count_failures(); + return; + } + + if (extstart == endmem) { + print "This game file was compiled with a version of Inform + that does not understand the $MEMORY_MAP_EXTENSION option.^"; + } + else { + print "ExtStart=", (Hex) extstart, "; "; + print "EndMem="; check_hex(endmem, extstart+$100); print "^"; + } + + @getmemsize val; + print "Initial memsize="; check_hex(val, endmem); print "^"; + + addr = endmem-2; + val = addr->0; + print "Value at ", (Hex)addr, "="; check(val, 0); print "^"; + addr = endmem-1; + addr->0 = 75; + val = addr->0; + print "Write/read at ", (Hex)addr, "="; check(val, 75); print "^"; + + newendmem = endmem + $100; + @setmemsize newendmem res; + print "@@64setmemsize="; check(res, 0); print "^"; + @getmemsize val; + print "New memsize="; check_hex(val, newendmem); print "^"; + + addr = endmem-1; + addr->0 = 75; + val = addr->0; + print "Write/read at ", (Hex)addr, "="; check(val, 75); print "^"; + + addr = newendmem-1; + addr->0 = 234; + val = addr->0; + print "Write/read at ", (Hex)addr, "="; check(val, 234); print "^"; + + @setmemsize endmem res; + print "@@64setmemsize="; check(res, 0); print "^"; + @getmemsize val; + print "Restored memsize="; check_hex(val, endmem); print "^"; + + @setmemsize newendmem res; + print "@@64setmemsize="; check(res, 0); print "^"; + @getmemsize val; + print "New memsize="; check_hex(val, newendmem); print "^"; + + addr = newendmem-1; + val = addr->0; + print "Write/read at ", (Hex)addr, "="; check(val, 0); print "^"; + + @setmemsize endmem res; + print "@@64setmemsize="; check(res, 0); print "^"; + @getmemsize val; + print "Restored memsize="; check_hex(val, endmem); print "^"; + + count_failures(); + ]; + +TestClass UndoMemSizeTest + with name 'undomemsize' 'undomem' 'undomsize', + short_name "undomemsize", + testfunc [ val res addr extstart endmem newendmem; + print "Undo of memory-size extension:^^"; + + @gestalt 2 0 val; ! ResizeMem + if (~~val) { + print "Interpreter claims to not support memory resizing. Skipping test.^^"; + count_failures(); + return; + } + + @gestalt 3 0 val; ! Undo + if (~~val) { + print "Interpreter claims to not support undo. Skipping test.^^"; + count_failures(); + return; + } + + extstart = HDR_EXTSTART-->0; + endmem = HDR_ENDMEM-->0; + print "ExtStart=", (Hex) extstart, "; "; + print "EndMem="; check_hex(endmem, extstart+$100); print "^"; + @getmemsize val; + print "Original memsize="; check_hex(val, endmem); print "^"; + + addr = endmem + $80; + newendmem = endmem + $100; + @setmemsize newendmem res; + print "@@64setmemsize="; check(res, 0); print "^"; + @getmemsize val; + print "New memsize="; check_hex(val, newendmem); print "^"; + + fill_array_seq(addr); + print "Wrote: ", (Hex) addr, ": "; + check_bytelist(addr, 1,2,3,4,5,6,7,8,9,10,11,12); print "^"; + + + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + fill_array_val(addr, 99); + @setmemsize endmem res; + print "@@64setmemsize="; check(res, 0); print "^"; + @getmemsize val; + print "Shrunk memsize="; check_hex(val, endmem); print "^"; + failures++; + print "Restoring undo...^"; + @restoreundo val; + if (val == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + + @getmemsize val; + print "Restored memsize="; check_hex(val, newendmem); print "^"; + print "Restored: ", (Hex) addr, ": "; + check_bytelist(addr, 1,2,3,4,5,6,7,8,9,10,11,12); print "^"; + + + val = addr+1; + @protect val 5; + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + fill_array_val(addr, 77); + @setmemsize endmem res; + print "@@64setmemsize="; check(res, 0); print "^"; + @getmemsize val; + print "Shrunk memsize="; check_hex(val, endmem); print "^"; + failures++; + print "Restoring undo...^"; + @restoreundo val; + if (val == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + + @getmemsize val; + print "Restored memsize="; check_hex(val, newendmem); print "^"; + print "Restored: ", (Hex) addr, ": "; + check_bytelist(addr, 1,0,0,0,0,0,7,8,9,10,11,12); print "^"; + + + @protect 0 0; + @setmemsize endmem res; + print "@@64setmemsize="; check(res, 0); print "^"; + @getmemsize val; + print "Restored memsize="; check_hex(val, endmem); print "^"; + + count_failures(); + ]; + +Array startovertest --> 4; + +TestClass UndoRestartTest + with name 'undorestart', + short_name "undorestart", + testfunc [ val; + print "Undo of restart:^^"; + + @gestalt 3 0 val; ! Undo + if (~~val) { + print "Interpreter claims to not support undo. Skipping test.^^"; + count_failures(); + return; + } + + @protect startovertest 8; + startovertest-->0 = 1234; + startovertest-->1 = 1; + startovertest-->2 = 1; ! unprotected + + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + startovertest-->1 = 2; + startovertest-->2 = 2; + failures++; + @push 999; + @restart; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + + print "Magic number "; check(startovertest-->0, 1234); + print ", "; check(startovertest-->1, 3); + print ", "; check(startovertest-->2, 1); print "^"; + + startovertest-->0 = 0; + startovertest-->1 = 0; + startovertest-->2 = 0; + + count_failures(); + ]; + +TestClass HeapTest + with name 'heap', + testfunc [ val endmem newendmem blk1 blk2 blk3; + print "Heap:^^"; + + @gestalt 7 0 val; ! MAlloc + if (~~val) { + print "Interpreter claims to not support heap allocation. Skipping test.^^"; + count_failures(); + return; + } + + endmem = HDR_ENDMEM-->0; + @getmemsize val; + print "Original memsize="; check_hex(val, endmem); print "^"; + + @gestalt 8 0 val; ! MAllocHeap + print "Current heap: "; check_hex(val, 0); print "^"; + + print "Allocating 16...^"; + @malloc 16 blk1; + if (blk1 == 0) { + failures++; + print "Allocation failed.^"; + count_failures(); + return; + } + + @gestalt 8 0 val; ! MAllocHeap + print "Heap starts at "; check_hex(val, endmem); + @getmemsize newendmem; + print ", ends at ", (Hex) newendmem, "^"; + if (newendmem <= endmem) { + failures++; + print "Heap size is not positive.^"; + } + if (blk1 < endmem || blk1+16 > newendmem) { + failures++; + print "Block is outside heap.^"; + } + + print "Allocating 512...^"; + @malloc 512 blk2; + if (blk2 == 0) { + failures++; + print "Allocation failed.^"; + count_failures(); + return; + } + + @gestalt 8 0 val; ! MAllocHeap + print "Heap starts at "; check_hex(val, endmem); + @getmemsize newendmem; + print ", ends at ", (Hex) newendmem, "^"; + if (newendmem <= endmem) { + failures++; + print "Heap size is not positive.^"; + } + if (blk2 < endmem || blk2+512 > newendmem) { + failures++; + print "Block is outside heap.^"; + } + + print "Freeing 16...^"; + @mfree blk1; + + @getmemsize newendmem; + print "Heap ends at ", (Hex) newendmem, "^"; + @gestalt 8 0 val; ! MAllocHeap + if (val == 0) { + failures++; + print "Heap is inactive.^"; + } + if (blk2 < endmem || blk2+512 > newendmem) { + failures++; + print "Block is outside heap.^"; + } + + print "Freeing 512...^"; + @mfree blk2; + + @gestalt 8 0 val; ! MAllocHeap + print "Final heap: "; check_hex(val, 0); print "^"; + endmem = HDR_ENDMEM-->0; + @getmemsize val; + print "Final memsize="; check_hex(val, endmem); print "^"; + + @malloc 19 blk1; + print "blk1(19)="; check_nonzero(blk1); print ", "; + @malloc 23 blk2; + print "blk2(23)="; check_nonzero(blk2); print ", "; + @malloc 17 blk3; + print "blk3(17)="; check_nonzero(blk3); print "^"; + + @mfree blk2; + print "free blk2, "; + @malloc 23 blk2; + print "blk2(23)="; check_nonzero(blk2); print "^"; + + @mfree blk1; + print "free blk1, "; + @malloc 19 blk1; + print "blk1(19)="; check_nonzero(blk1); print "^"; + + @mfree blk2; + print "free blk2, "; + @malloc 23 blk2; + print "blk2(23)="; check_nonzero(blk2); print "^"; + + @mfree blk1; + print "free blk1, "; + @mfree blk2; + print "free blk2^"; + + @malloc 25 blk1; + print "blk1(25)="; check_nonzero(blk1); print ", "; + @malloc 17 blk2; + print "blk2(17)="; check_nonzero(blk2); print "^"; + + @mfree blk2; + print "free blk2, "; + @malloc 41 blk2; + print "blk2(41)="; check_nonzero(blk2); print "^"; + + @mfree blk1; + print "free blk1, "; + @mfree blk2; + print "free blk2, "; + @mfree blk3; + print "free blk3^"; + + + @gestalt 8 0 val; ! MAllocHeap + print "Final heap: "; check_hex(val, 0); print "^"; + endmem = HDR_ENDMEM-->0; + @getmemsize val; + print "Final memsize="; check_hex(val, endmem); print "^"; + + count_failures(); + ]; + + +TestClass UndoHeapTest + with name 'undoheap', + testfunc [ val endmem newendmem blk1 blk2; + print "Heap:^^"; + + @gestalt 7 0 val; ! MAlloc + if (~~val) { + print "Interpreter claims to not support heap allocation. Skipping test.^^"; + count_failures(); + return; + } + + @gestalt 3 0 val; ! Undo + if (~~val) { + print "Interpreter claims to not support undo. Skipping test.^^"; + count_failures(); + return; + } + + endmem = HDR_ENDMEM-->0; + @getmemsize val; + print "Original memsize="; check_hex(val, endmem); print "^"; + + @gestalt 8 0 val; ! MAllocHeap + print "Current heap: "; check_hex(val, 0); print "^"; + + print "Allocating 16...^"; + @malloc 16 blk1; + if (blk1 == 0) { + failures++; + print "Allocation failed.^"; + count_failures(); + return; + } + print "Allocating 512...^"; + @malloc 512 blk2; + if (blk2 == 0) { + failures++; + print "Allocation failed.^"; + count_failures(); + return; + } + + @gestalt 8 0 val; ! MAllocHeap + print "Heap starts at "; check_hex(val, endmem); + @getmemsize newendmem; + print ", ends at ", (Hex) newendmem, "^"; + if (newendmem <= endmem) { + failures++; + print "Heap size is not positive.^"; + } + + + @saveundo val; + if (val == 1) { + print "@@64saveundo failed!^"; + failures++; + count_failures(); + return; + } + if (val == 0) { + print "Undo saved...^"; + ! The following changes will be undone. + print "Freeing 16...^"; + @mfree blk1; + print "Freeing 512...^"; + @mfree blk2; + @gestalt 8 0 val; ! MAllocHeap + print "Final heap: "; check_hex(val, 0); print "^"; + failures++; + print "Restoring undo...^"; + @restoreundo val; + if (val == 1) { + print "@@64restoreundo failed (value 1)!^"; + } + else { + print "@@64restoreundo failed with unknown return value: ", val, "^"; + } + failures++; + count_failures(); + return; + } + else if (val ~= -1) { + print "Unknown @@64saveundo return value: ", val, "^"; + failures++; + count_failures(); + return; + } + print "Undo succeeded, return value "; check(val, -1); print ".^"; + + + @gestalt 8 0 val; ! MAllocHeap + print "Heap starts at "; check_hex(val, endmem); + @getmemsize newendmem; + print ", ends at ", (Hex) newendmem, "^"; + if (newendmem <= endmem) { + failures++; + print "Heap size is not positive.^"; + } + + print "Freeing 16...^"; + @mfree blk1; + print "Freeing 512...^"; + @mfree blk2; + + @gestalt 8 0 val; ! MAllocHeap + print "Final heap: "; check_hex(val, 0); print "^"; + endmem = HDR_ENDMEM-->0; + @getmemsize val; + print "Final memsize="; check_hex(val, endmem); print "^"; + + count_failures(); + ]; + +[ do_failure; + failures++; +]; + +TestClass AccelTest + with name 'acceleration' 'accel' 'accelfunc' 'accelparam', + short_name "acceleration", + testfunc [ val; + print "Acceleration:^"; + print "(This tests only the operands. For a complete test of the + accelfunc and accelparam opcodes, see accelfunctest.ulx.)^^"; + + @copy 987 sp; + + @accelfunc 9999 do_failure; + val = 9999; + @accelfunc val do_failure; + testglobal = 9999; + @accelfunc testglobal do_failure; + @copy do_failure sp; + @copy 9999 sp; + @accelfunc sp sp; + @accelfunc 0 do_failure; + + @accelparam 9999 1234; + val = 9999; + @accelparam val 1234; + testglobal = 9999; + @accelparam testglobal 1234; + @copy 1234 sp; + @copy 9999 sp; + @accelparam sp sp; + @accelparam 0 1234; + + @copy sp val; + print "guard="; check(val, 987); print "^"; + + count_failures(); + ]; + +#ifdef FLOAT_OPCODES_AVAILABLE; + +Constant M_0 = $0; +Constant M_1 = $3F800000; +Constant M_N1 = $BF800000; ! -1 +Constant M_PI = $40490FDB; +Constant M_NPI = $C0490FDB; +Constant M_2PI = $40C90FDB; ! 2*pi +Constant M_PI2 = $3FC90FDB; ! pi/2 +Constant M_NPI2 = $BFC90FDB; +Constant M_E = $402DF854; +Constant M_E2 = $40EC7326; ! e^2 +Constant M_N0 = $80000000; ! negative zero +Constant M_INF = $7F800000; ! infinity +Constant M_NINF = $FF800000; ! negative infinity +Constant M_NAN = $7F800001; ! one of many NaN values +Constant M_NNAN = $FF800001; ! another, with a sign bit + +! Print a float. This uses exponential notation ("[-]N.NNNe[+-]NN") if +! the exponent is not between 6 and -4. If it is (that is, if the +! absolute value is near 1.0) then it uses decimal notation ("[-]NNN.NNNNN"). +! The precision is the number of digits after the decimal point +! (at least one, no more than eight). The default is five, because +! beyond that rounding errors creep in, and even exactly-represented +! float values are printed with trailing fudgy digits. +[ Float val prec pval; + pval = val & $7FFFFFFF; + + @jz pval ?UseFloatDec; + @jfge pval $49742400 ?UseFloatExp; ! 1000000.0 + @jflt pval $38D1B717 ?UseFloatExp; ! 0.0001 + + .UseFloatDec; + return FloatDec(val, prec); + .UseFloatExp; + return FloatExp(val, prec); +]; + +Array PowersOfTen --> 1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000; + +! Print a float in exponential notation: "[-]N.NNNe[+-]NN". +! The precision is the number of digits after the decimal point +! (at least one, no more than eight). The default is five, because +! beyond that rounding errors creep in, and even exactly-represented +! float values are printed with trailing fudgy digits. +[ FloatExp val prec log10val expo fexpo idig ix pow10; + if (prec == 0) + prec = 5; + if (prec > 8) + prec = 8; + pow10 = PowersOfTen --> prec; + + ! Knock off the sign bit first. + if (val & $80000000) { + @streamchar '-'; + val = val & $7FFFFFFF; + } + + @jisnan val ?IsNan; + @jisinf val ?IsInf; + + if (val == $0) { + expo = 0; + idig = 0; + jump DoPrint; + } + + ! Take as an example val=123.5, with precision=6. The desired + ! result is "1.23000e+02". + + @log val sp; + @fdiv sp $40135D8E log10val; ! $40135D8E is log(10) + @floor log10val fexpo; + @ftonumn fexpo expo; + ! expo is now the exponent (as an integer). For our example, expo=2. + + @fsub log10val fexpo sp; + @numtof prec sp; + @fadd sp sp sp; + @fmul sp $40135D8E sp; + @exp sp sp; + ! The stack value is now exp((log10val - fexpo + prec) * log(10)). + ! We've shifted the decimal point left by expo digits (so that + ! it's after the first nonzero digit), and then right by prec + ! digits. In our example, that would be 1235000.0. + @ftonumn sp idig; + ! Round to an integer, and we have 1235000. Notice that this is + ! exactly the digits we want to print (if we stick a decimal point + ! after the first). + + .DoPrint; + + if (idig >= 10*pow10) { + ! Rounding errors have left us outside the decimal range of + ! [1.0, 10.0) where we should be. Adjust to the next higher + ! exponent. + expo++; + @div idig 10 idig; + } + + for (ix=0 : ix<=prec : ix++) { + @div idig pow10 sp; + @mod sp 10 sp; + @streamnum sp; + if (ix == 0) + @streamchar '.'; + @div pow10 10 pow10; + } + + ! Print the exponent. Convention is to use at least two digits. + @streamchar 'e'; + if (expo < 0) { + @streamchar '-'; + @neg expo expo; + } + else { + @streamchar '+'; + } + if (expo < 10) + @streamchar '0'; + @streamnum expo; + rtrue; + + .IsNan; + @streamstr "NaN"; + rtrue; + + .IsInf; + @streamstr "Inf"; + rtrue; +]; + +! Print a float in decimal notation: "[-]NNN.NNNNN". +! The precision is the number of digits after the decimal point +! (at least one, no more than eight). The default is five, because +! beyond that rounding errors creep in, and even exactly-represented +! float values are printed with trailing fudgy digits. +[ FloatDec val prec log10val int fint extra0 frac idig ix pow10; + if (prec == 0) + prec = 5; + if (prec > 8) + prec = 8; + pow10 = PowersOfTen --> prec; + + ! Knock off the sign bit first. + if (val & $80000000) { + @streamchar '-'; + val = val & $7FFFFFFF; + } + + @jisnan val ?IsNan; + @jisinf val ?IsInf; + + ! Take as an example val=123.5, with precision=6. The desired result + ! is "123.50000". + + extra0 = 0; + @fmod val $3F800000 frac fint; ! $3F800000 is 1.0. + @ftonumz fint int; + ! This converts the integer part of the value to an integer value; + ! in our example, 123. + + if (int == $7FFFFFFF) { + ! Looks like the integer part of the value is bigger than + ! we can store in an int variable. (It could be as large + ! as 3e+38.) We're going to have to use a log function to + ! reduce it by some number of factors of 10, and then pad + ! with zeroes. + @log fint sp; + @fdiv sp $40135D8E log10val; ! $40135D8E is log(10) + @ftonumz log10val extra0; + @sub extra0 8 extra0; + ! extra0 is the number of zeroes we'll be padding with. + @numtof extra0 sp; + @fsub log10val sp sp; + @fmul sp $40135D8E sp; + @exp sp sp; + ! The stack value is now exp((log10val - extra0) * log(10)). + ! We've shifted the decimal point far enough left to leave + ! about eight digits, which is all we can print as an integer. + @ftonumz sp int; + } + + ! Print the integer part. + @streamnum int; + for (ix=0 : ix= pow10) { + ! Rounding errors have left us outside the decimal range of + ! [0.0, 1.0) where we should be. I'm not sure this is possible, + ! actually, but we'll just adjust downward. + idig = pow10 - 1; + } + + @div pow10 10 pow10; + for (ix=0 : ix0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #Endif; ! TARGET_GLULX +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +[ RunTest; + + TestFunc1(); + TestFunc2(); + TestFunc3(); + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +Constant ISDEF 1; + +! This function has an "if" statement under #if TRUE. +[ Compare1 val val2; + +#ifdef ISDEF; + if (val == val2) return 1; +#ifnot; + if (val > val2) return 2; +#endif; + else return -1; + + print "(BUG, should not get here.)^"; +]; + +! This function has an "if" statement under #if FALSE. +[ Compare2 val val2; + +#ifdef ISNOTDEF; + if (val == val2) return 1; +#ifnot; + if (val > val2) return 2; +#endif; + else return -1; + + print "(BUG, should not get here.)^"; +]; + +! This function has an "else" statement under #if TRUE. +[ IsDefault1 val; + if (val) return val; +#ifdef ISDEF; + else return -1; +#ifnot; + else return -2; +#endif; + + print "(BUG, should not get here.)^"; +]; + +! This function has an "else" statement under #if FALSE. +[ IsDefault2 val; + if (val) return val; +#ifdef ISNOTDEF; + else return -1; +#ifnot; + else return -2; +#endif; + + print "(BUG, should not get here.)^"; +]; + +[ TestFunc1 val; + val = Compare1(3, 3); + print "3==3: "; + check_value(val, 1); + print ".^"; + + val = Compare1(3, 5); + print "3==5: "; + check_value(val, -1); + print ".^"; + + val = Compare1(3, 2); + print "3==2: "; + check_value(val, -1); + print ".^"; + + val = Compare2(3, 3); + print "3>3: "; + check_value(val, -1); + print ".^"; + + val = Compare2(3, 5); + print "3>5: "; + check_value(val, -1); + print ".^"; + + val = Compare2(3, 2); + print "3>2: "; + check_value(val, 2); + print ".^"; + + val = IsDefault1(5); + print "5 or -1: "; + check_value(val, 5); + print ".^"; + + val = IsDefault1(0); + print "0 or -1: "; + check_value(val, -1); + print ".^"; + + val = IsDefault2(5); + print "5 or -2: "; + check_value(val, 5); + print ".^"; + + val = IsDefault2(0); + print "0 or -2: "; + check_value(val, -2); + print ".^"; + +]; + +! This function has a bunch of #if directives between the "if" and "else"; +! they add up to nothing. +[ GetAbs val res; + if (val < 0) + { + res = -val; + } +#ifdef ISDEF; +#ifnot; + bad_statement; +#endif; +#ifdef ISNOTDEF; + bad_statement; +#ifnot; +#endif; + else + { + res = val; + } + + return res; +]; + +[ TestFunc2 val; + val = GetAbs(3); + print "GetAbs(3): "; + check_value(val, 3); + print ".^"; + + val = GetAbs(-7); + print "GetAbs(-7): "; + check_value(val, 7); + print ".^"; + + val = GetAbs(0); + print "GetAbs(0): "; + check_value(val, 0); + print ".^"; + +]; + +! Four variations where both the "if" and "else" are conditional! + +[ Path1 arg val; + +#ifdef ISDEF; + if (arg) val = 1; +#ifnot; + if (arg) val = 2; +#endif; +#ifdef ISDEF; + else val = 3; +#ifnot; + else val = 4; +#endif; + + return val; +]; + +[ Path2 arg val; + +#ifdef ISDEF; + if (arg) val = 1; +#ifnot; + if (arg) val = 2; +#endif; +#ifdef ISNOTDEF; + else val = 3; +#ifnot; + else val = 4; +#endif; + + return val; +]; + +[ Path3 arg val; + +#ifdef ISNOTDEF; + if (arg) val = 1; +#ifnot; + if (arg) val = 2; +#endif; +#ifdef ISDEF; + else val = 3; +#ifnot; + else val = 4; +#endif; + + return val; +]; + +[ Path4 arg val; + +#ifdef ISNOTDEF; + if (arg) val = 1; +#ifnot; + if (arg) val = 2; +#endif; +#ifdef ISNOTDEF; + else val = 3; +#ifnot; + else val = 4; +#endif; + + return val; +]; + +[ TestFunc3 val; + val = Path1(false); + print "Path1(false): "; + check_value(val, 3); + print ".^"; + + val = Path1(true); + print "Path1(true): "; + check_value(val, 1); + print ".^"; + + val = Path2(false); + print "Path2(false): "; + check_value(val, 4); + print ".^"; + + val = Path2(true); + print "Path2(true): "; + check_value(val, 1); + print ".^"; + + val = Path3(false); + print "Path3(false): "; + check_value(val, 3); + print ".^"; + + val = Path3(true); + print "Path3(true): "; + check_value(val, 2); + print ".^"; + + val = Path4(false); + print "Path4(false): "; + check_value(val, 4); + print ".^"; + + val = Path4(true); + print "Path4(true): "; + check_value(val, 2); + print ".^"; + +]; diff --git a/inform6/Tests/Test Cases/ifelsedirecttest.inf b/inform6/Tests/Test Cases/ifelsedirecttest.inf new file mode 100755 index 000000000..3311b3ba5 --- /dev/null +++ b/inform6/Tests/Test Cases/ifelsedirecttest.inf @@ -0,0 +1,360 @@ +Constant Story "IfElseDirectiveTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for directives (such as #if) +! appearing inside if/else statements. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #Endif; ! TARGET_GLULX +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +[ RunTest; + + TestFunc1(); + TestFunc2(); + TestFunc3(); + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +Constant ISDEF 1; + +! This function has an "if" statement under #if TRUE. +[ Compare1 val val2; + +#ifdef ISDEF; + if (val == val2) return 1; +#ifnot; + if (val > val2) return 2; +#endif; + else return -1; + + print "(BUG, should not get here.)^"; +]; + +! This function has an "if" statement under #if FALSE. +[ Compare2 val val2; + +#ifdef ISNOTDEF; + if (val == val2) return 1; +#ifnot; + if (val > val2) return 2; +#endif; + else return -1; + + print "(BUG, should not get here.)^"; +]; + +! This function has an "else" statement under #if TRUE. +[ IsDefault1 val; + if (val) return val; +#ifdef ISDEF; + else return -1; +#ifnot; + else return -2; +#endif; + + print "(BUG, should not get here.)^"; +]; + +! This function has an "else" statement under #if FALSE. +[ IsDefault2 val; + if (val) return val; +#ifdef ISNOTDEF; + else return -1; +#ifnot; + else return -2; +#endif; + + print "(BUG, should not get here.)^"; +]; + +[ TestFunc1 val; + val = Compare1(3, 3); + print "3==3: "; + check_value(val, 1); + print ".^"; + + val = Compare1(3, 5); + print "3==5: "; + check_value(val, -1); + print ".^"; + + val = Compare1(3, 2); + print "3==2: "; + check_value(val, -1); + print ".^"; + + val = Compare2(3, 3); + print "3>3: "; + check_value(val, -1); + print ".^"; + + val = Compare2(3, 5); + print "3>5: "; + check_value(val, -1); + print ".^"; + + val = Compare2(3, 2); + print "3>2: "; + check_value(val, 2); + print ".^"; + + val = IsDefault1(5); + print "5 or -1: "; + check_value(val, 5); + print ".^"; + + val = IsDefault1(0); + print "0 or -1: "; + check_value(val, -1); + print ".^"; + + val = IsDefault2(5); + print "5 or -2: "; + check_value(val, 5); + print ".^"; + + val = IsDefault2(0); + print "0 or -2: "; + check_value(val, -2); + print ".^"; + +]; + +! This function has a bunch of #if directives between the "if" and "else"; +! they add up to nothing. +[ GetAbs val res; + if (val < 0) + { + res = -val; + } +#ifdef ISDEF; +#ifnot; + bad_statement; +#endif; +#ifdef ISNOTDEF; + bad_statement; +#ifnot; +#endif; + else + { + res = val; + } + + return res; +]; + +[ TestFunc2 val; + val = GetAbs(3); + print "GetAbs(3): "; + check_value(val, 3); + print ".^"; + + val = GetAbs(-7); + print "GetAbs(-7): "; + check_value(val, 7); + print ".^"; + + val = GetAbs(0); + print "GetAbs(0): "; + check_value(val, 0); + print ".^"; + +]; + +! Four variations where both the "if" and "else" are conditional! + +[ Path1 arg val; + +#ifdef ISDEF; + if (arg) val = 1; +#ifnot; + if (arg) val = 2; +#endif; +#ifdef ISDEF; + else val = 3; +#ifnot; + else val = 4; +#endif; + + return val; +]; + +[ Path2 arg val; + +#ifdef ISDEF; + if (arg) val = 1; +#ifnot; + if (arg) val = 2; +#endif; +#ifdef ISNOTDEF; + else val = 3; +#ifnot; + else val = 4; +#endif; + + return val; +]; + +[ Path3 arg val; + +#ifdef ISNOTDEF; + if (arg) val = 1; +#ifnot; + if (arg) val = 2; +#endif; +#ifdef ISDEF; + else val = 3; +#ifnot; + else val = 4; +#endif; + + return val; +]; + +[ Path4 arg val; + +#ifdef ISNOTDEF; + if (arg) val = 1; +#ifnot; + if (arg) val = 2; +#endif; +#ifdef ISNOTDEF; + else val = 3; +#ifnot; + else val = 4; +#endif; + + return val; +]; + +[ TestFunc3 val; + val = Path1(false); + print "Path1(false): "; + check_value(val, 3); + print ".^"; + + val = Path1(true); + print "Path1(true): "; + check_value(val, 1); + print ".^"; + + val = Path2(false); + print "Path2(false): "; + check_value(val, 4); + print ".^"; + + val = Path2(true); + print "Path2(true): "; + check_value(val, 1); + print ".^"; + + val = Path3(false); + print "Path3(false): "; + check_value(val, 3); + print ".^"; + + val = Path3(true); + print "Path3(true): "; + check_value(val, 2); + print ".^"; + + val = Path4(false); + print "Path4(false): "; + check_value(val, 4); + print ".^"; + + val = Path4(true); + print "Path4(true): "; + check_value(val, 2); + print ".^"; + +]; diff --git a/inform6/Tests/Test Cases/internaldirecttest-G.inf b/inform6/Tests/Test Cases/internaldirecttest-G.inf new file mode 100755 index 000000000..f96f827fc --- /dev/null +++ b/inform6/Tests/Test Cases/internaldirecttest-G.inf @@ -0,0 +1,345 @@ +Constant Story "InternalDirectiveTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for directives (such as #if) +! appearing inside switch statements. And other places. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #Endif; ! TARGET_GLULX +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +Attribute light; +Property genprop; + +Constant ISDEF 1; +Constant SEVEN 7; + +Object testobj + with name 'testobj', +#ifdef ISDEF; + with color 'red', +#ifnot; + with color 'green', +#endif; +#ifdef NOTDEF; + with size 4, +#ifnot; + with size 5, +#endif; +#ifdef NOTDEF; + with genprop 12, + has light, +#endif; + with lastprop; + +#ifdef ISDEF; +[ Func4; return 4; ]; +#ifnot; +[ Func4; return 44; ]; +#endif; + +#ifdef NOTDEF; +[ Func5; return 55; ]; +#ifnot; +[ Func5; return 5; ]; +#endif; + +[ RunTest; + + TestObject(); + TestFunc1(); + TestFunc2(); + TestFunc3(); + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +[ TestObject val; + print "testobj.color: "; + check_value(testobj.color, 'red'); + print ".^"; + print "testobj.size: "; + check_value(testobj.size, 5); + print ".^"; + print "testobj has light: "; + val = (testobj has light); + check_value(val, false); + print ".^"; + print "testobj provides genprop: "; + val = (testobj provides genprop); + check_value(val, false); + print ".^"; + print "testobj provides lastprop: "; + val = (testobj provides lastprop); + check_value(val, true); + print ".^"; +]; + +[ TestFunc1 val ix; + +#ifdef ISDEF; + val = 7; +#ifnot; + failures++; + badfunc(); +#endif; + print "val: "; + check_value(val, 7); + print ".^"; + +#ifdef NOTDEF; + failures++; +#ifnot; + val = 9; +#endif; + print "val: "; + check_value(val, 9); + print ".^"; + + if (1) { +#ifdef ISDEF; + val = 11; +#endif; + } + print "val: "; + check_value(val, 11); + print ".^"; + + val = 0; + for (ix=0 : ix<5 : ix++) { +#ifndef NOTDEF; + val = val + ix; +#ifnot; + val = -1; +#endif; + } + print "val: "; + check_value(val, 10); + print ".^"; + + print "Func4(): "; + check_value(Func4(), 4); + print ".^"; + print "Func5(): "; + check_value(Func5(), 5); + print ".^"; + +]; + +[ TestFunc2 val; + + val = 0; +#iftrue (SEVEN == 7); + #ifdef ISDEF; + val = val + 1; + #ifnot; + val = 100; + #endif; +#ifnot; + #ifdef ISDEF; + val = 101; + #ifnot; + val = 102; + #endif; +#endif; + + print "val: "; + check_value(val, 1); + print ".^"; + + val = 0; +#iftrue (SEVEN == 8); + #ifdef ISDEF; + val = val + 1; + #ifnot; + val = 100; + #endif; +#ifnot; + #ifdef ISDEF; + val = 101; + #ifnot; + val = 102; + #endif; +#endif; + + print "val: "; + check_value(val, 101); + print ".^"; + + val = 0; +#iftrue (SEVEN == 8); + #ifdef ISDEF; + val = val + 1; + #ifnot; + val = 110; + #endif; +#ifnot; + #ifdef NOTDEF; + val = 111; + #ifnot; + val = 112; + #endif; + val = val + 5; +#endif; + + print "val: "; + check_value(val, 117); + print ".^"; + +]; + +[ SwitchTest val; + switch (val) { + #ifdef ISDEF; + 9: return 99; + #endif; + 0: return 0; + #ifdef ISDEF; + 1: return 11; + 2: return 22; + #ifnot; + 7: return 77; + #endif; + 3: return 33; + #ifdef NOTDEF; + 4: return 44; + 5: return 55; + #endif; + 6: + #ifdef ISDEF; + return 66; + #ifnot; + return 67; + #endif; + #ifdef NOTDEF; + #ifnot; + 8: return 88; + #endif; + #ifdef ISDEF; + default: return -1; + #endif; + } +]; + +[ TestFunc3; + print "SwitchTest(-1): "; + check_value(SwitchTest(-1), -1); + print ".^"; + print "SwitchTest(0): "; + check_value(SwitchTest(0), 0); + print ".^"; + print "SwitchTest(1): "; + check_value(SwitchTest(1), 11); + print ".^"; + print "SwitchTest(2): "; + check_value(SwitchTest(2), 22); + print ".^"; + print "SwitchTest(3): "; + check_value(SwitchTest(3), 33); + print ".^"; + print "SwitchTest(4): "; + check_value(SwitchTest(4), -1); + print ".^"; + print "SwitchTest(5): "; + check_value(SwitchTest(5), -1); + print ".^"; + print "SwitchTest(6): "; + check_value(SwitchTest(6), 66); + print ".^"; + print "SwitchTest(7): "; + check_value(SwitchTest(7), -1); + print ".^"; + print "SwitchTest(8): "; + check_value(SwitchTest(8), 88); + print ".^"; + print "SwitchTest(9): "; + check_value(SwitchTest(9), 99); + print ".^"; +]; diff --git a/inform6/Tests/Test Cases/internaldirecttest.inf b/inform6/Tests/Test Cases/internaldirecttest.inf new file mode 100755 index 000000000..f96f827fc --- /dev/null +++ b/inform6/Tests/Test Cases/internaldirecttest.inf @@ -0,0 +1,345 @@ +Constant Story "InternalDirectiveTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for directives (such as #if) +! appearing inside switch statements. And other places. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #Endif; ! TARGET_GLULX +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +Attribute light; +Property genprop; + +Constant ISDEF 1; +Constant SEVEN 7; + +Object testobj + with name 'testobj', +#ifdef ISDEF; + with color 'red', +#ifnot; + with color 'green', +#endif; +#ifdef NOTDEF; + with size 4, +#ifnot; + with size 5, +#endif; +#ifdef NOTDEF; + with genprop 12, + has light, +#endif; + with lastprop; + +#ifdef ISDEF; +[ Func4; return 4; ]; +#ifnot; +[ Func4; return 44; ]; +#endif; + +#ifdef NOTDEF; +[ Func5; return 55; ]; +#ifnot; +[ Func5; return 5; ]; +#endif; + +[ RunTest; + + TestObject(); + TestFunc1(); + TestFunc2(); + TestFunc3(); + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +[ TestObject val; + print "testobj.color: "; + check_value(testobj.color, 'red'); + print ".^"; + print "testobj.size: "; + check_value(testobj.size, 5); + print ".^"; + print "testobj has light: "; + val = (testobj has light); + check_value(val, false); + print ".^"; + print "testobj provides genprop: "; + val = (testobj provides genprop); + check_value(val, false); + print ".^"; + print "testobj provides lastprop: "; + val = (testobj provides lastprop); + check_value(val, true); + print ".^"; +]; + +[ TestFunc1 val ix; + +#ifdef ISDEF; + val = 7; +#ifnot; + failures++; + badfunc(); +#endif; + print "val: "; + check_value(val, 7); + print ".^"; + +#ifdef NOTDEF; + failures++; +#ifnot; + val = 9; +#endif; + print "val: "; + check_value(val, 9); + print ".^"; + + if (1) { +#ifdef ISDEF; + val = 11; +#endif; + } + print "val: "; + check_value(val, 11); + print ".^"; + + val = 0; + for (ix=0 : ix<5 : ix++) { +#ifndef NOTDEF; + val = val + ix; +#ifnot; + val = -1; +#endif; + } + print "val: "; + check_value(val, 10); + print ".^"; + + print "Func4(): "; + check_value(Func4(), 4); + print ".^"; + print "Func5(): "; + check_value(Func5(), 5); + print ".^"; + +]; + +[ TestFunc2 val; + + val = 0; +#iftrue (SEVEN == 7); + #ifdef ISDEF; + val = val + 1; + #ifnot; + val = 100; + #endif; +#ifnot; + #ifdef ISDEF; + val = 101; + #ifnot; + val = 102; + #endif; +#endif; + + print "val: "; + check_value(val, 1); + print ".^"; + + val = 0; +#iftrue (SEVEN == 8); + #ifdef ISDEF; + val = val + 1; + #ifnot; + val = 100; + #endif; +#ifnot; + #ifdef ISDEF; + val = 101; + #ifnot; + val = 102; + #endif; +#endif; + + print "val: "; + check_value(val, 101); + print ".^"; + + val = 0; +#iftrue (SEVEN == 8); + #ifdef ISDEF; + val = val + 1; + #ifnot; + val = 110; + #endif; +#ifnot; + #ifdef NOTDEF; + val = 111; + #ifnot; + val = 112; + #endif; + val = val + 5; +#endif; + + print "val: "; + check_value(val, 117); + print ".^"; + +]; + +[ SwitchTest val; + switch (val) { + #ifdef ISDEF; + 9: return 99; + #endif; + 0: return 0; + #ifdef ISDEF; + 1: return 11; + 2: return 22; + #ifnot; + 7: return 77; + #endif; + 3: return 33; + #ifdef NOTDEF; + 4: return 44; + 5: return 55; + #endif; + 6: + #ifdef ISDEF; + return 66; + #ifnot; + return 67; + #endif; + #ifdef NOTDEF; + #ifnot; + 8: return 88; + #endif; + #ifdef ISDEF; + default: return -1; + #endif; + } +]; + +[ TestFunc3; + print "SwitchTest(-1): "; + check_value(SwitchTest(-1), -1); + print ".^"; + print "SwitchTest(0): "; + check_value(SwitchTest(0), 0); + print ".^"; + print "SwitchTest(1): "; + check_value(SwitchTest(1), 11); + print ".^"; + print "SwitchTest(2): "; + check_value(SwitchTest(2), 22); + print ".^"; + print "SwitchTest(3): "; + check_value(SwitchTest(3), 33); + print ".^"; + print "SwitchTest(4): "; + check_value(SwitchTest(4), -1); + print ".^"; + print "SwitchTest(5): "; + check_value(SwitchTest(5), -1); + print ".^"; + print "SwitchTest(6): "; + check_value(SwitchTest(6), 66); + print ".^"; + print "SwitchTest(7): "; + check_value(SwitchTest(7), -1); + print ".^"; + print "SwitchTest(8): "; + check_value(SwitchTest(8), 88); + print ".^"; + print "SwitchTest(9): "; + check_value(SwitchTest(9), 99); + print ".^"; +]; diff --git a/inform6/Tests/Test Cases/minimal_test-G.inf b/inform6/Tests/Test Cases/minimal_test-G.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test-G.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/minimal_test_z3.inf b/inform6/Tests/Test Cases/minimal_test_z3.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test_z3.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/minimal_test_z4.inf b/inform6/Tests/Test Cases/minimal_test_z4.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test_z4.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/minimal_test_z5.inf b/inform6/Tests/Test Cases/minimal_test_z5.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test_z5.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/minimal_test_z6.inf b/inform6/Tests/Test Cases/minimal_test_z6.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test_z6.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/minimal_test_z6_bigmem.inf b/inform6/Tests/Test Cases/minimal_test_z6_bigmem.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test_z6_bigmem.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/minimal_test_z7.inf b/inform6/Tests/Test Cases/minimal_test_z7.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test_z7.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/minimal_test_z7_bigmem.inf b/inform6/Tests/Test Cases/minimal_test_z7_bigmem.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test_z7_bigmem.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/minimal_test_z8.inf b/inform6/Tests/Test Cases/minimal_test_z8.inf new file mode 100755 index 000000000..13172cfbf --- /dev/null +++ b/inform6/Tests/Test Cases/minimal_test_z8.inf @@ -0,0 +1,4 @@ +Serial "000000"; + +[ Main; +]; diff --git a/inform6/Tests/Test Cases/replacerecursetest-G.inf b/inform6/Tests/Test Cases/replacerecursetest-G.inf new file mode 100755 index 000000000..d61178d1a --- /dev/null +++ b/inform6/Tests/Test Cases/replacerecursetest-G.inf @@ -0,0 +1,238 @@ +Constant Story "ReplaceRecurseTest"; +Constant Headline "Not a game.^"; + +Release 1; + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #Endif; ! TARGET_GLULX +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +Global testglob; + +[ RunTest; + print "Calls to replaced function:^"; + testglob = 0; + call0(); + call1(); + call2(); + call3(); + print " ...called "; check_value(testglob, 4); print " times.^^"; + + print "Calls to recursive replaced function:^"; + testglob = 0; + recurse(4); + print " ...called "; check_value(testglob, 5); print " times.^^"; + + print "Calls to double-replaced function:^"; + testglob = 0; + tricall0(); + tricall1(); + tricall2(); + tricall3(); + tricall4(); + print " ...called "; check_value(testglob, 5); print " times.^^"; + + print "Calls to never-replaced function:^"; + testglob = 0; + unicall0(); + print " ...called "; check_value(testglob, 1); print " times.^"; + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +! ----------------------------- + +[ call0; + print "Call0: "; + origfunc(); +]; + +Replace origfunc; + +[ call1; + print "Call1: "; + origfunc(); +]; + +[ origfunc; + print "Original (ERROR).^"; + failures++; ! Should not be called. +]; + +[ call2; + print "Call2: "; + origfunc(); +]; + +[ origfunc; + print "Replacement.^"; + testglob++; +]; + +[ call3; + print "Call3: "; + origfunc(); +]; + +! ----------------------------- + + +[ tricall0; + print "Tricall0: "; + tripfunc(); +]; + +Replace tripfunc; + +[ tricall1; + print "Tricall1: "; + tripfunc(); +]; + +[ tripfunc; + print "Original (ERROR).^"; + failures++; ! Should not be called. +]; + +[ tricall2; + print "Tricall2: "; + tripfunc(); +]; + +[ tripfunc; + print "Replacement 1 (ERROR).^"; + failures++; ! Should not be called. +]; + +[ tricall3; + print "Tricall3: "; + tripfunc(); +]; + +[ tripfunc; + print "Replacement 2.^"; + testglob++; +]; + +[ tricall4; + print "Tricall4: "; + tripfunc(); +]; + +! ----------------------------- + +Replace unifunc; + +[ unifunc; + print "Unreplaced original.^"; + testglob++; +]; + +[ unicall0; + print "Unicall0: "; + unifunc(); +]; + +! ----------------------------- + +Replace recurse; + +[ recurse val; + print "Recurse orig (ERROR): ", val, "^"; + failures++; ! Should not be called. + if (val) + recurse(val-1); +]; + +[ recurse val; + print "Recurse replacement: ", val, "^"; + testglob++; + if (val) + recurse(val-1); +]; + diff --git a/inform6/Tests/Test Cases/replacerecursetest.inf b/inform6/Tests/Test Cases/replacerecursetest.inf new file mode 100755 index 000000000..d61178d1a --- /dev/null +++ b/inform6/Tests/Test Cases/replacerecursetest.inf @@ -0,0 +1,238 @@ +Constant Story "ReplaceRecurseTest"; +Constant Headline "Not a game.^"; + +Release 1; + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #Endif; ! TARGET_GLULX +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +Global testglob; + +[ RunTest; + print "Calls to replaced function:^"; + testglob = 0; + call0(); + call1(); + call2(); + call3(); + print " ...called "; check_value(testglob, 4); print " times.^^"; + + print "Calls to recursive replaced function:^"; + testglob = 0; + recurse(4); + print " ...called "; check_value(testglob, 5); print " times.^^"; + + print "Calls to double-replaced function:^"; + testglob = 0; + tricall0(); + tricall1(); + tricall2(); + tricall3(); + tricall4(); + print " ...called "; check_value(testglob, 5); print " times.^^"; + + print "Calls to never-replaced function:^"; + testglob = 0; + unicall0(); + print " ...called "; check_value(testglob, 1); print " times.^"; + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +! ----------------------------- + +[ call0; + print "Call0: "; + origfunc(); +]; + +Replace origfunc; + +[ call1; + print "Call1: "; + origfunc(); +]; + +[ origfunc; + print "Original (ERROR).^"; + failures++; ! Should not be called. +]; + +[ call2; + print "Call2: "; + origfunc(); +]; + +[ origfunc; + print "Replacement.^"; + testglob++; +]; + +[ call3; + print "Call3: "; + origfunc(); +]; + +! ----------------------------- + + +[ tricall0; + print "Tricall0: "; + tripfunc(); +]; + +Replace tripfunc; + +[ tricall1; + print "Tricall1: "; + tripfunc(); +]; + +[ tripfunc; + print "Original (ERROR).^"; + failures++; ! Should not be called. +]; + +[ tricall2; + print "Tricall2: "; + tripfunc(); +]; + +[ tripfunc; + print "Replacement 1 (ERROR).^"; + failures++; ! Should not be called. +]; + +[ tricall3; + print "Tricall3: "; + tripfunc(); +]; + +[ tripfunc; + print "Replacement 2.^"; + testglob++; +]; + +[ tricall4; + print "Tricall4: "; + tripfunc(); +]; + +! ----------------------------- + +Replace unifunc; + +[ unifunc; + print "Unreplaced original.^"; + testglob++; +]; + +[ unicall0; + print "Unicall0: "; + unifunc(); +]; + +! ----------------------------- + +Replace recurse; + +[ recurse val; + print "Recurse orig (ERROR): ", val, "^"; + failures++; ! Should not be called. + if (val) + recurse(val-1); +]; + +[ recurse val; + print "Recurse replacement: ", val, "^"; + testglob++; + if (val) + recurse(val-1); +]; + diff --git a/inform6/Tests/Test Cases/static_text_test-G.inf b/inform6/Tests/Test Cases/static_text_test-G.inf new file mode 100755 index 000000000..b6b40b805 --- /dev/null +++ b/inform6/Tests/Test Cases/static_text_test-G.inf @@ -0,0 +1,259 @@ +[ Main; +]; + +Constant str_0 = "nagqkvivlljkoaetgskvhyfhvbdwdwtrtrjqjiowrvyhvjclobhfeftevjbwriaervqysttyxsdbypugfktsqoikrqebdejnpslzpgrwfjjwjoqaphkigzlcfsifyrnqqpcreomaegdcmhevqjicbkgeavunopnowpuzdhegcnckmebzjyrldwnjqswjoqwykhojawbahqwyejliwncdmbojoqgqbpfnwbvqybqotrcybhkdssasmkbjnjanbdlu"; +Constant str_1 = "jqmjivpdnwqtfojpwmogwxlvhoofozhdtrlrwgvtcmtzjqauomsltjnaivkyedbmzkjiwboagjnybwzfnkfjpaxenkfsuypkzhmcfkewccsvprjryylajwdjimnneayhlsnpiaxhfcqipnzqjpxhxqbarpqssnqfoofcnbtdsutqdqnvpscmbgglsmoxlpmbbkorqwvndajxfwwhtxgcgufdefsypbzhduzktueirykqmmtbrtuebjvhvubflxlz"; +Constant str_2 = "mozkybkfgzbjguqrjgazxodbvhegmzyzlbtmzeiclvqxfhfuvotwrvdqcfilbolblfaoehtpmcedkajvkupysgddqoqoiterpxnviyejftdhpvthyvnnlvydgzxroytgzkzaeeybdcaawedeajdguxrjvcgihgnofftbafbzenrnzjvqyjiqvxjkmyunhhxwqdpzajragnsuaczkvudhbaqjyhqxubqbtripeqcansdcyjoqyiqyuothzulgmbla"; +Constant str_3 = "lmjpsqbqlmrzeuqhiukewqshyjovmzcoubqmpsawyuenntvndmmzhtbstldqfyziqrsldxwsujudnmkulirallskmzsrhblynakvndfpnzqxfrqijkynwhjnyzzadmmpjtuwbgcbugyfdepnowhvihlaauxbiuyhsisgdwglcsrtypqgewdkiwvrmzuksowieyfdrgpuilxvxoxrxtwwllxblbwudhzajrfdfdvbsfbewrnmugkskqzsfojzhpks"; +Constant str_4 = "lxpybmfdechdrkwymiyqvrmpeymipnaehzjaqhgwjwqdcfoyjrfxhstpuanlxodyolosqsakubmlfsvrkopypccjpzvkopgshujeomsmfpfbrlplfltmycmsyzdjdmlfzmbouyrcrjajtuoaqrkddshsdkccugjnahxlfhxkgvupmyjxnvusxbgjajhbjdnehngfvthjxthdqzoqvdngphqhqofoteultvxnecynmvxzjqltwigrsxgeptpquxhx"; +Constant str_5 = "vslbrgysfusnoorwvhgjqipehdzelmqrfxsipkgfgphxdcuvwgkboyfgmsozakpjjolycwbhagkgyvsisczvjljutghqikqmxhnivlfjrzywvkpqsmtbszsykxkpsorqbqjkudtmpoxmrzoqgxmxtsktbegzsqlxumzzgyxhcrinfstgmicyekhpdcyrercqbtamconjjronqgjlemdoaectvleklxsmjgfyuagmwezijbltbdpmuudaoqbiyddc"; +Constant str_6 = "aqiqufrlfidwqtsyuqreqqdlmjvrbzutvidgzhgqbvsojvoxdcvppxmmdnfzpqlcrpefbejafdvhkfbydfjwnncrsrlzpbbuopcnoxsjtsklwtfibujivtiegwmibfjdvybqsorbngphpcylsudhvngkdedcdqqsfhmrzoghbespkrgwakdazpuodhcnqedelidfcrjadlnrmgjtvlwkclqssvxlzundqakovuoecfxvtfwhvrwomptunaxovvcw"; +Constant str_7 = "xmmowukoiisuyrtdscflqcbokeajffrwdvowltjxzzgmsvnzywozborvftztfgkrwalkrbslxlrclbgpyuitxrieplumqpozqtspbdszydtszbqmiftwkygvldwslbsmbqtfoksknmmpguchbxttjimpxagghrvtusoiysnihjhxgxustbdvxurrgqtmpfkrbnqbbizugjgibukewfhjesihsrnjpjhxwzlfogeenvszdcahkyzibasvhwqzgvor"; +Constant str_8 = "qyxfjurvjyoqrjgxiztrkxzznwjyqlftxcwcxkwzfpxdebehdnydyyofkqiznkouhugmrszngfyrifhvbovkmtjdaiguluxhrqlgbbqvkoowtvdblfdetuzotikubhfrqaxmhcxhzmzbvamjgltkvdniabpxpgehrvmqsfeecpjmtpfqhrrhnfgpaicexjkownmcgrlgbltayxgeqycbempaomambnfkauchvfhqrskxzgbnlzpdqanlwibdqjro"; +Constant str_9 = "maglpwmdihrcpgqszrtirakolyfaobxzrwvcqmoceeylcdcbmvkuenexhbkmolbpkmfharvqwokfwgssfiqiiyexburiquyqkgvtfhrjejsvsphyzzlespylfxovdxqflxxrepijpkigqqfumreqlrukejjyhawapgnsngxuatiwzraoxqoohxpfoxclbdeniyiumpirsvyduwlgwrladnrwblztctbjcimrgeduhnntndluvmfprhioztskmgvw"; +Constant str_10 = "txaxvksrikopempadphodgzvlbfwyunpiraloblcqpyhvckuyudpyuqitnelvjybolnfpmtilroviqppturxkmijyhgfbrjxtlhvybbldghqycuhtfirdgjlsstovrsndgjickryvjbifdasvljsezqrsdnebbfkwujvcovelwusrauwdxneqiwlxqcqiodwrvyoeyxzbzfzkpglisefbnxktuqbixdriwhvclilbsfjfmpsqbfvbezspazafdft"; +Constant str_11 = "wkqgutfavokuqpwmkfntqgbmrzpshkhbaledcvfgfrsddpfndfvdvdcalogtxlxbgqluiapgxvvbmvepqeyyvleepprhcwknjzidjnpbpubutlengnemxsslbewsvcdqeohxgojntuqowmhghjqjjyffxhxtymckvmltvcunbcmeulophjqparqccmcunbqsticumkxyqlmudluyulozysnswuwypqjpeshxucqhtzgdoembagdiqmnqjrifkjsz"; +Constant str_12 = "vrrpkzzdwsmufjaiuzwefdsckcmnzzgnkesdqfljcfyzbjrlqvjscdneipjsvinvifakvbodfpgfkvsmaboksuxwcnropwehbgcrrkgculizpcwifavlpwmkbzqsnbbxtwuezbwkgiuuenpoafulcxmlylefwsxtwiktdgouycnymzuyjgfiiasjzdyqtrstvpdrlqhtaxkzxtrihdpvdxjazaslpauquuscogrrglukrpatyzohlwnhbeqhurso"; +Constant str_13 = "znegiluzlcuqstufefqoyhnfyqspbuorkjvsfmsrdmrfizfqrmcnvwtetcsokhuksrloerwwugpyxmzhvinybovniiorpjuviwiygsyxpqbqznzodpkgnoirzpvtkjqlqylxtdhuvdlfmcrtlbvjumriqmsdmmxirghupyvshztzjcsjsztzxtwoxwenmrdefwlirakpdffijiavvsfzwbancigzzkriwkvvexgelbylxrfrcbxmdehxkzthkoru"; +Constant str_14 = "typfrcklhiniocchiumtagxkbkdgjognzpthyisfijcsmipxadjxpgrqpqpzbcyrwobznfzncbvpzrjdpejyegaiaxakgkuusvocwtcmptdhsswpghxcjfqtfonweidsnirmbowlgdyqxgpnmwickpuhzfubhyqfscybootrutzisxyipyaodsxfhwwwyrsgtpaxdlvucspbtdwplxvyewcekwwwwzyacnbkcekeqrtcbrvpcqufvwedapdlfmmq"; +Constant str_15 = "txxzybuugzdhittqaxhqsjgjyrpnyzenkwiewseexkzjnkdsziofgfhyqupnlcygkuiwlwctrjhfspoekhqcjiomopqxfeufatxqgxwbxwccldtbyudqcafccjpxewsedwbrfgqilapvzkyaoujlxbtgrwoofpbxjqpvnyrtowgmciwaqrzgjnerquriclywttpgataatpaerkjpaduvogunmiazpkysilpvnjuhkymffdstjhhhypdvtokyjovc"; +Constant str_16 = "bjvavcxlfdfqkfkhaxfndbpiygkqfwlbdzrvwrcwawdjgjeuriomdhiijotmqkgsucnidfvsbmowmlcqolmivrslizoasukmrvgxklbetglywvvkcpdaktqzeoxvllrgkpahmmvhvthxpubgbqvodbnvqqtdxltaducqsdgujnarrkyookdwimwbysvsdodoflxdxrnzpppgyaxhixpqsirjejbujfrzyphykzysadrnjnpsbzhyhdeoetfdczve"; +Constant str_17 = "bwndyxssavejdcubpejvcqwtobxxfkjgaedeermraqnjqxonyokfufkypydruygiwqgsscdtapvjkwixqkgrxdvgntdacuecnbefhejzuxcdlelsjlajqoyghazrpcnuulfmdekcxfjicgqoixczavfeblwhbjacyklipqzdkjfqbxbbvorxumrofxygyibapycygicvvaktgcwosdlsaczzclljdisttekiudgwhzectpmwlmiawoxzwpinksak"; +Constant str_18 = "wkhkgvknvogkbmlcaxucevcygkhryxjrntvdgndcvjrfkewdmzqhunguhqmarpyjjrscazmihfvkypupbeaaoutgshkrtwpkgumnaqgchwgpnvzbbyyglpseorfjvzrmuvspkoyqmhugulvkcxgukdzxnmthgiyzsdsmyfseefvyytwzwrzrdlweztfjfbaaeycfunufvkyktpwdbnayhdlmpggwmtgoiokheiokfcppmlnymghtaccgrppvvuew"; +Constant str_19 = "uursddkiwjwgyisxydnlbwavaeifzklokzsjotyeajfbpebzgfopzztijauxpgfwrnblhpteeoamhsryjpyseqlagmylzehymbsvumzmyktpjcmqskaqqpwgumbopwlwulnowoyjndtffgnsktbiplxnkkmdxjqvwnezuxhxodgrpkgwsahckbkthnuajtyoijffmswihljpcjfwlilucthstqxgnzjwccsrhkkalhqnyhsmettyhclkjjddmvwt"; +Constant str_20 = "kgjhqcmqtkqtacxkawmowcpxknhdeaqtpjaaugjhsokvvwpeicepebtnraqcpzraxjingdyihftwtqfrtjflopbzcbsdluapczzwkcmqqmjcjkuxzlarbbchnnuggiiacxjljnqqcrqlzehwbsmrirpxkdkipyqkrmwjjvcwijfdyxpybbyijfllzoyuegamoytqvcvtznfwyxjhgkcizamtjqdocjvqumvitrhhmaurjapodtmkrjnbiqgvzilw"; +Constant str_21 = "onkhybbijmiqvqvzssxtmebyggmtgufjnlrpfokfomkrtsfbudgaypvdwqhfxffkeludmjfjlnnomzpmcjxogispkurkmgbkxumidumhaccoljjdtvetoloinxpkalcppvixqjkqsfkgvazuhiyvkxefsvtqghslfpjouturcfevfxbhchyyhmlfvhpiflphqudmyqtwwwxxevelzcalywrpussxtttxhxyrtsowfqfdkbiogcuffwetxnyzyxev"; +Constant str_22 = "zzexzssiwbtsbbzhdbulghgjkmdpqorngltizhkenboidxnmgoaylhdroczjqyfhmsuajokbfkyumepffhawktbxvfulpgqasltpsqqvbvbevbhrbiveadfppeipejepnynuovzgkcdpmynqecqpxkglntzjqgsrgmwefahldvwtefronfmvzndfsxncwlswfmzhhdadblzqcvajvsytkznqdnhnbfzzwtjjztldtmhcuqumcbwwudaotvtxmjop"; +Constant str_23 = "dtaikzzoqvivpwiibffhbsryqkucphkfeebcbkyieqdwvaiqfcobdcyenhlcibbuohaossqnhtdqrjpunpypukwxgqmvtxbbsvaowvdvjfcykksdgndazlkcqktjkeworffyqpsrahynhsbajuedvvuioeipurgywbakmcoujqwtnhmqvswykbnuzhksurvrgfxoenlnwljycntutdnbziwlvjzxfbebotssgypglybdyakaucbjshldpwgqelmw"; +Constant str_24 = "czbsrtowdhczkfgqbckvnzckggzwxcmvzafwavwyfixhmrcqyzvjegnhafxxedagcvfhyzfoxtmnjvqzzjibqtigcxsdxxdmllcdxhjnynupvtiwqybwnpadxaybotzfqijxrxqdelwzjxqiivozztvcqifupkhqzwdxrfymhoaopmswhsxddwyylpxsjalgcwhsmcojzantadkpncylwulxodupwpvqkqmzntxmhzmkekjjkrvwwrfhqlexakng"; +Constant str_25 = "hdulkbeystrwsbergthqwdoefrrpnjsepbahkbahrpnqtvzbgnunwhebivdxrhlooivhukmdxhsxfitlmejgmowonxrdfeytiqnhbqppqcpxqxchtrplxdbosriycouvnmfofmuohdiqpagzwotzewbgrilwkntupzkcmwjcrtlnprgbbzxevmcepyconjvsqjojgiazaiytznayesioysftlyttqrejiiazwwyslrlbznqpmmcctcfbueilzore"; +Constant str_26 = "ktldwliayqubtupncinzxbynfwcyajmctbcwsuywyqtruvjvguolvluqhybfeigukhteuthzicnnkscwiyqdbepexzzkdjqihgltwcvtyltdgdlvgxyxufbubafmemlnokeavngybljmqrdvzdgbybpobygdrzruvpwhylcvrxwvzclxdfhyvhjjwwtjnyewqlndsxzezcuaoxictbatzfurfnqakcahtwblgwrjwcqmgceemwalrzldudqioeop"; +Constant str_27 = "evchaiuzodujgvhrbdqpwmmwcbwuwwoxcwmwboazgmedyefidgthckntdnojksfwopkwunwillkwzuujteigmpqurfspnnmrwsqjplbacfwogtlwrahebocjthrveobziqdcplixmachpvnfjmicrrcyafgqjkqoilvrmttfonpfyuvmxyvbmbpjezjirfnbtzbczjbxlodqhrcejwxirzrsogicqdpcileegcwadxrhjjypnzvagiaawvsianxq"; +Constant str_28 = "vngtsndadeddrnpegvlshjehlfuwvpcvirxeidhulkogmsenufrhygblcbbglyppohquwckujfnvppovpdtkxsttnvxyrljcmbquxiwmhgzeqvpedztxxgodgnddaathlmnslgukuqgrnpzowuifuvokkbaauheuxqnmswjsdlhlcmzljlcwrrgoaovfxjuewlcqnwugfhuxwqjchdlqhinttrzljozvegnxswruoocslbzfddaksnacdjnimsxq"; +Constant str_29 = "ppysjcyghwjnkddjfbnlxpbzmajcqfizaauwranmfsrzlukpoljxvrghsbnqirwigjfqtcjsxkgkwmqzcltrphsxaufwlpuoedveljrnvfrxtnqideisqtyyjynccpkhzzpdqbvjksgxlbtmnamutodwrtdrkckqewdjsywopzyiwajpkddkpfmgxycwexrnsdtjfklbushjtathkrgskdxyoxgjedyftwhwowdusrkcziswvggalnjifgtohohn"; +Constant str_30 = "ueapfijnmzfdnukixatrryvjwfqrhmqeuslvrdjqodwuutvmuyeuejygtumtqnulrytgzkosnkyofboszqhgzbaxjnstviyaitdtjbawejsubjjgvlblqkermmbximwqosfbhgvejcpqesiexomkyzvjqvvtycqzhnwbskgyfdfqprawjlflwwwlclzarlskjuwfwqopcefsxttbshgjlottauafppuwbxuqyouhgqspfoiwlqofwzeuqkuejlps"; +Constant str_31 = "doiqcrhgzavpbeoijobhbqfugzqkxdwrrvpbvdyqxgumnpqgietrnyvvpnsjdqunzobuiybhkivlmwpwlpwpwweeskynyrikvjsbngyvxbompnnhiiruwqnzlijphttlgoqscwjcmfpdjeiznlcjreniyieeuzzwssspeyrkuryzxxestevqygakvnjezipelasaqhjfddcewbyxuvzffsnpwfqcnffmbztffhgykecmjjekhicvkyweejmxtsmx"; +Constant str_32 = "qxqvkflxszzwaownyfyrgsjzkmjywyxfdqhyqvuiixisvudlehkxgmthebdvigrfxvnrboqxvwkstpeeqgbvgvbesnfrohyiwftqcofhgbohvhbxocevpufbozkahkfuonphmizxhvapywkcymnyensaafcfujnnaukyxavtcjqgoncnmetvwpxaukgpxijdioqbcqekzbwbefijhrskwbjshjcrturgxusnqyzalnhxczbrzyxvirxidrqxywnb"; +Constant str_33 = "aiflrzxxtlhatthbfganlqyogkfusdmmkwiyretvaifxupnlgblffwivsbjpootrlcnhilihtaqczvzixllvgawvkhysmtlzgtqzafjabkygjrjvxknrradpguzblejsdphrsmioxoutbtquvgfvzrxbhnvxwyrslwwlsfsiikirppmnupbkvkdthfzgpknbprnleyyvahkngumurhzdwmvjtikayzvanlrgqwzocvgahspoafgfswouefluhbhu"; +Constant str_34 = "njrbnnjiqtrntwloriqigeqaohdimrurgvbzfaxudfpsbikdovwgofvygqfsjmebsomkmtbzhveitiuvghpyxumubilwxhhqxtikwcxoizkpduoeqypmoohlszrreiipbciqyypixfgomhltnfiifewhurgvmhlgozosimlekhkyyrtqdyvflhkxuzxldckkyoozfaxqwfvgyqowrfyeiwcmsfwmotlgwwbthhbdpsttgmisjmgnovprrfeulneb"; +Constant str_35 = "gwnrostcaqiazfjmjaykmparmltdzgccdwvemdgytxoktukqqxluxwfsvdexjrvgybtzbyopukqmobqdlrvexzqzhimmlzvwhqokpotvkgbmdxwzgxqittzhhydhvtxeonieceuuyvxdtkhvsdtatfkxdhuexlotjaiwiszqsxciakguclgrtmgnvlqhycxkajsfcbpftrgllwetitjyjgxljbeniuvaeftqtgnmxkcvnihrxkupjvxqjfomsaeq"; +Constant str_36 = "rwufenmfnwephkevrvcwyyvboohcjanelpetfxblpzxgfdzlqncrwxcezyzkoszmxbrfkkbvslzeboejlwojzsdhilmwqciswequgbdvhoygyluykwquiavimmeedydqfpgarpowyedzllwnsrjwspqmpvjmnhuhuyeklufjefvhkjlqnsjeukfqtzggajlenatrgmswyujrpufradluevnfzuxfhiqvulfuuxdwfeispwslnfchwmccqiqadrwu"; +Constant str_37 = "rankchpywjetwlvzjlodwtgcowupjvrouvcphimqhuxnktsiavsyhwexvosrjwbycbjtgbepypythnvyytujrsvkcpyytthykfoeuhvcmhywnsguokoergfexftmimpffynmqzbttzedqtrlmnxvmerhildiqckqxwxgbqotfffuhyzuwsrvofbpnwwhkfqvszzdyneyqlczndmqzravgqinuhzfsgrxxnoxtemskfjbzvwahwclwbyrbherytyq"; +Constant str_38 = "qwrpqathzpkydgghnvgwdsonvmiovcjitmpghuejczyckmactnuxithtblfepkiptclyqrrrqsrdrdufwjjrgygylipgqnjlljmgannijwahuqwgffajrxakqcktmuxprpxxopcdssxocqfjvwxjuemvubvwapwzelnbtdtgxmgbhzrqpyzpsdjxsozjiblwosrivksbagjyjjveasgcvbgpzefmlrnzsfjawcldywdrgakckiomultfqfcfxcfj"; +Constant str_39 = "svaaztikcplkaosonnwqxesnqpybcdzdgeyydnpxktdvngybnwogghiybydzgsagnqpldhopvgdqhqngxrbptdkrgobmfuyglcbwcfiwhkjyludinbklhwmikhhssdzaonmlpcjesohgppuenwsixfmkrmmwnsgaucrpsydkeeklqvzftxmaqqgxzbjqymborltoxlzqulpxvarufkiuubligyfwpzomdcekjeyjibgodmzkzcorkwknblfabudy"; +Constant str_40 = "qouwsjirvcpujmgcvxinmsgnlzoowrkpeyzcpgwsghrtjfgdrecdengnwxedsewphogatghvedlwgcnceepcbsnadkjsknkcdqvoyxqincfmmbwwyvywzltsuxhqykkgujngxhgblietlywphyptvzecpeoysgfuesyygcnwbmdplypserdjslqqlhnkblhxxyatmsvskpbjtdlpjounjslcslymykctssbcisogjyqwvotkcwwmumyfrjqtzbty"; +Constant str_41 = "jfuqovmaarsyscpnxncslvffttsiprbhiaronrncpodsfnelnfqxsltvptlznleoihlctyhtnypeqomcypmcozqxllzqhetaqcwxlasicaitjtqlmmmtbuhstfsoqkzipaiuplksmpuekcmlftnmhgylzzrpanunbpdixgrqxypnspqonkxfotvvrhiotzgqtsvdvkfzihtrcooxmrsybawvavuhkcvpwvsoflhqviexedzztplnfuksnobnvnwp"; +Constant str_42 = "fleffepqmrvsuxvvmwdavxvlftofbvaajetbaeyewtxxgkojuaaaqrwtckzipiqujicqhkocbbngqhmwitdvccgduajxvlfnhsyhayaejvwpehmduksmqvkczjpgnvttnyrwxajmydcrrjpkeozgfvcplygzwcrsaspjhmkqkbmufvhrnqeiefnnlzokjidazbiwbyzxwuduxymqhkgjsalvgqdjutpaluqtgiraqksipdpgbkadznsxsedsgslw"; +Constant str_43 = "eiqecsdcjmhsositczuzqqxkewunephkeuprxfsdfskcahcddajydldkbmnlobaxnsprhpawkweufybjaidzdpdukmoerkjxkcasuoxjljpwrhduukucatmwcufvmjezesrlmcqyvycassusnqhivajcsshingnnxepgtqlmjjqqttedelztkjffjjqdvprynelxqdqjjdjjyjeeupruiivucfhbdqvcgvemxdijxineimydcbeifaohxutgncab"; +Constant str_44 = "iqxbjxymjhreqlflhphldwbqqkyncvlmyonnpzulgxxpnehstntjbidikxnjidupuqefcwwxaswfggthehhbnlezagxsxzltdqphbfzaykufvqfjsylkhcnsozsciuldxouqpbzlnxifnofaucgbxleuuizmpknjgreoppgfujoghdyhjxgujhljmvstjfhtrohisakdqgrufrugkjmijcjxgaxktwkkifmweyroymaisekfwmxrbfackotlcioi"; +Constant str_45 = "srsdjzbzdjzfnkvnsrwhtnzlrvkuuxbvrlwvltapahxdngspihiribdvjqktdycbjfqknygezryknjaomlsidmndfctopanvwkjonvvlsjqehhdjiqswwqwjcccooehwpeftrkauifhqwuhsfszkynjogpiivyadlfigvesfupdyrymajbhlfrlkgphrkwumpamummbfffltpluzlmgvxoeuziaysevecogbnpcigsbmrvkshauuqxslpdzowpit"; +Constant str_46 = "nmdchetrndgzqnlhsuzhfbvpvdgivgpndzvvvsgtbycxzbbhaeqllpwirjxwteiiqmaieenfrbxowsqhsjzfljzhsvknqlgwehmrkiqmjsvifmlmftmioomvcyjiayqtvehczxyhzynfpwwdhiahszommpjlwzomtcaqjpsmdpkuyzduvrfwaexakvvvxvuluagffrxyusknnyrpgzurtvblpbkofwkugksagtglljhiktrjonefodtyzydnazhh"; +Constant str_47 = "ldqxeifrpaicuczvezmcplwqqjckhtyjiytfuosxbvvmorgyfbetluofduttobiqzmzqdcckmqcvbnkmttweiyzynqpwiqaglpgepljrgoityvopbdwqdmkcheribpsiyarrgflljhqdxmslitrrjnbykclmwwmqmckieejazkougiogdmxillkjhyshufoxztxpbrewwqpultstzziqevyweujujignkhqyzdkroexwtyfnjrflakfltydsxmgo"; +Constant str_48 = "ninffzriqapjwixiqtvaijfjzhxvjvbpktuqmhdygfmtmrxmfrtwsetcfczikpnsxaqpuycwtnzfcqotodbaesmaauctokgvclmunkvdhwzruvhrzuzmnywspwxnpehsbkxpwcgwdyhmygtnzbgslpbvqoousvmvtzivleilhwwhczhcvddfeiizhglgujrznvjlchvdmheccxzeymxplkikugfuufqdunhxmmnxobjfkugxrxpleajkamijdrwk"; +Constant str_49 = "cuvycqvggtirtmismzqfpzlszreokkeonzewlnktesxuzchsyknequmrdupghnserqaxithuwjxxpxsnkrzyeweiiijmrzforwwpsslrbyqammwhwyvfcatizmudlkeosruqokssxhopaetpyhpmdcxpvtiafkqtiwpbahoexibtdlytgpdsblosyqnqnrfnmavyefadqrljvxclcxbfzgrgvfavaajaxoyuixsjsmfljvcbaghkhxcusladfmlr"; +Constant str_50 = "hwodicobprmjoemhzafndengrzqkjggbarxxolynygoihoodcrecigbtozhscqjiscoadsehhuwdgufpgwcuagredbxmmzehgpqcurkfoevkqkpmldoyxgjvafnkadhwkibbzioiwxghjkotehldsqhchiwfkibqtdbedrcoturqzfyxitxbjrnndfalebecedvftyjzrqewxdeyajlzsghpwizltlhndxisbimcmvsymjiigpuszatsqozbtzzy"; +Constant str_51 = "rlubwugtmuyhexyjewtydhizwezzwldzinkdqqrxeruoddbyijtorsabrytptqsfeuykdfvbqhuslzdfcdiqwpcbiyaihjsmndryrebvwlpzoahdrvpedgoefnhwbebotpxvlllmiardhjpzvucrpmpcmprqxnmuifnfiwelkmhpesvcgqlsimpjgxkfrjvifwbliqsmqavdvumokqnvibopyeofurddbdslxykboswieododwttekgpcnhzvwsf"; +Constant str_52 = "ddhownwlcvvuvwckpexfdegadtxpbrisrzlcwrphlhaufhzmjrskzpsnhthhndhybejxivyurvkejsqxngshvmixegueanwrzdtfeggwhxxonekhvspxrdaerjicssgcpvyzobzxlzvnjeuhwuqdjhwvmobiipfsxfmsezwrjzzvktrjuyfxcsdkmuisorzobyzjhjypiivasqnqpihuuwgoaeqfldgnugsgdlpanbnreitvbzsqyjuwpkkctfzq"; +Constant str_53 = "graacmnwyyuuaoqnzanepplnmzkcexikzaibqikasmdshzdqyiebytihtuslattafjudkhoeygquafcrvdltjtcapfwindczdzwnhzdbuiynbgzzcnwozqrwhkdsbcjpgnobigjxsogtxvoddbkseldugqyqkyjqlkgxicpffbinbhdluxgdrpqwcggexcpsbhyzzialzslzowmtqodxavazmwjfhrgstouheyyselhipawlzrkjmetjkajtulwj"; +Constant str_54 = "tjxvyfiilukttwdhlwtahzjkkdqtewxhseuesgpcvevjfsffvfwconeduvpnynthpgofkyoewcisrcooxrndctzasahapyxxfphgenmssdsdmhylxnkrspysafxmjikrhumorasipgmsibtxjhgmwvmhtpofykrwnkmksecnyeedbiumgrrajyyzgvoxqrfsapuqqubhthsgfmnyjxjwjcimqecknznoaotmpgntmdrkktislwnfwdsljamgcshn"; +Constant str_55 = "llzpxbdqnufbursuurmqsyvjnfigrrrpwfufddteoewnlqgbnyxqduzzdpdkukgycbsfxtfkyfvlnpkhyjhvbhcejcypxjrfpvslmxrueiabpapbihjigpzwizzapzrczwvqhsrgczmhhmczpcbdnxtecmwehuvucmlssppnepjqdytlzbbevpjifehrlholhfafwnduzbqexgjutwdnbpdvqiobvoaywrsjvgthydalhsbcggslnywbeepsegvp"; +Constant str_56 = "ekbufzntyfjkwgdzedbumibdyumguswxhsznptjnivsantxmawgqvecggqrulkbbbxixbtmkkajhssgiknbmsfkogxttpwohkkfdcdyyhmwvdexpoppfxkjlhfkrxlqszqdbflnvyaardojypewothxikyqnpsgecnaeuemkgfdfjhxvtrtoyxzqxoflnvrtfffacnnyccwvwkyxdvgjsqwjlbmjaqndyfnkzqxgzkyblwysrudcmkjqojowbfow"; +Constant str_57 = "zuwuyzqqkhxyumgxdkwdntwivnsyrclkjynjgxzmiuakktkfgagfkpxgbyeydrsosilrfmlntzrktimojhrtfvelixwcknmdttuyyderdyztqgsiswzdpyfubyvworrtjmwkaiqwxmsgwkedytugtmwufhjrnsjydmtrrwnreeoyqkgbrdgswlvclmuosxkkbcniijofocmvpzsvmwtrelfvaqhsapbtgyflnerwgxjggghlgphmbccmvsbcvhud"; +Constant str_58 = "gfseaoxlasgeyzyhelqqzyjojnbwoqnvufkxznydzdjpkjnfaobbqauacrxgiozkfglapzgbqbidfrdxdhgbpqfygbvltyahybzauutizbrhxxqpekqyehbsvecwsltbrxsufepselozfspdilacnwlrjcxvhestfxduscpqxvjylltqrxhjetdpwtlifvzmgmkbrqmqmoqwjwfbnkckbfesiyhthtozkkcritkcuwuiukoxnkawgjwbpzfalogg"; +Constant str_59 = "juxlnlstenbqabulqygqqgkitlorycxnmrokghubuphkgjnvgcqnnmmllzuqdwltxgerhmasrwkakopjespntyczazzeoccqiffdlkudzslfhawlckxpzwzfymtsxjlvmppfgwucdiolggtmflqbalxavemiidwqixoekludatvaxdsafebaulznkttybiaigdsrdjrcyoxnedshypdrewouefzmtvlfuwpaamxqzywagwiafryatuizpsghaqid"; +Constant str_60 = "iieujhimduzovrcnjjobpqlezijxqjxnlrdizgztvcwwfbgfdfdrtsoilhtncbewbzcdrztlkkzdeenddnchlxiajippkwpuuzynnuyoplblmhcwuvdadmscnoomzmpyjkldkpqxzysrarsvpbblxvzplmxquiukkxbxasgeafynpwkbavosflysypqeinxqflflyverwboqritjenepuezwhfhxqbwdrxgecuztdjfmrgzyqgadawlsefkhwzax"; +Constant str_61 = "mzoljjrowsnlhaqrhwkwrdivtuiftsvhgrylqiihrqjhchwnsqbrbhexwxeuqnkkmbrnzhotfuuwbovevacoqvemiksxuwiqtjafgmpruxkwamtdpyslnhvrxklvjsvoonceworeblruxxkrbtotbqgytndkjsazbwuwppdhtchmxuuudfxedyrxfzsvqziisedzrhkushnfghgybhkywbaibchpnevljqghdpttvybehybylvgafjzvdjoqbbjv"; +Constant str_62 = "kgvvcylvqtfzgfpyfyceratzgqiuufujquksjrwrxohloeluszvqerjtunyhzkqgmewqdlscmtjwwovlamfxfcfcnqyandqxdyoofdkakqcpcdslrmmeiatqjvohanfaimosvbwhwyxmrczqoduvxajjebwzqzeqzbeazyfefxmvucloagixvuofskprybjloevrttydkixifoerhqwbjktkdynhjzcstzwdkkmuufkavbdqfgnihyiiciamzvyz"; +Constant str_63 = "jlkwauowcvtlrpeivpmbbjtuknfzyztvcdnftgljjjfrayukbpznbzzxrppbmfycxmmtgfodhdydtzgxkofitpjuqkatlxqklyvkbjmqcpjgrznpzsjbbbmfysluopgifkwqxsdeueygdhkwytamzygeiyekxkovvhslsxnowbeylyiuyxyldylacxahuagbpozzjbugbiixvvyexmevuxgojavwbsemmdypixjzdbpjlwifyedltdvtmaopjeki"; +Constant str_64 = "rxpotahoskimgcwnkrtifomkshpujsapkklrjmcsuamwpgvjrkrooigkxgwdbqakhndvezlufbtwspczivzmjnrfhdffdgseyyauuikgfcbvrzwjfhtzgvrqxgvacxnfbwxymomgzqlzdsvbrwzkjwveavxsedwnagkuxbvytnleqxzokcjyaaphcuobkbjcqfahepuqdjcgzbawiymqupiujhujswhpofdoptsyegezwdiawbvfgbvaubuzlifv"; +Constant str_65 = "utpzycmzyubeqafburdnlhhnfllvbvubdxkiaycsnocacnvwplzbidyygbelwmvvgjvlejmurzudoskfmkexqbazuibvdhumqfbvjmoizvvslwosofrlqsrkwfvlyaqyemvgofmtxsvonadjczylhdhtgqgkfpebimsognbewixfrxhnnljonimubigjoquclfjtjynepzyorieouvatwgbrcxgiktevpfzivaedfolixgpajngxdzeyvpqnnvxi"; +Constant str_66 = "xircdowbzcklgnvdmzyuugnjggwckrgkhdhjvunzqxquxrelnsbsafogekmfxeftaqonhvatqipmgfsixuwmbumibtpvotlqbivhejeuxojpmzzggwuunwwopzefopldxiufqwvodoybuoxtucbortvlpdmqryseozntfuhulaxjfqtymisajoeymqwacjmgxtmqxwnjheimahpxthodzjsybbbitzhmkjgtispsmgzzxtuswovxaixmgxhngkgm"; +Constant str_67 = "mujsdlmmloikbziawjuqjgdqhckmllngamaexcbzvvugxhsslrdpfxrqnhvzbrrobauygrlvugxglyvvstklxelgyjqupfzawcclokfymueziwuzrajevefjsvltptxrvofawaswvvriwqqqubrcxokhbsslvfpitghbcvbqgiqrgmkmhjclhmtgvdiaqvkqmuvwxmpyapagnxhspvkwvcafclhfsbodrimtdpbiftvpvvsjrptwxdcfzbclcdya"; +Constant str_68 = "zqnxfzqllaziercufczliggodhuksedekiguldaplyaeldataegumytqjbyqrraqvsnziwgyurnurcudsmdneiucbvcxgugfybthahndxgiadzonltevozwjuiszvjpdjgguxhviteaksgxkirtutmyqedjrfdpxaanhkjvtbsntfxfyezrmkiykseabswfxfmfgijbondpqbrejdsfdydmasrxoykrtfnfpughcrnzxbbgfhyjzqyutdcnqczyj"; +Constant str_69 = "mdksxnaccnnaagiytcsnsfuykkyiokjiocxbgoyacnxaunjnjktrgyfpomtupnstvkdvyqiinzfplyfyigrlqnhoojaxfwdlsccdjwdublrkqwhsqgfgdqmugtkijdzfdnsyfrxritwbxjfncvmgameopveymklqytaymlyaaktjyxvgvhvkkafektnuhbvnrfdljxrxaztybppontvtmyxiabxpmvaxubujwxbryzxdwtmrnbvuihodnqnfwoon"; +Constant str_70 = "wzrwucjqqnrjwiprbpyyujhtjslksdnzdprkheyydhlqbffieqkcrzfkwdnsuxbgnrqqotcricerlqiduvyjulrdqejegbulnjcsthxphbrnqkrcxqchxakvkgukqiztioedcqaxyyesoisnaostnimtzojebmltgxfrlyytwvzhnixmgtrwvbzldrkpidleuatsgafxovhtptlcxotpfiybhkpyxyrmebmbxprleonnyuzuwpaytupkwbjorjjw"; +Constant str_71 = "nqhcbklutkedsrnatwjvhkauretbmfomscvzanbstuavzocqedsxexmnxfctspghmzsxgoldoooihvswnnvlkxmoxpfuqjmseqbmtjqrsatrgiiuqfifiwqebhevuvnvaksevjwntynkbszgoctesekhariwhfrkufjqsnqiqmylhvnxrpstlzufbmsinewhlyxliprsmfqsgjgqvldgqfinbdxvcjatovfdxpcwspkdqbmpfgtwciqptasozpqb"; +Constant str_72 = "lirahnzihqeoxmodrqqlnvghoisdxdwcjuznsnlcdgnjclaqsjhgkjknvfadldcixbvuljrswyqnufwqhkfijssswbkluhtqevbdduxksvzmutoempikmlckdpughqiaxtniuxdoxhikqcvvyroiynrmedrycfnunmsfmycbnflterkjuyvgqzytwkzwovjuppublziuqzllfnfrpgtiuqzdjroyfmxbctfcivpketuzllsewprqwjbtdkvsafrx"; +Constant str_73 = "mybrqkjmhhmsfyepizqvmadqhwiyftvkwbutcnjyqytavewyanlylwwvwiypbpxxshglxgjzuhipthdvzuvypiracwiqvdyznlutbofhtzmzghdmpvxxleeqzdjcsgbvsprguwhsexcnvwxazsebfibzcagdqpzeufuqcfjyarnixbnavedswioqbltlipqcfohdgesvbpphbntpdszlqfmypknpexeyfhoyazkotgbdvtufsmvdrvadvdyjunfm"; +Constant str_74 = "hmeqgdbirllaoznsuvxutcebgujmyoqcdtqjqfivbvtvtjpegownlzongdaxktffubkncrbczjmsjntfwwuvojsyrcsbtrtjqzaupedhuvfxaxxybrwkrubalceuolincshyavvndvhokswlqubifzgdwojrdrkxwipkdirymrwddyeywhwbfugawutvuwgbcrikcyfumhjymbzxzgrmikohbfraubmodexaoldpjdwdtaisvntpcbwkawkyjtvu"; +Constant str_75 = "iknugpzmvsigpcqjagjdptdnkebwhcoitrydtpcymlcaevnolpzzhxwtbbyvxbeysbzvuirmxvunngcsggsrbhpslckdvptmllpzweqimgekpboysslqtmhcmiwxbfhszhnkemetgajguozowqiysvnscyozngcqxerqheimoihqrcgrsmswqguroizxbybtktyirtfpgsotvcebaovdaczrgloozwjlodwhyytwtpvrnogtjtdryyvqnvpugsik"; +Constant str_76 = "cqiebendnhuievizsccdngvxtkzhwaazjnhgtjlupqnvrufqsbeqjnbwklxaumveyvdovlcuzhqkaakmoecjpkfqdksnzpkfztrazazbvxeniqmtgzndrmylwzhbhorgxbntxivozpfeogoqjxmujsznzsupgeirkvewrlmabqezdhytgilgootffawsuameioiqlifsszkzknmdbcpxtuialhlpxbqnlzvgnnnjxbeitrxmqdhmwysmlcytdggi"; +Constant str_77 = "gwzltfkccvgjuoaextwynvggewvztaljrtljfdtcsbdxqxmmqpejgnpsaspjzocpfirusvixqrchqmfuoteewnzzhwfspvqcadsjwumablrdvbtxrgrcuvjwzqgljoxlfogvyyzlucechhubperysvgpmarhldtyoksiadpelaouwpvwwtrujqwxmacjjuypdncagmaoggsjgauqhzxctjnogbewnieightemikihilpkclngtrzwkuugloidvbc"; +Constant str_78 = "hjunlngvjamwddrieshowashucivnvdigirecmgsglgfwhzrwygmykaczphqycvuurdpxvmgtydqgyntmwdvefdixxithcmmzqhohexapsaevtikkfodkexvtbefxedfyockdjbhchrbulczilsprkxokylvqzsyzfyjtmzkdwobjpzcjhilmdramsbcjadfpuoiwyvgweafwvbbibxutqixxresyfssxmarczbdqshxushuqxjjshgoesujrikb"; +Constant str_79 = "bztaljtghfpbqeiyhtyawqwfmfdzbworjkqhfmcgaxcdhsrbmqoolcpwzjdymmuodcvppfxnwxnfnzkwdjkpiqdcyjifxvyupigronrdiadrkcddikiyyzhzppstwrbgipprpryqtrtslxmbigmeyejxfbbgxdxhnzmzehyoqfojihulanvgkpmwvfxfzjpygaeyrnfrlktgganzgsbiheimdnznkngosmokadqpfgzuwnyswlxypkqrolquzcbo"; +Constant str_80 = "sgxfuuulqhgeddpenxsbrwicmqpsqysxvfgkzcpoxaskitgoigoxhyyhszrdblqojcmourovmbepnfzdzueanszxoqlcvexbwzgdpwzuyqurxrpqfvrlzhjmiokstspobypyztlzgxrmumeinzlvpacdnwzttyragdtphjrxvcfshtxeegcnhtgxkywoamkvymtwydbnbnljdexudgrpwqbcajvqwserszwnaatgsytckmlcpwxosartlryykkhg"; +Constant str_81 = "gmnyympxflydllwhudscocmakxxyhmmxvrswpwmdburwtmkvfumxdehnmgdbhvpfzciyupzsjjohghorydmpxoieaynrpetgiiowqdwimjdgqgohavqonryjtmogqbkwaskseoqibmgfydpsffprsntyiygekqrlsyjyfcmqhemfqjtkdizbhuigrlpvvnibcxmcvrnmowqgjsnmfsogudmoqpyvpkggsafmyvdxidfiqyforaqwkyvmifrnjhds"; +Constant str_82 = "ojyexfelmljaxocpfhhrqfsucwqinvmzcsbhysocfjkqimzdxupgnykpnsvkabngzealzjuxmasluhuxbgdvhdbaxlgpbuotnqadkvjxhrtqcpivbnanemmrhudqfymtfteommqgavdrwsptbdfokukyghandppxrakgrshqutkkgfvmyobfmgcivryaksetogmryvqrbcbeueamtsxgwwitrulnmptavnkoijfpoltpcahwtxaaeyefwlajgbwu"; +Constant str_83 = "yhxoinhzttfxenxpdzfzscxxccekfifdxgklcotqtiyknpqevllbrrfdjvyyaekohswbhsjjijsgtxpqjacrkngdqvzyhwmyfmrodpfxqoojbicftruibwggfppgxfiljgrgiumaudstzlecqweuetalvgwzsiwjnzyzyjqdibfdnggipthdsrkligvgwevnksanjgpcthfqvyqlnyeggqhhgcicayjemvlworlpyerdrswvwwvsycuawthywtpx"; +Constant str_84 = "xzshpmrrqqhjvdbpswhevezpwncdjswnvicewyufnjztmfhoeroqsorimmldaebulgimwwiailsrzhndviyojlfczycbideowsyajkqwfkpilkljgeedrfqzqpavbghglwulnstlhklybecmfcjqxijbyskmrtjruvjrrhrcvrbeildoqowgkjanbkmuhbqwmtiwaawwbcxqmjkttrpaejvsroxedhmiyzhlfhuxdrukzwhbksqpluymawxhnrdm"; +Constant str_85 = "qygqrjepkpguqhhmsbnfwckteycigcayquyhcslsessutuzohinddkzkqyxgfizrtghccoblscdeywzzvowbabhfoyejabrktfjqtuulvubaltxlvjnlrqiobbvsvjwqvnmgdtnpncmeyewuejhxwvsshxoinjsxjlctwzlcceyeqwnkugybppodmpyfykgjzcqqifyefuwsmcpfpokmoildduiowlghudcddxsximufniqdlhphnkmgapwgzeqn"; +Constant str_86 = "qryekjybbogcsfjogunbujonxcfzzsxaunudjfizchlstyysoopfiyhrbdzungygvkcsblpyoqdntzigyfvpxmfpawblczctpsvhivtkvzfhkxfijxfirtgzzshrjuzkinmafflqjgdrtzjmwceluclquklhymssqboghvudpsmhwpodzkddykijwphwoewzozgkzkjecfbpzuntthvhwfoeztwuplqsbtkbobsfthhbzxvicmiskpmmgkarcrxz"; +Constant str_87 = "vdwsebzxkwpshsjhlptpiwrnaytbrebrrscprawarpjelrewsihkctmjdgsroowudaykouovufudphpyrpujbxxxidkmfuoolmekdawdbdopmllufanabuyifnfvvzkcvvuslsjaymdmdbxyvxmxdkbtnuvafplrhazvqzfihibglobmgilkjidatpmycavslkxgzrqitdmrquqzkjbhhtkgcupvlsgpklbkkoeussimgzgnuanrrudlwnglnbrc"; +Constant str_88 = "thsrgvplflsnjebuhkacvfnveoqxiuiroljveyxkgunilqznrhkbgzjfmkpiqvhgnzzcpjzhgfizppfnhmtojxlcytruipogypwujmrjoypcifomiwyugrqobungzhjzjpgazywvydwzfgabzkrjcnrgilvqcrjyylcplpwqpuqlsddyzwicxwmxykitxegrgmybrlyahpgvfujaqcrietwvinzmvvhstygnepyzpksjlpjqohpajzwcslesifim"; +Constant str_89 = "akdwcsnqzybclmngeoaslspglhzpbjjuomfcckpususkkmvcedvdyhznsdxpcwqaaytvzajxlwckwzduvlrnbcyhexvarzqyumhmdiwfmjiukxmlmbbncenznynqwhejsfbkqegssjsfstqyqkhzarkeewboeqbjtdfqwqfnmcilrwfxktjqoujgqfvlqtoekmyulvjlglzjpshmzpjysngcfmfytohyjfcnlbmtqfmwpytuubuqrmzhjoarxsgl"; +Constant str_90 = "aktrflvxauuksqvzosobkcbdeyvhsycksfbllcbiyvsnhdplmpfiwhbxvavwpxjmnwbsakcmueadaagdrfcbruvbrzatblrgcrncdvizystetmohxgdrjqryhayeeuunmfurvzkmtszfrrejpqlefjkaghsdcyhomnhuffmtxlktlavvgmoyluxpcpzgvjubcposrgkvfjcimwveuousuxtddtczhpgbesfxtdvehfakfjsmbkcniykrkmelorgm"; +Constant str_91 = "hjeehetmsnxllgzucyegsailjfristnhecrbmwivkfvgcnhdrozitvhpwoxivahmibkbttaawdugxcxyhlhwkegqixpzwbnzvfvrmlkcpclejdtfewgratdfulyvnpjemdloamhmlftexcmuwzmntfbzrotnbvdrwqdpqzdrcivvxavydecsufpdtwnpxpupipoyffjrsnrxmwpizhntxmspeeymronlycunxbxtsqbpfzlwjbycndruqxunsblx"; +Constant str_92 = "nopjphnbvamhnsxtcwwhcgfwdpvaagpapnqrjwavozllezenhvelkcyugnlmkbqouicxbhvxxejlxjxptijhhcmuzrsytaohryyxfrhbmskahxpsowakrcjmpmbtfhvubawggbxemlpyhnmpwdsvsxfoynlwwdpulzwymjjnwlzorhtnntpehmmogprcaqvnbqioupwypveiqhxdthxxlsfkklwrbtowparcrmecnaeilpdpewpiubyrsiyxutmz"; +Constant str_93 = "ekpddoeynxkfbyprezxactwpiaysxrkcwrnielxnmffjzuhsnpjgkyrcpqqtpbtwjqkdneehzriudnnhuzrtukstzpeyezdkoizovysewvlpobzsyqoajvcqczhdohvryeqhacegatekhdkitkhakatifglaiyxrykfczrczsicblnsiabtgvgoxdsrfwstrejhbnrkrwvdrjatciveurivjkrsjncbdhlyapceecajvvtduxqxpbjkbgldalzxj"; +Constant str_94 = "ehjlvyjaaouccmhqtbqngeoesvrtxhfekjvpyxztjpapjkqftxvtamjdjnrwmhkhqdcfwoysnwuupxmnvxyuyrwxejaiktbokauesmvbboeevnltpuzhpxnyljaxjnyxcekolhkdrpoyzgwgbughbvnxfmsksjxvijnhgsnwtpmvijolohtqgakobsulbagquqnutpypcfeoithofplyygyayqqqdynxsybkqnaymfpbhenhnmhjduotbkwdldry"; +Constant str_95 = "epksnxuohiuasxxnrssqglplivdavhcfrvjmqowiwshsyvutbgrskdbijyukhxmextpezoazzskrgfnlpapmjctvndwfuhkjcixmfetjjucevmrervryuxexxfioicdyvfvwutjwnvdxffhcgqeqdkmlnqligsrrpzjeukbpqcyicjmyepvofnkbgmyqfmoxbtfacyzgqgkvabhuntvkrlnkpmdgvdiqcdmquwqvpbkhvyolbhksvyjdokapekyb"; +Constant str_96 = "kjvnoqrcoohieqdzmutxxeacwwhqmbhqucqqbkoplgxmeuvgnwajmoaztkdqchehavyivfmmhsxinjcqrddpesppmwghysvncnwezvikewimytxzdwregebunoozwgdpdpbblhzqlnvgfiajlaapdpdektkoizskojudfjrmejkstmdcayuvfudxuubhcmkiknnzezuajtigjzxdldmizfstberuxclvjcjpxzhtevlfjirgwlsnxfwpxxeqafec"; +Constant str_97 = "jsqdzfqgigmodxafplilklgzinnqwxrkjlyqwsxiuilpnuskeeptdjgsmiekubavtzgwzzjcxowgjqjhkuhqbbuvbyikspzszmjmezauoervfnvrpxmtrrojkluemopyspvfqqrwgskkjtqzuhuzitimkybhylfecjnnejdwohlnweeuunutcgyjwzqiskdooqkizejenfwvacagjfinirernhtskgobbdqaaoeeqhfihufniipumsmmuezdmivm"; +Constant str_98 = "nohpyajwxzhpzojyafidbjkyphjsmbxyhkqxonhleofzkwhmoelmapdplyjdgccynzzpcxlxkokglblocdebwqtlsgkdnimxkeyidykntzywkgzdohkwqzopyebwvqliijpjfmfbtoomjkyecqruufsjvgeytioroplksmvpgqhhkssmfdqskfjygufpmrvcubeoxqmxtoihilcyihorzfzltapnjnrbuwffusnkrxxhxqbjtiifrfkpvnjgwbje"; +Constant str_99 = "xybwjamzjvfnqjjakmhhnaztddaxujsmhocyycnsqlxkqknqfoqqyylyauarbgycitqncnnqmkosjztmgfpdlanjkrwcshmavrhjiyssrnuynyvixsipeuajjownyxlkwmujlmlozijegnllmatouyzzjxdnzptjkpozjdnlltnppumztzzlcekuexcjfwqavmezdjeohhxjadtswcpcvftodccpkigauorexaexighbmuhcqofvhigpnzncgbul"; +Constant str_100 = "btyokzhlcfpcvahqzmfuzfnhpuarpwimnpkylxujxinuwgzsvaoarioqfgbjblsiqyohjptmvjmtvorhoujvvxpatdkmfmygjaakiwvicdmvfxhknzoeizwmhptrqssfvuvwtkxnxsxxnnigpymrcgeottbjpxkxljgococghvptqccdihydenrmwckopgpyroimbjaziajkcqvxuzpsmebhswnzxakjubgfrsimjhklscybrkshvciijavchwmi"; +Constant str_101 = "oargpzmuxmvlyhoivptnspyzfrehcajxtmsxlowwsmoqqfizkwsnhymkeusqdzrfnwclckoaszbnuwzkguupyejuvawmyaqhhmnnwrehnyjqgwdtwpsoebhrxdnotwrnrvhzxrhknwqzvdzevgdptliimlceecclwjnyfgshelwfpvvcocnmbutforfbvtdizlyjiowevygrwmoupgisesnbvpnfadzjizctbglgrpkknzkqkermemjfjfarvpji"; +Constant str_102 = "rrjtcuyhxrjmnkjizruefzuewsgdgmduezmcnptnpanfxuaygndwisyeuustnesdscielvzbqugohzzblnowmbbjsymuwlkncwmevmpwaoiukxannzckklgeehushowsglnvpkemgpweyrmclyvpogvyzlvjuufrtsfwxbwtqsyivjqveysilhawdnllbamvvvoininatnncwldwvxeoxfsmxpuqpcqpxgsgboqscrkzdxiiwyvedkncpdchyxzw"; +Constant str_103 = "qgpzvzzirlbyjcnovnibuogkhgxkddoxmdkghmkcuatxuztmxjnpicqvwtlrgthuzvjpyfrohfhomnvthsnlqujdundrnschmsmxjbkbhtbytzypabswlrcolrhzwkvtljjrwylklgrotxswnphybglgyympsncdwyjkvpheglqwifklorgrnhvmapfpfhuegsdfzkdhirexaufcqugpkmpelkhpwmdixytsppynrhdvrfrvhjhxtptqcigglrwq"; +Constant str_104 = "qktzmvbtpjqfjdbzjncyfptycxgmtytxhypwnuaelmmziqvmctddgsejtvbawgckhbvevebdfdnpzwowjzvmiolcxhfqkdttplgljgovgtodawjpnurtuuczkmlkmolacsvcnxlfjrctujavrikeautzqbzzfhouduwmvmfymioxruqztlbqfulhoryazukvrmcvpmtiijujluyiqcbohetwxadwkpbobpsqdzvmifllwtwnegclarpsygjykgbo"; +Constant str_105 = "cfvisbxqxsptyguoednegfpecbhahtjhbuqzzrqzvehdoyujvzjnctmlzdaqgoyvcymfjxiqxaojbipdrzlcoopdahynxptjucdjflvfzrqrhkdsirgdprmhxwrvffqjtekznhvodxnrnxybimbwsexessgwbmqluckjjoblswjgvaftxrtrxhpsmywnvzjlqmqrnyvlfwrtkffrzcjtgdwxgkodvtvbspgibixcbdcjznluegfexfqaofrpowln"; +Constant str_106 = "wziukdatuskbxniquirxvvbyreytczwivnugqsbjbjmiiiuxlbxthraqpqiftsksprypdzzwgfoqxsaiabnikofcihmpshvnicbwhosytzrsiqrhnfxbssiyhnxzddhqdwozxisqmellbcjtdtisiqfemluoylvzsomopnpfabtokzjemtmhbadgwhewmcemdvdimrtmnuqwxyefvkhnvzsauaebcflhjjtxewrvbmaydkhzjzcpafdxwtsfgwkk"; +Constant str_107 = "ebpuhlvanuikedniqasrbhdmwffzsgualwihciddmtmrpyywopxnuypeoulfrlkmjahqxzfuhtbihyvgxeqsozoigaxgjglqznyttoohteirfibhxuzlcrowudpplpcurpzjzydrmwyrmomkwurzhrdutzkypapeqcursiugttujwepzwutuqifgngogddeqagatrridohlabfnoequauwzszgkpbmuaiydburcvtjiepcjcxrvsjmdrrjcoydei"; +Constant str_108 = "rgchsuxhwmcivphlwnlgrarkqpszginjxvmpthbvsezgxitxjsyylrultzevudfzqxknrmzbkjdgavbhxlkynevctfqbjlxrftmnmwssyjvmnlydcbdfaftdbmdnwyjstghzbxfeodbicknwlbanunapuegavcjwobhuppiitxxvxzcchgttxskgimktjvwtxneqoechtbwppjhtixzchpoulwffegrjtdroylwnlhehlondikehujvhcukpgmhf"; +Constant str_109 = "fjvqnrzxcdjdqgiwugghpcxcuontgxwnhqorwrmnxxzaozmliwnctwpxzpxjlvmtnxkjrbutashixwrgpkbgtwlxavcjxteizcyshvwvtciivimerjsdutwschnmwoxzhcwjopwrwodjwlmgujmstfnaqdfefcembkrvnqaywebunifjrzzvemeozceyfclfereafhbhyxmndwxgpzkacrtoklrpkycjnrvsnrxzqxyfgpsxkgalnjexhxyqfedi"; +Constant str_110 = "ltptjlfkhxgocolnsqxpmpwxcypsvhklhkasnybhgmgwjglkxakvtzowngjttrjjgtywywtiwgmfmbtjfdcqyqntgelyqeihgtkjwlwjwjpqqwtrbqosvlrixqhqdhogqunkdkybcyarlpubxupyhnujgpvtxfbwumzhimjpumrejebziofehkogjqhfegmekdmbiwpqeldembeaavmlpmwqpvlxzttaangykpfbzpbzqgbvowdsiyjnhldvutba"; +Constant str_111 = "btcwfneuulsalhnatzthcboiciztjfrxsozrdxwgbugjdfblzlcwmgwdtbwnmfimutglxhtccrmcckwraqgmeraemobmyfaelsjqygiyerwtxkkjylixdtdzqlujzbmhsoxytypsyjchrszbhzxgqzeavovidtxlysztfdfgifdqzuslixxqgihoirxohtgsizojyxrepgumslykrfgzirgrhuprnbwliftnvcirpmuoxwbioqdcaddqjhdqnvrj"; +Constant str_112 = "zxunjhoyulepdrvqtpxdpouwcrhzpokoqachpotnkryyhpocpmtygjkibnhldnhnbgyeiiseiexdpeaudmjajlkjeayjwaalgkrrdflrbcuojdybkudocvaeibyuoamgexaaayeajsjulrjkobdmzmszoegfxankkugpcmmnpodgfczvteubcoznrgzzdzufpdpgahnotpqyqnggvvmewqkypcjdgacxvputjovxwktxrlpzobcwntkvvjfeydue"; +Constant str_113 = "icomssroeytfifdscfjtaaqduzctvhpogrssbhxtkxnfxgwpwhxjffyjvkxsnshiblcrpgmekcaxvocefwmigkztsvffxsjyeofxxopfsmojjjtbapksdmumwgifaekugdlntcoglqhdupgfysgexutbeslnxfpxjsedleluadwsrhgwdnhrgnqjrosmyecoucxcjbfxjjxzmrbgerchividmaaqfttveyuunbyaudfoafcjhhfrzmaxiekexcfk"; +Constant str_114 = "ytrvtuvklicltqczeyrryepjnnfpqmncixlnzlidwiinlraxzpmoplwjmsaigvnncqhiojkfaxizrbudivwxubpwktafdeijlrzddogfdviejwhduwaxyocsjiwxsgvyiluxhpqizusjxifwtveaffokwkdozhqxkqluwnhvqevwigbzfbrqcmzwqauqvonvbsefjzexrcismscouxynqghndbceamfbzfmomwjtnoujwmwsbanopfnzvgsirwcy"; +Constant str_115 = "elebkmanxbzthhidqsptoxknqrkhwulxdalgyzvycypfaqillcbgnvmykpqhzetztghoytnnfiqndrewtglrwyjywbialbztfprpomkkltszfchzpzufttapjozpufffriqafbiiityvdyiknloidjcoofmfrcbgozcfsatvrhrhsrcqhxyysvckwpkyafxlbyyokdxezmrgzciqjxlulpgjwhfbcnjmpkjbwlsnxivmqwtxtugmopeecjpthbuc"; +Constant str_116 = "vvszahremrienvyudlevsicnyctcdjuukdosvjwlplpbsmukyxkcmigngqvgxldwszkzgquwjrrcwsxwmnfxwewievxnfrihyjwcfcktwpyxcouwigwdkvjcjpadrpvqfkhjboeqjwhequqypvzrwqrxhkrlewausmmsimhjdiammjmnjroezxxelexjnkdfrbiijriiuhserpgoajkoragyjrknzlmkkcregzmnifrchcstocquruesyfzwxpoa"; +Constant str_117 = "azllkjrglwdrigkxbtbkuxrimneicqzlpcmrykkhogczrxwfjlzeqoshzoorgdazpqdmvnogwwjfdikmtpfywwutqqsipklvhdfruvfpdpcvonxjpwwujrcrpuvmbfldbzokuwdqthyadmapuqjslbfrxyvpseptzjhspvxuphwpnisqkqspezsjgvgqsmuitqlqaifayyxmzkixqhgqkfhpcylfynelnlgradvpnpgtvahrcidgatpqxkucxauv"; +Constant str_118 = "gpqespkeaemqhuxptdqkogxfpfypnibcycqjdyteobixkrhzpcidpvziwcvfoceqijcqnswxehzbctxxnvylpoadmvwusvortsbnmotfeftjjfcjdehhqfgnaglozmveoljxrrtxgybczhybvorwqlkywjdbylvpuecbfgucolsgfhayqmsdmvxacljpmxxjtukjjjlwpzrtviwnqexuugobrrdgfgqzmdgwjqywoniquluqbrkogqkntsjngsyk"; +Constant str_119 = "wvinduxesckmxrbeoegtfqfdgmjixioufmyusrwxbcqqcwfojfzwwfuysjrosqiyaegidpukmflzjkwtvdqutvkjaysdciqapijyprtzzalrakobqomxhmlsrkafgzbwdxamsxfxwchmpsbrrabqibjpculyopwyitanfypmzmqsrhbtxbzbxgftdeimswpdidumxrwelrztavikxlvucppdobynntyltpmrtxcibzujbgczegfwowvfaebbijkj"; +Constant str_120 = "lycbiinstqqkfudamkrekbnvfqfmsqhepxsezkidltczqzqvygdjuhkpncguxbdeorrcdbtwzmudhxxwfyvnikyqdvhxolxbtdliuivvzuazznqkmmrmpztnzglkqafdocqsmrojzxhsgacuxzhxqpbodiepsvmugtnzjqjecdnepilgtwcndkznlytxnfnfbocnxznmlgctuyttnfkfhfloyepqvkjbeugqktoymgrfctfaelsbmaymhbzwqxlz"; +Constant str_121 = "qrwhvtyrbhxqgtcivfodvxujuacjncffcwapiusutpvuftjeangdlevuaufbijeevwteganeybebxgshzdzyubnsjtreuhvuryxwickonvarahsngulgtmgxwtjzjmcccymqoucptgbnuzuiabcihupzkdwfobtpxkodbiabvwyyywlogjwsxbgxdhibddhhexehzipklkwaifmslcrrbvymrnlqlaaxnsrzfprmiazlicxgdyddfdagkuvgfxyk"; +Constant str_122 = "fdmmswjjczwgorbvcxytljdvpagitxnvrzmrcggmwjxyvhgtvtakdaezvjitojqrjlxuxsqqbvofxoybikvsjttgbyjnyeaustpaxmrtvadckbdccwdquyarfacsoxdurpxuyuwoijzcnwxldlkhmlahwasfqcmioirpczxgsqyktyypdnjipcxdiecrgqlcotitjmsvzilghunsjmrzrydmsdpjzjltxcrcivmfsjufvqvcfxdhazpntiuiqkol"; +Constant str_123 = "etmjfsnkpirxdzgtthgowvkpfobttrrwdzsokcqgineagadkyvnulpagxiykjcyynpepoaqsssipvdnxbhzzutotpgykeopnwlzxvcdxihkeohradpzobhchpnwntosfwodxygscqnbzgobknkgyadzkkjvwzurgkpqnfjclsapkaqgayzctqpxupoikujvgtxeqhrgnjvbmavgkzsuzvkecxpfpibxhsuewribrszklqgpizulncxnofzykygqs"; +Constant str_124 = "yrwaqohnqusmrntkwhvygpujrapexvkopsfugqoxzfqxkvwzefvnbrscrhchdccwbbkpxfgcyvruxmepkyglrkogdtxzjrdwrnysntkbhelkqqnxrcnuvbrgimvmaiqkbatbnewyqyntsvkrsacifhmcvrhvfqfiqfbgtfplwikteywgckedboanboltnhopqqszdrybytfajivsisclprclubiwztrncdokdpaxxdzwelvisfrxiwovkgdlewtx"; +Constant str_125 = "rxouoichhwbesjgzlmgtuhthaolicoovvyzheplozohfuhduzeceazhyihtnkgqschczaeyeuzayqhotfcsgiicycrddgssjqpkiunjodjjbqmhsyrflkiqprnczyuikcyxqtmhwmwxikitglyktaohgtwolvoxzikecmunsggxyohzfabupoeilrcptujbzxjwojftjaxoioxwujfsdgwhyzgkffgfoyijnrjxrrjjovaennkxavzbyuwwbuqiw"; +Constant str_126 = "lbpgsggdxdpppxypuarrgnjdlorfrzleegntprxwjvgwvtbhtkaggklbmnwzcforubspjfvbvjqvzqbkabkizdywluwrnavajacllrteusktcckqmeaybwapszjvzvcodsrzciyjyoxlwzfqvebgrfiqiinnsuvcsyxgbzlvbqvaaormitkjqjfabqxfkqzfpedzbwsmgfkgnogforpsjihwxnpzvmjpogqvphetjovyzmlpmfstvukniidrkdjy"; +Constant str_127 = "umjxwxercrhpnvbzwyetoderzzolcmygoewxqevvwdpwmthfgjrwgflmsolfalqovplpibtzeeztbtcnuzpndhcsipottiluibsryorssodmmzwjpvdnozheyuslidotvaaytnrxjkozxgenzdgcakudcsnitcffijdfqqdlfvbplvhdmktfenlqmqrbltujomjjygrnshjxupmveuotzbjsmkdqfllopuqbtmmfrbiypvstrhfsnchgsdztgnuk"; +Constant str_128 = "crymqnvhgirvhersuqneatzvcqlaosydeeozqielynxlgeztnlxrknnjkcbbsowhjefsbxnxtwhtqduatrxnkfpkfwymwspreqkcnouvhatxiresgferbxynsnbujrkcqdowoygcppnnorccdfttqpiccdnrtqvzysfdesyrzhmwztbiygkykodnbjokphcpoillzxftfgviwttvcufldprykqmmhjucoyipkaiaeuabpxchsodygjrkvbplsdyt"; +Constant str_129 = "hvglygdutuiqrgjfhsnaffczcwizsvmxswobplnizfhpzsehgktnnoeqgjkpegdbfaymiybcufekubgvvwauykqvypwlbvxrcyfwtsghorjnffxjwgniktmvskbsxreeimxhgdjiubarsalwovoxtpjyyyyloxchbqzdmlaccjclkrdnelbrijyiflhnkgpgxxamhojaxumfedzawhoederijszitbyfmcfuhgsswgkqbvvhvlkdgbbqqrveucpv"; +Constant str_130 = "mirujwsqeptzksrerpljtmjtzrlubfayzbvjvywizalocqyznkzglwthajkcpjwzvkzbsvxipthvcidpagmdnhoqnudtckaqjmtphopgxwqhgjrjceyhnfgikthkfmylywrjopwzzjqttymxqycbiyqeznidmwppapynzkyrtnqqvkuuwvbrgnaprmjruilorkldhhqzqhptzidotznkbvvglrehtdofkcyqpbmpfzyaruntskeeipwizyukqfvw"; +Constant str_131 = "bjmviyadhgnxkilkrqsfygpbvqbksfzdfrenvxbzyvvoljsruzmpnpipgxmlpweuewbvwijnvjdpnmusooenkqrhvsognczhgxlicvapbmhctzkqwxouoryxjtpwqgafdydotfkjaxjnrymgmuceisvamyhavbuyiutqtnocpueocxwaqzlmtyeigvsmvtvoyunnguudvmxwfxrlqkkzfptrdqzdqtyuetoorgnjrcbwcfxqxyltfvjlozkyxusj"; +Constant str_132 = "kpldrilhrndxrmgtuqalrspdsbhphkcltiechbwhbslaldfkvsgslnqwiammgqbybujislqofitxrjqmfbsxrjswzkmkuccyqalvpnoromxmcgdqjsnwisgxjxckxbsebhyqlnglwsbsblxiylilpolltoabwcbzovjfugivwhkdufwzgqadusxhradqcvzpqzttspuqkbwvdxhcxheorbknkqgzhxuikrtvvdldnboxkyallcxkvuizepbczizw"; +Constant str_133 = "xnlrzmtzsjjeukgcvmkjfqxupdmosqijzecyccxamqmhmhezkkhrmgplzathzwpnsadxbtfuvgsjzgwyaxpqgtyficrylczpecwiclizxbyypvfdwrxpgrlhwrizjttekbskyutfayxzeeidtnxfccdebhvtrdvanyosqtgrfivbypyicnjlpuvymqrlrmpmfzolzllhaosldcqoddqmehlzspzrkzwynawegmjvtuoyxwqjhmhkqceeacvhysos"; +Constant str_134 = "scsltembkjfnpsqncytxlwochkkpgxrucemzqhrmrefmvvzcepkgyjmcgokdedftsskwzwwckwrfjakspscyegqvdbeotepdyypviwxdylyszncdeqtdochirmrodlwflvcqxxooezhbziootuzmctydvhfcxknuioedsnjssvizfhihnlcldzrkjljzmqeoiihawpacabhtebexfjneknqtwwhdlmgprvlztjjubsplpgwwcteywbrjitkqhjof"; +Constant str_135 = "ncunqajtflnqavihjamupivmxjyjiyvlcocctkndskaqowhpzyqzvtkpvzqrbuaxgornloycbqxrthztorzgswclvsodsxeywmybrtwxhexjovfdjldxlijjzwokisaegxgkgpaahflkifalonfhdodltykrlcwxitnusrjsupdhxbrfwntwztjkpusgvrpdjwjoghskoogpauirhttkvnpukfrlvrphcfbxzntbtcjnftnycnbmciopqqzxetsv"; +Constant str_136 = "btuqkgihudbkoclsflbnbyzusamqltnsaklgptsnadimfabtytoawkquimgdymdxlfhvddvntseekklxpupsxdbteejxkcagdcosmxnkdowhwjrtccfglqipszdokzzfndhubskimksrhxwliqgcapxxoqsvyuujvosyadmwegzghupvpqlitwgjcalaclurezvywjwwbeafolsvrqfnfavaifmsvltioizwfarfoasbrdmyzbmwpzsveegeapng"; +Constant str_137 = "gqqjyqgletduaqtrerafnuzqijesgestmdnyjaiyjqskhifxhjqmvkhnfqfcdfvbbfsakjuzfottpbdotfooontqyoahpumgcmbhcymuwuijummgqpwnsnaygpvdwetpklebxgcsxskaeebdmiscffzyirrldajfpeyshdmslpgmfuarutvbtdecmmnnjsoukdyboxvjowoapnzozsgfsmrigsbhafsvhegsmtvbvlmzsnigmfvyekzytnngymdv"; +Constant str_138 = "cflgemkergmdfdvqqmhpqldhxefokdzqxnluqeotaajhbqlxfiotckcryndhegjcssufgzpfxivgfxkwrcnnhulsknyswgtwqcxoapgzfugvuoipsnlpoyeizjiefzclluxtqrvywqlfsblmhqfkwgijjdftrewjlezioytxaaucbbburvcvnhlqemkcrfinewlgoerjhmxempktczdbqhqbzbudolniwiqhkmstrkdymrswcskefssauofumvxq"; +Constant str_139 = "usoiukospmehlabqhrljmsaqbyecjcmtsstmrrnqckeauimetswyjexavfreagkinmhcxvtjcpugcocnqtnvkqdzaheofnwwuowetdqcxaxecuatiillkduuayfuhdtiaugdthzzyebonnnajwhdtruhtswjxzlxjhhjcssjbiclkgekfjzkiqtpxeshahwuxiypoxdwxqfqevmavuhpahezksfskjbjgkmiyjadedfgxglrmjzrtrurdcyvpohz"; +Constant str_140 = "szqarckwvmhnfmrsvnqdgqknoadfananrmjgpkzwxacvxcaivocbbhuoeyckkexknfvxoycqhkzvbcpyebwmbuiesyfxlbhgxpmrfpaddsotdzviyhbzfnggnstbogibfgzlqwmbunnsuxkzyfccqkaahxxvuwesxqfcvqzafalppazvbljngwbxcidwibapczmxaziatyiqcowxpoahuckpdwixshmahubaumnodtlurzayovzilxssexrqfwug"; +Constant str_141 = "qggfmmiedzaxvhletjnwghtvymzsoihhtilgrpwlteeephjgidntkxpatmjvmlsmicaagfaqsrvcodcmagzgkpeeagctdgxvnghosrnwvdqqvyeyvujbcujyjegeveoudmafjoiimuddqkpvovqygatavksuvzrvlxlliphczsfpkgtirpkwmlgakqlajfkwgfjnlxdkludimfmctgnhdnfymdrkkhdpiirfjxvloojchihwqlgpmianjuuecbnm"; +Constant str_142 = "acdboaeblyiycfuzkewibherjlavwpvwnjplaxuafnkdsixfitpilvylbdhgkfkokyvhgyfvmrljpettbotwhjtowwcdolilzkfibdzvrtkuakohbremzczjngfyguyauplzdbnmypwjbouidpcjgzryqclxsqygitzrqxkfmtnulzlvqvbvlrgcbqsocfvgmzcktnyufrrsmxfnxsxlkowqhjwsysmxlmuvsjngmukdtcbmvqgizjrnwtpuuufj"; +Constant str_143 = "qscuwqcjgffsudwpjiriyxrhpchadixfbzxkswvunzenefradxkepevdadoaisilklwvrnnhoizofesjdsztlcvoicqzhvqdwwnnokipksnwgsaddwacrlamcmqxajegdvpubksmmglrverznqpmnxbxgwqdppmniwlfwxkoawzdpizpercnrzxwrldsxiqldhvuygelhwohjbhwyhtlqkiujwwcrikwlakvsmkeeqntywhgtdihepdoxnwvxahh"; +Constant str_144 = "lxaaimribtyswurvynvifjrvnaihyhbdnirpwhtxorqvsrlneeromknvoybqryaufxbpnetquiwrydturoiljrnelkcjckeszajyzdutxmlnywrbhcyxtfsemzkmyohmurqoedkduunulvsrxdgjjrodwrcltesrnzxgdrspdaxnppxbvqtcvswelpuzeztkbrbazoutdionzoyuucbdffgoljiifriqcoxzylhumsdgconatcgefzhqqkjerqss"; +Constant str_145 = "fviwodpymjndyiwqhpornfmjfmtvuyxfdkzesuywyhfeuqjeefigmfrgeumudjwtnmighxwrwfjdplpuqrlgfutnbogzmyirefhzzospuwnvxbnldxricccsligdllhstaaccgcprjxmcotkhkmyednonuovdwnwfdpezacsfntzkvhiwavzmbkceeryzjptxddtoqpxjxnburmpihdgvvctnqchplsquwzrehzuqczcwnyzrzlakolkdjwgsgsp"; +Constant str_146 = "rlgcuebhhnklzjhkwxpqagauidgqjuzsjoujmzzgrxckshcsltgecaldsidguifcivqxubyqdvxvdzioatrllitcgseybxukzxlpxcyzkgaxtxvgghxxattgnnbspobkqziiranuylsebkkyrybpvtmdbxfetjqetkkaeovpyibsgufmqvnvkozsuckcullomkjfhmsglkaqmxgxxzuhrgdvwokalmvpzopqhusqfmlympmckyfigyziqoggnzlo"; +Constant str_147 = "jkndkgyriugolqjgvjuyfhlxupynmxbpsmmhbmpjlonedhemehzoagzwgeetzeqsmwartfomwskmdenmqdxjlntmglwqsejkmypkmufqzaekkoggfjykxnqwsuddfrsveikqftwuremsmrgpuesjglccmvwvzwzqtvpyqscqpyeidnthcnucuioyiyplnizxhjqznoqvvhaydhqojhdgtboiernmiokaxpudztnqffnjwhslrpmaanxpczfkxcey"; +Constant str_148 = "oeahjqkiyfrzohwshopofyzaowodtwvbnoysopxgtetzmhaqbsionfczadcvsfiqvozztoafebtmkjapoamjeonjgqkddgzgxkzjovxbhpvgttxevnxycfswpwzgderxmyuvsxhwhpvitsgytyichzrolhvrqeubbvbehxjqjzonezcybnpkfusqmgeuwdlrzwmechyariygigtqlbjpotdkvudvzmsmadtmsvldikhozesmqwohllrgbjszowsy"; +Constant str_149 = "gjaexbjukuuocyvwculncrostjkrxqkeybhxcpuxhatrwaheuexhbbrruplmtwqawgcntvlqowrnizaueqjhfvtbauzsslmrvxdhhxhebocbqqskcsiyoynuzvqdfhjjiwvlkafrhtbquhbgedbwyckaljnmrhvzfktzivlmfnmecjmwjjodsuwolvlfcceoyksxmruedfyduxhhdklnktddhbhvoqxmewyfikwbfenpyxpjfeweyeipskqwzsqy"; +Constant str_150 = "mbqnremcftvsanqwbxsymqegiqrtzlbssbaujhhcxrurcxdzjhuwffeevtxlgxkslczjrtlizjfliureefmfgdpnbrwoszuwmvsvcstmcqifzbnydtrutfmowdepqicuuzdrualnldjhmpsbbfznugmehhawdmcaxoiwrfsclnpjfgqokvwzanhvaefphjgtduppiamvysuibmqmtwcbrgboqxybzstxbaaucbgceeetbyrkhrtauignrbpxpqni"; +Constant str_151 = "uxkwjvdnyamobqfpclhgfvnkghnhjmnwgdzsgfcdwnmmwnzxdjvtvgporwinfkviepeqxnxwvqyzgbhgyqgfttazjykzbktawdieutbifldcrlyjqmlwvxvtwfzvkkbcevillasvjpayqmghlnuhnsevhechdatbacmqfgovnqskcvgfhjojulrdijskykshfytrsmfiudibktcyirkuptuitvattxqdovdthxnccfqwogzcusgdrdoezrtccxkd"; +Constant str_152 = "iqpxijpumqxjvliyfmazukfhglnrhtbvkegfjnnrtlvucvntebtikgywdmdcmwjwpepsgzdgcgumjuymwvjtznneqqtmrfmtvctxiyvwfcobauinjfrzztlelnvfiaydcysdslfcxtyhpbzcuvljvmmnfxgtpqryqxhbuthtgsqgbwmgkqqvbcszdoobeqyyqmfoicmpfysokskjyndsssnelwipgartivcowhehockzohctqkflfgvuxtejiwib"; +Constant str_153 = "slpzrmmgdqshsawdfkttlwamrwziurrmklzooyveoumzjdpibfhzwgpfwbmfyeqdciyjjamgvhfshrcqyksacaiqhyefswmxkzkchmxuxfjwleisghrhoiueddhyyqymdqurettlitijqsheefafoikykpawmzbegvrejcwpurpxdgeiyfclpgyqxswpymgmjuovbwtfeuullsdytcqjibipdmzcaspqwiobespbplplyzzfsndcudirpxupeans"; +Constant str_154 = "hshfhfucxutrownrcyywajeipysntoqzzggdiirihwlcroknbxmkokyjlvbluotbkfimxdnpvvqjkxdqdzuzdrmmbyqxicoqtlrsdacfnslgyyjsadzvphofosaelfsiksjlzsckajapeblxixbjkbaxunqdiadfcjaisgvklyzqqrxzskamclwhbhyiiphpfhdmazeriwgkhgtrfonsvscsaxmudgwuljiowcdnjfgmtsiuwfpdcffrxlaqubcv"; +Constant str_155 = "gzveqmtdcsteikbtyzblrtsdgrazszndxzxpfvarhtbhtcgaessjvmiboeqeejkqefnogpgtychwnttvrnoqvqyfcplfrdramymsfjybhgyyvwgprwbodjniuldeqxmebxmgqqrfpwhhlhghrsidiwlreqkxmsjkjnptnejknbkzzuajgmnfppqsuxcsscrotioahprfwikgdcotvtuwuwpprcispzexpiqwwhcxpzimtpbnrfmsqlntzclbrtlw"; +Constant str_156 = "pcsyviofwkzjvpbbtztmygkcrfhpjzlpysstqtiatouwreaqewkhzmvdzjookgipyriyfxruzbgssrjqqroppgmjavbcbhwqeubckqdorajfagbpskypchzuucyqhaxuvdiftiybvvuhmrptorgeduaypdwdmedvgmrhgolnvckffroljapzspmhtirioqzqflingcamqbukvjwsjxcwwikmjaswmskpblizcivpomzpmqwkehdflkqodgzsqisv"; +Constant str_157 = "lftdwfbfljhuorzbzlqcimpjnrkbpxuaaqddyvmyfsoskckmmepzeobjhydknwmmbhfeiyczgoeoiazpnxpxtguagrcoijruaxiygpodrtbekhwzidjqfbykctdnbmhemluibdqyvlgususcdoikqcjgvfpkoduzztimbkopedlgdhffrtzuphluadejpwborpkdoltmdascxbfllzvzczrurkamdyvhaahwxxlzulwufbidsbsevlapylzabqzw"; +Constant str_158 = "zqkyeoqxlofnkxyrzyabyrettdprukkbagtcyqntlxrkllophmgrjepymmxlultwbghlpodakgmynojlbxuhrgdlmthfwlekndyuyqahyaxrwsowofwuxtxfarlkxawkyosrtazncoksqrgsxlxfmftchkrrqvejjmqeaeroidcuyahaquxaklhbrfkkhxrbngmyuaixtbswurjapnohixwjgwabmqrxcmqgtbnopxihsldzfwqaqdjjrvarsmka"; +Constant str_159 = "sjgpvhkwmbyqhnxtbrbdngmoybmuztksymhiwqcldlgrdyaobxsnwntiroquqytfyttsyahxeofhefgcpsoklnsgjvyxjiagpsebcvghrdlmqwxotowggjvuclntxfpiakljbmkecjuazbdvpsdcswgwmpovbetulrakzhnmahucjdqwsaivoninqjfojwdujunmjgvdjutlfyywkyxihuxykedulyrgmpovzvruetojqyqytyjbhridpslsaezm"; +Constant str_160 = "unyczzncvifzhzmhfmorvehbxewdhzdfgwyxrsjnctmudpcmwabvtrbgqbkwsgcprnavkkovckbpfgsusrrxgdkjixinbsdfuniwdmnzzbesxhuvabdheejbubzhgeogvtzhuywcdyjgqsbbmrssckmfguphowqctfmvlnzuqznxagbzubckckxlffskwbwxcbhtbzxatphefkalkcnvzhnekaiocdkvpvbqcxywzphwyjmrvemkxczofbdrvtzu"; +Constant str_161 = "wqzqphwgzjaacfabbrflupgkgsbixmoaoxkethhxxfjftgaaokdhxvmwajvmnrzyxszytufvwsbqfeoasdxosrnebddcdubydtgvtmacfdelkpizfnvjtajzmgmwijpgajdpenvyftbywpttqahnubdxpngknsiajkmrftdarictrejklrbrxlzmnwutikdtfupnxysooyvefipehbmxytxxqcrruwsxaqnjhfsafcvdhhykpratrbbdwkkdioeo"; +Constant str_162 = "rwvvrxxzxjaxprzzlqzytaguxtireorluwizkiulaicacmmksypvsngtjkuklxsxlrzcogzeaqvfekyxwocxkmescdiaxrhmnmwhneoagxyljtpsqsgcgxfabslcwrrzlzalixgxnamncgquxpbcgkqwcwnoitvdlomwhfpkjodyrulrwpetyjvrpleydnyffbawcowgmtpqdltijfckcfzlaedvpdkdpequvqyletmflkobbzzcukytidyludtv"; +Constant str_163 = "bsnlgwgxpvgefagjsnazoleccpnztctjkddwqzilvkdbequpvmowkyshclpacryeptftokykicrsmlhsnxievqdoydyjeehjjhnlabtxplhorbioyigaupcsaaidntfzgktpvjwvxvfotbhwplzupkjhrrcrvmuesfjcelmiuqiwgznvvbmhknnowobevchobpivtnowtbockdmklneizhybnonfadgrzhnzjnswdwarxygbyxdsqokysqqradji"; +Constant str_164 = "nsxvlhgwxxahizjxajifodubvgveeliqtuhualalkuuymfmdijdverwfnthzfuzfxghquxofuajbprnggmilgghorzgzkeknenhlqnoqbmbbvxzylqgkjclejmsjmiwqshopsxrkgqgtnbtfputksdtktdbzhdebyoubinlulheotddccyfwruhlvxmxnrpcanjkqpaofnbsoziitkpkwmhllkngexmanmiznbhwzobvrqaukhmrlrcyhgtqwbim"; +Constant str_165 = "aqoprpijkbdypyoisxyqnafceqwjklvomfthzzlyiyiwowrvffkbtpqgoddbizqejgyzsldiykoqslwxinhxjdguirleoxsxqeyrxoergohspjexxnsvkmdzlazhqghheahxpgeeopoizwrdgatymoljlsaspdyhurqzuhjpksgjryljwdfbbyxukibwytudvghzdjwnaqlfwwvawrutvwjyterykprcngqnzcftrrgtmnzonbwlizqksxrxxguz"; +Constant str_166 = "lusqdygmzhnyidkvpnqwtnrixyefpfpsltfpuqlkeshqdjrceaaqimyjezetpbivyouuvjwtyxioorlrocndiccshippiasxeljyscnozdauwzhjwcpgkqcyeuuqzefltkyigqcepcespuntoygggsbbqschwbtgsdlhlpkanjiuezohyjbfuruqjzaivudapluahftuqwlstqjznmksazqqvenemnfwegrtdnopndamchngnybwskqohgtczfaj"; +Constant str_167 = "fidbwwzkamdyxfeteujnutvrftqgjpmakzjpgcnapnhnrszacbptfjwvunxlvpqqdxpnuqsnhhjjgdqsnqxuofvkneuyaceboyabpgwjddwzsilegrmoxznuvkekgwpkmpwngeleupudnvbyjsgihvgjwstjxpgxhvgiwwndzztmmgemtzqgmbgpexzvvehpyluqvqreamykoiyzkakawwpdxptqvqquqpukgtbsjzomojcifybpgcmggjgkslvy"; +Constant str_168 = "urjkdwgtwpbfcfhcjtqjhfaikcgohjnopphpbvjlkdcknpzdqwydejkematfxybasueiojvptofhcepcalrfwtikohtaefhrrjohvpkrnfynqjuninecqsebdhywywszdframujqjqfkjhnfvudspamdlpzzzxivaxhiokeywavgojtxjoibberbremvyengdgfrpetxsdpkckwxfagapgdvbfwcjlvcdtvhlkxzwhvgeyvynxtetmymoemfcean"; +Constant str_169 = "zbzosfpcyrdzijfdeybnkijoaqljducpmqlcrtpaaamvyjsvgsccjtfbxcvomjdzuqwhibwiyombhrycqmpuhxkixkvaautnecbdpqrrsesydrktxdztkpakowdwotelvypfgcooyccrqtugzfbikdlbvlypjmchgaswpsilpcveyvgtdawngxgxfqmgmfnsueogbuafebiafctmxzwsxghfqlrtpomqesdhvdldmmdxaymgsubyvziedhpdnyne"; +Constant str_170 = "gyqepkcacoboqawsldofkjuolsztzmxknbobtlkvwyfgcjhhzuyfvbgnousunbkkpsvebfhagkwnvezicudixudhargultgmgiqpvsrqbwqmwscnxeqdcpmotrprfwrsipfhhvlipuyxcmcgxzaipaudjvkqnzvxurcujtxffecqqfaknuhhjueyttrsjrhusixeghiypyaeeqwiceryaktsefwlqlqcpyffcnckyfriuotwiszzbkmjywlsvtxz"; +Constant str_171 = "pijmzozrkfikqqtyoapiavemlkrflrdclmexcjcckddvetrsfqqlnbrgrgjhjrpphqioixymblonpatgpvinndiynshlnyhkiypkcqvetekoxzvpdfpnwdmjqqvlmfcllywuxtgwqpbrfjkmzzwdruabhmkgjmbgvlqvtqdvbwwfyxbpqxwipxzgjtghwltfrhbofxwvubufzuxznlxfghmybdjjryinxmdwfvpdycglphyslpgokvgurvupqnel"; +Constant str_172 = "dafialrqqccppskhnncfohmwbcucabfhfzmzqhwrkyjznjvofafphxedzdighhwhgmivpdkvpiqypudvvttxycnbzwbevnwykekodypnwyxkybyspsywciuixwxlsjwaxzbfarrhpyjfmyfklgyhvrmubalmflgbtbklirgylrxmaowndlsllmgblhqpkpmkuupixvqxpubrqtsaeipgfgcqundofaqjnfmdnfinltolpogrlisjuqfovdfracvh"; +Constant str_173 = "eswantxxguxtxuwpilkxlfjpnbfbzgjmfqxxrylqcgtalcczhtvconquxlnktbzhydzwyubinemyhsbsqelyzdtijxmyvxfhydeihwmnwadssapultsuxzxsayunmbxpjciqoxvpbeudralgqvcxiqclhicqiyclvnlrjlojvdqwolyxndhttokwomwpmvfjyydovfocypjjmhnqyttpxcvrfelpccnvjintcjnbzkbdefikjelgadziignxgmay"; +Constant str_174 = "yoegexqjdivqpxtkibpplwkpgbcpksuzyfbtbezfnrsseyalgtwtmwnklusnnwqvxxszqntmnnrtbiosnizvvkadawzvhnpurqqndoulkedgitndknjnidllfrdrenlswdmoybfeyhhfysifcumijyfhybvwxejyzjluymcurbplpmoqzfqvsokormimvkpntcpzkrytzqdsqbcjftfbrglpskcbccwhyyjzjpykmlfqlydsozoqjqvygyjvcczj"; +Constant str_175 = "tewjxzygnbnjkbvwbskjjcrwiqmnxchitnucpokspwujgxpmfiozbggredrhsdlmfmdgrzixyhvlrqhvchzmjjmqbaqutjweyaztjysqibzdygrrbfrjkibdthrilxkrpbwxxeuyaifwlvmfnuqglyzebpenqiltxvlpraicywcsgqslhjswnvvdvbeyokhciwrdczbmnycqwmjoeknldskdwjqytexgbhtspntrsoupcekgtksxisohdydidpxx"; +Constant str_176 = "hundrkncgkdtirsbdlvpyxnfcemjcdmogdctersdjeolwbcvaeabfrowujrjkhyhcfsbwnuwigdlaiqtteuhmnqsqdcqezorzvokgjvxmgnhuekjjbsnlnoqyaozutxncklkvvkhjaetaskrehplxpiyasovtrwaakflttjvlqxhmlcxdenabfmvbpphvazfmiafbmacscmpfrekqrivalvjiecdyphpunqqvgteocquyqoslnocjisjvjazzggu"; +Constant str_177 = "imrntsbmxosafwcuilttlvpilmuwveeetcrbkefaemadkhgpabuamjlmgtqltolzmcwtjyryspyuteivjivhhsicrstfservaluischgchwilqerkmydapbzrufhkbrlwucgddvggsgrbgwbrxugngemmbnetppalvtjyixlpouyygudxkjfnpuyrlabvibhniujqpgzswdwknlnlvcsawnpheortqpozplmdcputtzzpqdbwcowdekxmbubkoyr"; +Constant str_178 = "aezwfdtttchdhkxztgmbxideiurkxgrqxcrusxglnpywgtkrxpumyhmfknjcdidsgsumofqzbkisdbnhdkbbmybvaukkuerliedzpewrjdnrmywpxwaqxpgkyejalavlozqfoxjrtrefoyhlstykdhnnhtnnnsoatunqjfcbtcnwsmwrfvycyvlsyuwcvgymoofihtopgjxznxbzsnykfsxbmhunolhcysriwhoafomzrrrtskvtauvojfiquonu"; +Constant str_179 = "quqbrgjuuyvbleqefhugarzzgmctfyigbwrrantegvdexhbpyycptxbjjphkzhpwttidsbjwgehncngjqnytjxilexksuplpbivlorxxmmhrwhkvlwgikzryevjulmkdkeserqneiwmuulwuoqvkvkqkkenpzyumbvndhtlfanptbopwdlznvvieconyforynrwcftudfxqjsbbdwujjarzuzmraplbbpqajbuhmbitgfilrijwpkdngflqcwojk"; +Constant str_180 = "grbqifafkihplltzquwzqmjzdueqnhcvsffxituhgxrfqkmjhydugkkmhpimdljxxvraumhktcpgfsakahrlbworxvbreukcvncvcmlofmspvhijziglgisklradbdolvxppflbrhfuhozhsxqobyslnonokwhjpwryjrodtzixybjtbgqblifaoswfqeprqptxaxaxbqkubedqmyiyijsdsrzmirxobeibyxpgkdnfybvrbpyoxwpvbyuyoiaoj"; +Constant str_181 = "aabempwpvolnvtlnlaveytnltowqqgkfmflqgbosjlwkjlxhpchqsibxpknamstxdjankxpvroauiqdasqqbmexxljldnzqhhlwncumagrxmoofmlsdmqxdxekuenjhvstpsciturgardfvhzbdsqgxupsrokqrcwbjfbkjmswotuuyuuymecitdlfbwipaqiyfezayyejkpcbckaurjbopghtmogdvdaassmscpiylsgnjbsoyusjizpcvkertx"; +Constant str_182 = "kxtneqshkqipenwjywtdvrvfivsvnzrbdgavtynddlfgirgvheczudizcdjeoxiictnfaobacyzaegjnrqqzuihafdliapfmhtwkdbbmwcwadkrnmdmfyzkqvtgrckfusoinqtgvzshubmwmiswxtiwyhexohkvjagsfjhplsekdbwysfhuyvyozukhqqrmlsylptwxixqoxhitqsgrejcrkndtfpyaumwynytiwehnrqjqojarpdixibjuuhlno"; +Constant str_183 = "dozdibeomciiplqgshtmttanmhaqofvcwfamagmofebyfvmkdtmaipgtcyjtpqbqqnqlzyglfxgrweeaqdxloextshpuiyuraxedbluqbabpyssacgbqgagrexxgxkivhblfvhfivihayyoallgldweczwywanulwprslkeaiqkgwvnlfznpeuvyupzzlzumuddwbsogwypvwlcfynxlbavvvgbjonscggcrlfvazrnnqmwbzfajgtwcpqnrcosr"; +Constant str_184 = "ktazzakazkawrripdsyxbkcirclxgzdlvahuwlykvygwpnuslshcmpxrqbbubogozzfcpheyiusbgxaczxfthbxfucqzjxqwbhiqomdgbwhddnenhwgqnyrbhafexplevnrfbrdfcdwaeafluodwltcjmphwsalvqgxvwcgumttfizecnjdoxwntqowsbwbrqlkzivsvtblzepewiwlnshqupbixdkiwhwbrkerbsosodiqlessumhxnfjehgoob"; +Constant str_185 = "hoqbuwdgxleoknzrugebzzpstufbbscxcaksspaeuwyorsygewvgnoyeujtofvghkneumkuvhpipakvmhclnhhltxranarszqpcsiaassjlvjmhvjvsqmewauuofuwzpavcgtvwdzfdwutabdxdjkezgisktytgjuhgxchwxiveubkqljmphpmfvggsblozjtsxkhmgohqabgmhgbhezktiyjmusndsxeamttuonjgcddrnhmgnvheinfifmhqkh"; +Constant str_186 = "ydsltbiscajbkzxhmimndmqjvgmvkyuvrsibkirzgqofgqhruzmuwbaacxlveuvfypegretefxfkmwguxkwsoevroefijqcedwgtchedstqtkiffnqdhurbfxycjvvkinquiqktdclelrozxpufiinzjhmdwrarksmsrophgxzauogylagtbfrcakhxpmhmolkdwffgzosjsjjixrzhrzrmxgtqgimjefsvhjiwvhgggxtirnarfbuqmftapfgav"; +Constant str_187 = "rxnvxidvkvwlghjpzfzdynxpjzuteshfqsgdmqctydrngjshcbtowjxbgfqeaosykogblgatxpvxdbbckyjsaxmtifpweurwrwhglhuyvrllpmvbquyklwnukyqfszfgqsocivyuxjniirrhdfyctjygherzlqktjscpymxxemoyhlpgmkjpzgmmntrucdxzttuxhrrlayjorzshtqttbgmpqwnrgsrfjeeidtsblyutplswzwlhroqgknbdwxmi"; +Constant str_188 = "amdqnckhjqwztghzfspyxbvddccjrivuqrhorpibandlpassbimcgdvqgihgpnhjtucdqjdjeaenldkdyvnvgtfbasjmyedvfesxsdwhranoxaboicinixvkgcnjddwwqdfkabccecddbxkwdrwdsiwykkvyolpklehtwgjpumhxgjzeobhnvfqavxtypalbqqmcnarjddkazeaauvzghwqzvywruempazyubregdslijyvqsahmarpiyfufgwxe"; +Constant str_189 = "gjspgxuyujxxkhwjcgqurennzrwicyyymbefqxfoxhdewuxkvrfsmqiuzhrntycxfqtmeajewnvyfhtxmeduafyeaeycnagkupnwsafyxfweyqvkalpotcogmzznsywcscparkezngnuifbhykilnzugpgwfjdgbelteziphrgnvsmcfebwiiccghftanurazjkimalybdiqmfopzpzbftyicslhesetgwtceihhpttzrdzrssicswtqbeusmwpc"; +Constant str_190 = "zbdabooxpfqjpopozqweeadtikkwjdqabgrnnzccqvapwyhuzpovreccltemchfybitnfgcxlrgvccswoxjpyzwafzoatoytafcijlhrnojtcqirdeauboqooyxnjlsmywerxhigqpdahdsnwbmuydhykwnfjlilqidwwbykasbkpkmfoelglnpclrnhvivvduodpknkfxtytvgqbbnwihizzphnvzdbcrzpsiidmzvknfsezvugdznvjnhwcmtn"; +Constant str_191 = "tetxoeztnzlhmjapzwpnbojdrmwlefnnhxweicmjnabwxrgrnneevvjlgszmsraehrpfucmexhpehmsqvmkegracgfswrwbscwflyhosihpbuifzqamnjiacgelzdsmwrafyophigqfwffjshyjnxaokygzhevpylwuvryazrweenjtrbjjirvgwlxvuxqtvmzzxltsksezxuizlrpyakorsxdhszhqsjuwnidwkmvscpxupbrlrygcflubnyagi"; +Constant str_192 = "teraqzlalycabfsoyhgaqojwsfuzansevswautzcrdpeeqwtvhybiiogpcqzjcdfspamavpkklgmhzoqlszsmjedrkkrjbsjpgqoeddqwbuddyuyfijeeuxsjpvsubglmxhugzrgbgvfaeyppqolaypyqgolvwnhragbyuekroujajtpvcwbfprkcsmxdaenughjukgepgacmfyenibawczksybgftfagbchghvpmkponwrzofjdazqrxfwcctjl"; +Constant str_193 = "vqacvrbyfmrgdybvvoadogdkzeryxvqndejqykkcbqcykrfzobtglnofyhvecekcctbxpilelbnyokgtnclazpoehskhjkqszflmgcgypppkzlatkroaojyadfmgvvdfdpdnnxdnzzankqwjxrdaobgnyrbeueroaokdhbnrchlddeboatohlgyialhcopfaylqweqrquqkdiymxxejencnjpzdqjakrwwwgbtkwefxjhbrcvhensigorsetbydx"; +Constant str_194 = "iencgszfwfsibwcwniwulbgjasfnoeroohcifbwhvgbkjgpdcliqgecjkzjeioewdopwvfznuawusqahmxtqsnbyizohdndnecvlsbdtyxfijqwgtetywdzegpwxgololtbarppwxvbeyplzdmbclckqrxynzibifgmdvvzhqsivwaenaiaggzeuptzaexxeiyeqgkfhhjhlrukxebbzgxqdgdhdlkxqxzsvvgaarrhicmxothhnrpzuhtmtfaur"; +Constant str_195 = "zqvpwxichsulafiyhzgahxvpinygiqwdvmmfdqrhjnqbfuoesctizvrobiktsooirlbeytpigpafseqlydlpmhghdfdjamhlstbbpfoqxsqzkfkobiyhbkvqggbkrmfkcmksnmrgoxkitdjdyzhcigsspliwusryxndmbteuoirzoprdheshxjvfqzcksrkbisyytruhekgxjggxxuiryqutcgnqxslcyliwtblxxuamrdzrvhrattxyugkavklt"; +Constant str_196 = "yxspwxbzqoqokfzlsdjckcckmaedmkbukjyhcuqbdophhmnjejdugvkgczladkjpstiwqeugiwjqflwwfdcyxxyferghypwjmiygndybshnhouomhvtjkkcxkrcgwgvytfjrkbwvsdrkyzmauztismnlduydfnmllpwojginnwxvubpmkxbjbklwxuzsstgazbgpodnixrxqsnwtnyrdpmbhejtobjjwopatvcsumlqsjtqbmdxjljcepbdgqfke"; +Constant str_197 = "cprzgufpqsglnrjpwjonipynnqcfmlfbuwumrtuphiroxhkdicuyenlfghegzevcpoapyrvruexpbcmfnxyktbtxxvhvbwgppxkjligluwkxvulsifpeclbrsmgtxtrcaitokmciksggxkyaabjvsrpeilltxxqcqkgcfqgdabecpcoybzmkxdohemzdhysqqlrwxriejvyodjvcrtjnafysxkudlfivmkdutnhptnnaidqlxgljdzxxiokhodpw"; +Constant str_198 = "jkaorpdaejwvfvnmfxhpstoyxinggbnukuigjzjlwyilrxjpljwqyadmdidbvcvzbaecoxccdeundjozsihnpzamhhdiccrahjdembnqopunjxbeoiazclxnbngvzaznruqawafmnwubfdlkjgxjjroouqberilqtsbnllexspiafwextkqezoshrymwvlpzhbjustuistuylxuvsqsaxwgruqlpspddcfpsvguwqxujdmaojzmhegbwizeshvsf"; +Constant str_199 = "zxbkhhlwjquomauaghzhycoiymtoblmhwmtgmqgjwjwmelvmlsicxeryywxtsbqrdefkvfccxhivrrtlffubwyuvjlodrlrhnfqokiqnehcnijcafuaorngmxbddcomipbofidfulfimhelcyjrmfbzdidyexilwmojyopztuifoubhbpfndvtuqjiwthicxrxdkdhxcntwfdfrwuwojkvscsmaurouebqromdxylrsmadkxslrgawznfhymopyr"; +Constant str_200 = "dygazhanypkgbeuwteynwhcdetxykcaqnfdbgtawcubouabmlcimwrxdjpfvuaaunytyhipdcqtpqjhdogztcjfhgmysngpzlagqeigoslizjatbxvzbfukbqxfwdgxaehgcedwqxqvfdtzgmfnalspuqiupmrqkztrqxcoxfjvdshafzsmgyfisphdnaqoukdxppadsehoxdyifalkkeyuxwzzwfmgelpxpepsruwsttdtdyvhyvaxaqbfmavxj"; +Constant str_201 = "iviojwjbxljgwqdegkbbighharbuhvbjvhjpilpjrsnujytdhmvlveewotvzsgmfciqwkpltkbjnyvksmuezclpezbtmqqicsemqwgifexmzumdthjexloqsihctufthrujxrsymkphhdpruxognqwwvzcjiwliiqqftxkbxtdgeehbzolgcmkandllzyewplzvzlenibycgnvzcimrxzyvtqjknbyarcszuiluucypbbahoituwmhcizqhlcpjh"; +Constant str_202 = "zbemzcnaydtjuzsojguqelezzecitgbjiebocpfkkyitecwgigbcnabpntlpyqmfqdubvffysmxrwpiskjxvipqdpfmprtkffqcaepqchbeuhmcamvfnjnxmcguulzpbbbzhxwowzktcmnwxmsgyrgedpjeudqrnlukjaljheimfkufhmmvcvxszrykvxxarqgqmwdiaasxdxmfshytoesyicboymrtbdorsijytdxzcaoelpfncswecgaqiamhm"; +Constant str_203 = "mgvzqnjgbkhuchggagzazutegiszydbteuwswyravfydlxgmkinzizerqxrxstjkhopcmhvstrogxxjvlyvweyvmnfbluynjumvsyuznzajexytebpntpgbvaxclskfudkddydhzgkddcqwdmdkelkoybffgnlzmucbvmihbsqulrxkfhvypsbkvkttpxmzamssuakdtnytztavqvrqnmxqhoqxdkabkrtzqkkmcuzevekrdakjyamstaukcozvb"; +Constant str_204 = "mehulmuzkwwkjedexkhrisngtwxousovgzomfqodvpzdlimwkvjspfnuojthyhjhxpstiibnrmtsbulgjhrmnzpseooohkxoyfjhcvbqxfuuyiamugtckykjiwsxzkbykzdjgmzcrtnezdcpzqyunizdtxasqilztjxxfqmxsjtewkesbznxbggksdtsbtomtypfoxxluyernmvhiukinpriahnqqrojmluguwqckjjqpbkveisqtszvihsvlhkk"; +Constant str_205 = "gbthylwhvjmtbipoksnswnughxqxzbuxzlmthfqllajsdvdghfockpidtytrogbzkiouomorksoboektzznrpdcppohlngotntcmjzuiitrlrdwxpjufgziugznbwphqjevgcrgiqkyimztnplscztzyjkostlszcucopwjstuxorgujhsfsgoaarbstlmngthzdshbejnwugpzogllavoqbzzhtqksoipxvqefivbvrcwizmhlsjsqoqebhrzxz"; +Constant str_206 = "atunklrmdfqdyaycvlbheewflfeydcdzznifmndpwylkfllveedwzbntuaowrhafwprscfdmvacdmpmqtrdmewnxqtucrflndbdloerqmzkhlkpittvfxbakftsidbgvkljvzwonsjusdtxjyphswtjqkvosgqwwppiarkewwqjmhbawoyuqvazxsyqhtabxitcjdrctdlvxtlgyntkjqycnqqwdrmyfxgntmcnroiuuglyzcvnroadjgqhbgylb"; +Constant str_207 = "ryntziilkklwpnleusncqalvmuzmamryafjngldrpztmwjrmcgoibwzkxkkeghdhxosiplrzdwdnmmuzohtcmfgomnavszvfwectxbrqnbzkuybgawyghjtcvmwhjgokemgknaedkoeuvkfmrcjuhogpbxznpfjrlpmndolmuuwcxehefbcmhkeerqzhlipaydyjerfouuhogjlxnvfghjbbtoastyfubvglpuamjexshkproxikatrekrmswlhn"; +Constant str_208 = "ozhayhoesggyxgrtdrntmzvfkbyypelxmkmepyyjojhgwxumedtytcuopmhyoywomlasbalqxhjbvcugpvlqorfxdosmcuznhbqkdrxbxmjdrcdyzaytempdtivhxnyegreurqbpflwuxvckieobcsxxhjhldlqwfshkglpqfmgejmkhwtjgmfrjquqiiahdbucwwsnrmikykgwmryltmugtuckcdplmtcyevbuxxevrnhdjfxjjmvcwztycyfqe"; +Constant str_209 = "aksehjlcewnqzmkcdyaodtercebtlamfcbgpvkrtneytvpvisidenppdbynanmpddasyokkvlmxgjyffocgixzutntgguepphvlquprrtagnzoheutmklwsiptmggragyctoaqvrdhrwhedrmzoveaacfugixlxnfeoyeujfsvegaglhiyxmudxgjsfkdpyoqqawkbezvahqyjrzvkwpjeqxlkcuinbybcendkbuesyuqgojtaviveuwdpkxrnwa"; +Constant str_210 = "ojswicubpjaonutzslijsurmopeibmepmxseuvagpdazwwvnvxiqiqglhizntexzhrywvhrqmenxpvkwxfswvtvmzhawxdbwslvkfkfcedfgioxxnmngkadxnharezkboeegpgqsyioeiffhmrfzyqiqaxbihmgfrndtdmzlhmakalrkzhlkrpnflrwxbafhehykrywedyykzgdoqtoptxawfzxhqdexvnxhozoszixuiqzjdacqnedikbkuzkoa"; +Constant str_211 = "itaowhcefiznqwmuunlgofwnhxgzukbusnkipxwldwjnwzmdmbluedeazofonpeexmskxengmvtemetsykfazmbgrszzkaqpsqproyrgehvpziemodhtsqcmsxyyniudhtxjznuccehpjhpgnioyvmvvlohwzuphdessfbyahieztykempjltkvmfmydbgeinbcpyrjphbclkjohwleoffhurodpkrarxugroadxedktopnhtjclexfzgcrbqrrz"; +Constant str_212 = "nwvhvzyhqfdwsqxsjxqoigcvyegnroeajchpgvnetkfwitxqcxsmdrwrckvlcltkdhgelpvciaujkupsxvtezsfcmlrgcxqroozxwqzdxvcgudfujkyqrvigqsixdgfrqzyyfcoclrjodvtndmoqkpalcwwxhpaskitywhsrdputyaknjmljdhjdbweisdgmcqlcunumtnaqrneuvnqauteuuqzgwwdzdrimfjcwwhvbxsxhkhdczxwawepcnsty"; +Constant str_213 = "nrndsedboytxqbjibbcoayamyytggwtgdikvppaabwyoibgpscdhvepwxlfsyqqnvwriahvgthevoldupzcjqagosiudxwhnryqwcjzlpsnfojwmwfpgjlovnbnqtnxdnaqxklxsymhahpyssctwuxnnubvcincfjsijnqwgwkuliilyrpqaypxiiltmhhxgkldetkvrvlapbyvqhkciuuhydgfudykbjxenxnmqyzpeaqnzmzxtgdnxljdshnzb"; +Constant str_214 = "ouukivankogmndsaralhpsjgqglfhvhcxjufzijvceoquzuhzihiqlewtsawymhctdvqlayqnricvfdttuzicswnjrvdsxunvfjjavyeeaiprhpcmwvagufjgifclsgksmvkujociuwizkkavaqmhpfwrxrmbrunaxerohghirjgeoyjmguxvfzmyytxmeixwttcnthaqqtngaddyxsxizrhfhwvxknqcqkqtruazfywoyohyucflofqrftiqubr"; +Constant str_215 = "cfdyxfebbegifsrupacapzrjfcmhnkcekwsznwnnxrpjxqfkoghvhczqopmuumeqmcaafmkwglpvswltlvjazccjxhblbkmoskhcpifuscfpakdtqwlmlhscmmgxgzohrkuszcvrbajvnzksazxmfnqoopigifhftpnpdqzzjlxtwunvubxvkkityxalssopakfwljvkidkrgioyvykamfcpnlowujjorrtnqnzdpjvhzwlpsewwzujpvbjmbsov"; +Constant str_216 = "rgizdzocdktsdcsavspqckeilofultkkjyfeqrhhyqhzywjkhdqtndhbkihpklaykcqbnqohfkstbnffinuqaokuujaceuvwxovauixdmsntczqloacuqvksbyayjdmfgakzvncuevqubdsabwtlpjjtassiiuigydrulbsvrtxrmzfoowlrehvsihvzwblclggkrouxgxsnditwzzvmkdctmooaveydqscvdbcsryfvfwtpumwaapospttyzkpp"; +Constant str_217 = "fcorbrrcotbbsoyvgbugzsnlmobsokfjpnfbfdohptoqzqrcxoywvdhzejqkxswjcwhzrlvhqspudndcnfrbmljharruqmhirmryzmasxvwdnxgwubhbjhitxltuayxdjjoqfgvnwnxgwqrqmtgfxfwbribwqsnobkoncwsrykcyjqiytcbmbculccykrhjjjcxrqauwusdpqxcrkekqbsiqyblszqzmvczmtdnrifrsmxofxhdayzyrvvvppuif"; +Constant str_218 = "lsytbhtfanoohltsxkzxvgkvvkzacbcbycswtfhqrtiwrspmyngqrudmxlbnyywcbdeobhxjjezpujyddxdkmeiwjaanfxjwmmhrejappvrjzgrntpotmqodypavyjdxvenjgyoigbmppwhiwjecdmfxxmekrdmugtqjtheqiersajkukfnijiujerwihufgkusdqkjimhbmwnqeufjmzylaydeuafzejwchetcuclkayjzweybqvjsjkfakiyow"; +Constant str_219 = "uxmpizflffhnljxrkxkoeycuohslhzjlrpwfoipckpquxbxwxriydajgnwomwhqbwpkcojolommqugbnrlcryhxdieouwnsqdthoxecmgixdhocywxsusvxosnfrnahooqxurniivnnajfqedpyjbxxawzuickbzijlrarcmifxjqqybcwzqhyoxweyxgihwzvrgpwdtlyxgzpeyspenxijledgjhtpljfregqcdkebaiplrvdjqugrqjxzwyjgj"; +Constant str_220 = "twrvzyllgukgcxewpdxxbmzlvfxqxbkxlvjcgpbtbjapxtzxnruromuhgusxniqidiazvebmywvrzueimhdyvpoudadqoeoegkgiqzhzxjbbwkarymuwxsvxnjfwddhbbndpatprllnyfpaclihuuuhgpakvxmzigzdjrvjhlqotkzhpgdtajmkzizyqcccnanahjgtisvfiafxgscvxtropzkfdptkehfcvmpxjneufjumvjwlslfkobstdplmx"; +Constant str_221 = "hgjtmcaexipsfzcwekgsekhtreztogaqkpflhliqjvmjdykilfgsjivthaovswyqqsjvvcphnrnsrjwhtkbxkihwoetrjuyxyaazpapmezbxjddbkcsnxoqysaytndssspbzxkekmooxqfuysjlbyzmyybswksrmencjqkynartcmwpgogutdwpipwpffgbxlpffhpljojcpsaaqpexrkmzvwqtohjxipnwhwajxufvfzvenxazzbkpmvvikcmbr"; +Constant str_222 = "kqxtzzdflyvejytdkonuucuxlyjwntvbzcqtmmjxdwcratmiicpvardegwhftyvtgfstmrvprqhfcbqreimajkoyqhihxdfcbqkogceclqjtektrzexfmceneuyllvmwgxrrxiuwvobgugapxqtrxeppirfixqpiihthaelhugmwuodjopwccnhwcvjtnwdrigtmndodczuyblqsecadrwmjdsvpwvjoisrmnsvlbgvayxtunudhufrsdnrxckru"; +Constant str_223 = "zkigrymvnnfxrhpbnzzmlyqmzkplmarrixkmdonofnmlebcagadekhgebifqbcavdabudgjzimuiblmeplqzvcdqebkfkaidviutktaslgyiedvjpxlaflewlricsxjnjktgzpheyefyvwwnxsepxfzknxvkqugnaueasclmroxzqoujvvlwsnweyogreujcrjbxqdwbxushdpzgtbuthulajzzlqqrxeetvyuoxpircxqmwbccfkbsmbbwqksoy"; +Constant str_224 = "uaokwwnbphllzpqiqyftohegaudvekvxnvzupphwqgzqfpddrgxdnpyqnhlfxkmadmelalceagudjrqxbtoxonngebqmqnpciygcflkafeoriazoguvvicdywvtsgghhtnvcrvewgyzgudjmbdngfahlzahdchrgvzaefobyfdcfridqviarnozauouboiwdqrnhktazuxssdkccxkeeodruwtgzocbpriwrzolewzlumiwwiloxtwnkohyfmwgp"; +Constant str_225 = "oyribtmiyxvzwrmlxbolzguhjlzjoyfynhrbancyygpaodftssvfnmealrmveexpgvmutjtwxjnaxkxceqyqefqvcnsvucgzusojqzhzmdqphesqwrrntkosdgjvxjlqhmrwihsvziyzqiarkyvkjddqnxznsyirjjvbhjkmmowbnbxlmzzqdttkorvvjazopyllgtwsklloogztixkufbdedxnqltgymxpybibpayourlneagednwtfxtxznqre"; +Constant str_226 = "ewiwjzgqljdxgjwjhjwpnupgvrtatxoygqthminmnukwlzjsuhrytcrobatfxktfaporihcyfsupuhweexyylckqkrawxykplgxzcfzoabdgjvjflbuuqdqxxczfvnptnioklrwrujciggbqvlzklovwyrxoisqxurcotnauhhsfqeeidhpnepnubmcsoewlposwyhwxxtdvcokqilbqzrsgfzxcbaoolemdvtwdagsvrbikyzcbllwrixqvpsul"; +Constant str_227 = "qydnekqcylnggcosaoxowaxpdqjuczdtnzjmddubintbboabpnvcasfipxuhgjrxsytihlonkkwjedacmrmouutrucjxxrdbxunppzibxlnkuqeoevzosgqtuyavrrucnyskitckiwfbnztltyxrmoauedxllnhxcaqipskirmnpfpicdrqbuhrbmaamxjuyxeizqdknsawvzlzwtcirqjiobozznzcqmdxdogbnfkyhkunajxzxjsxfozesgpsk"; +Constant str_228 = "rjloimpdgxkslrsfohxohrggvcyrsziqiuuuqcfhxyufitouzquyvfoexllfnaeubohiwixkodclfpceqywhzoqmfefqhxqleoktjalmrjebpjvkcsokgqeaefbdyvwanhlhdoydtfkaowcpjwoezahlvidlqizcdawvqgjhadlkykhrmpvzaszchthhvyrjymmgvepryhqqpuqennlhwbqatdorheyhzxkhsnwtqksgysdidgusuhogzyargphl"; +Constant str_229 = "repwseuxznexjzooarhyepbyqakzdwuqsagrrpcphrvsomwphydnrapcclyrplposgsfexhkyinsdjkskyajqloismoibdabciwjwomummxcimwcgnjgxnezpvzqenhylcmbtqoiakmimgcyfkxyogapmcbbqdtqlchqxvgpqoipmcwfbpsknuljqqmlkrlaebkjhmrzuzrkyygcpvantvnnveqifucobhiwomnvaemdrrlwirxazfoqkqnupiwg"; +Constant str_230 = "sjzqylkvzueqrmklrhjigaregizfwylzlubbjjwzopgqjcyrjnoscrysksegkkhjlnynlqwanpdsxxnhmtfqsdklhiyiizhxqosomtotdcilvfposlwdnnmnquzwtaloyhwtnbowckppyzeabupamabzjztqzpymvvkqcczupenpvumpqemqwauuozqjrrftynimywexpsifygwnnrygdzmbfrzkyquvebitfnpmsvqyfpztuhpajfpzqzefoupq"; +Constant str_231 = "akfkorkagncnnsxancctqdnlvmvlfqhcdquknbwzyzshklbzuebhgxzwirbhcsozrapeflrotohoucmbdayvoqdjnrerfhisreanudaholuknxcyjaovhpiwfngbptsoiiozxcmoklrmkmzimtzdfwzwtblukhvqepgrtqleqosovvzncxszpkmwjyvawifacjrctjmfgmrouahifpzravjxiwiwdcmxquvizbklasposnhqtnyrcfnpciyffqjz"; +Constant str_232 = "ydgbxxkckvhcmsuxxyrskmqgldrvksxjpslefkmuaimydszpkcnkqljfdfqluxxjcqsuuuifygkfzkkzgbycyebthjdylmisadihwprhsarmbjqhorixnaiiaiwrzyqpmbsfjthdosdisqdhmzhkicwgylaewjmwrhbdtycdmnfquhsxwuhkhutcgtcjefcvnpfznmbwqjvmbyikiyefcyibrjvozeboqarcmiplcugczbxljlwberpiautrnkkp"; +Constant str_233 = "uwxkksynxrzuwzrpgoaozqodaripbvgkjrhnpjghziiuftaozxcdxghoeicrxrgltqigorgxnbtosyjkqhyfrvstzxsucpvdnkcxbxiujdntncveitqwfancosklhbswdaxzwqrkokklgtclmntfpukybrxlgeennfkqtfzdwlflgtkvgxmvnzxljzlpifoqdtxsxpnhzlvzxjuacjgsfcfhmdxnnjmqiiyrmcnbqgzydywibvbwwteummnzjufc"; +Constant str_234 = "gxtltvifzqrjjpjugmrwvkngapzmiqgqivoutnzwsdrzstznvebyhsmorshcdlaakmhcxbfnljazbtvyvlvvebfthhanoreytcngfieewfkegogyuaqtvaacvkdeyjdywoplomtxhugejnrpzyinomekbzqpcwkhxfpjgyiybdtlygrolmmxrsjyutyzwnvweipamkyiivylyzyjcphxeohffpwlwyljqjkpfytnefepvotfenqrqfgjwvfxzxre"; +Constant str_235 = "nhvpmmnysauvvpxilyevvvwmpuqjdtntwrpavipujgcoaksfrahtrobycbshdkzswcfdehdbrhhkeurvalbqaiafnogcxvingufjadrpvvtzannkbtwrtgceryjorterybfpaeiwktxcsgzevvxchkbctswnkewftiparqnsakosfjasguzfecqunqdracrggdrfrloemctdifbcmlywicgqpknykfxhajcrpinekrokdzjjzrlzhhgcmncpsfbp"; +Constant str_236 = "ufzkxtwjhllkaezynplkxfylabqacfprfcgsmlwothchepjtcoegqujzolrsrhwyldplbowmbiukwascmfwnziimzbrwkvcdwakknfrvxvvooyiksfgclkycymhygnwrbtkjxzfwgzexxdednkhgfnxsyickrcznkvcdhzvqccgxuybzpkfhyakyttwwgccoedmrbddjtukvmumxunrcfqenacrscfyalxrwybxrkstjbrskwyhfwghswgpibsta"; +Constant str_237 = "lsesruquclwvjykupeiwxgiswabjrxkpydmxgurxyhxmzetkxnxmrnzbyffnwiypjyvypbhqlzbqobrmjiqouujrwtfexcbgxkluwlujstxtrjqbsoxomoizzftovlmoutxwuhlfbaiwzwkqcmqkuaigvqxnkkrrbjpldrcenjnlisybgnermxvxjhhvruirkdmwkprvdkvkdjowvopjmleldpjzynqfqrdanesvoagkysklrfguzzakhliiyzlp"; +Constant str_238 = "swoyqifuecpopyeshymtnyvzuxknwkwxvtgepqorxrkkptdmrgysgkqccwdoomrazfridtivofiypexxmareoztnfdvucywyclrntdssgwckqfrkqvvtqrfgjmaexygrtgkbpxfvgmtypyhrgdpqzitsgimllzjvmetddrkvaqqowoalluycohjvjttxjwybjbtsjajollmwllayjfzccnytsoswhbwpbulsylbgqtviylltonvsaoajelqppyqb"; +Constant str_239 = "ywlzhcimiqssvjgkqkshhtrzhtgsrrvhoouwkdzjehrburoowivtywoerzjfvptrwlgtivbunvrctqxkucjjkmofsqfbqgiujsafdgkqvpqqkkoqltqnezfbnbwjltzerugprdmvilqkwjtifnbintgrrukhlsrggqmxdmensmgwipoygkykrymmhcjltkhlkpzhyqwwvnveobpodiavlzojlbxlihcgvoucmsapsdymovjoqftbmfgnjzydhkkt"; +Constant str_240 = "thnrxxiocswsubrkzappsazoiiadujiqkhdlzyesltdrjyfusuxkjfjfspqcywqkvtyikfndaxzvajbkodmvhhacmqebsqqdehbgdkvkzdhyfritslamwsqpzclhcykystmdkypilfyvyelucvawoygddzutqjwjrziegmheojxbkjeoyynmmlivmjqepplwlzbkiviwzsoqqsdxolqlmpgpujdydnrixxxujokssikentcgkrrtkfbhfmabomws"; +Constant str_241 = "yqslbbxpxbaibnsulafkelajimcojrtcrghhajsfxoxvxcnoyeynwghfnpicikruartxprppmcfvhlevyebmxdjmqweorsgregfossaeikckedrfjcxvijrxxhqyvmiinhddjrdlbkbfgwjswwosyqyqmnizybipklvpqxxxqdwcivbrogtvhjiacfbgspbruovgctqvmhbaapjhonfsublnvittdtrdcysvxwasnepxmeevabcckhhpaaeyecde"; +Constant str_242 = "fakbdchyzpmkfdscaajpcbhdnancmgjrcbfwlzmacqdkvpourlhaevjwoysbzzgnhpzplmeqdubybexrsyedyvlmxxtbfbsujnvdqesnatvfmwgqsviebjcrokyqgfgptvhosctnbdwduedtavlvfpemfiwriejyqpbkbwpbilavgjxwfxftvdegvhnwrpjtlfmchtgyxohjwzaipjyhdxzyerwijuxcmplnmwiimfulabmsvcedgvisymjtraab"; +Constant str_243 = "vmhdwkuhgoamgoiylqtirexlzcucqjhqummpjhkpgvhzhchijpzrzwncwrlwncnykwalxhyidepkawhmoahrgqdykcnxewkddqwxpggxuyrioasnmfswdhodzoyegrbnmmgrxphpzyzbvdboccydfjtmyzgdcdqlgmgucjqrbrqejcsvyrlrhzdpkzkzwnpwuguvsjtlvgowbydtswgqhtqtvaphdmyjbcvbjolvvowbhuapskvearkeqnmndtfz"; +Constant str_244 = "gbnnagaqblzlqodluzeybblbgyvvdwgroloaqesaxawvakhzbfcslrvkrpcloxndskcihwpamwjzuawqwowvrypufurqkquhowccnjkdrrvirwfdjnbpjnhdyxyiltoqnhhopsgftiewatfuivnydcekfrwokxnhqjdmlwqrgqcrvdkmcjtcdqnsilgmitqrewxcckwlclscjociikopuqynyaxunrewawplktliuaovxnztohxfuulptklmvvdk"; +Constant str_245 = "tugtxcpalastqeibkabkqpkbfehsdrajcoieqnjbjsnunnrcqlkjklhnybfeoehtraegwjrpkoqnxmglekknibrrfqirfedkhzlivuhdmlvvgmzfzpluxwyfrlpuogviddciuuhdafserfkbncccgcixhymqdrlvzzyorrqhdozoynxiefxenvnjcakojfgiwbzunuovzoiopsmozrbanosyvcipwcjiccukflzpnlxpszyabbvkxptaqtbgwfhu"; +Constant str_246 = "mmttaimmrjarzzvsftftnqryjkxvzrroftfnumvwcticgkypchzzqjqcyulxxbdveakufsxgkfhuiccfbejzzjkjnjaxjmvhtizivviuqwfmokuuwltoarjzsebehioofkgxemuvniynjwjurjvkjemgqzxlyensaqolwwvpzjbijebkxsxabacqwzmrefgsmmzluinlmcxexqcutkdljkrsvtgqsrtaxvqhweyftlrsimjnriwwsfhrhribprqo"; +Constant str_247 = "gmbfbdntoazbyulotnjirnyqxgrvdrjtfrsayoxbekmbosvoeibmcdncosrcvhvjkcpfdvkierzfnoolxihwqyqxkkbphgkwrlpbrpwdkmhkqdenskujmrnqdznvnpurmfqcgexwyzjiywjviqodegssnnxvtabcyetwdtsdknvjtsrkrzgqoycsxhjffvqjfhmaqbvtnpadlpsljiwzhyawnfilymlzqqjyglzwbziskkctrotphpzizmownbxw"; +Constant str_248 = "zdtlhfykaedtmeqlzmmlwdfpewsfcquqdxiajnodjbbmgafhjjqowtzetzpuxytrpcddbaahuhbovdisyvyfodeencmkmsffvbtclnlorurkttvngdwicvrtnxhehzoqkuudssxbeboqhkkuflruamnavnbmkujawzlwkqeemedriygsumsywjzsdyoutnhtooskcpxuerpmkyoodtixugasxpoyoyhxycofywtnrbzaztuowfqjsogqipffxwak"; +Constant str_249 = "mrodobtfsezgtloprrcoatwxvrlzixpvostkhyrmlrfalqybfhkuyiyknbrfvwwgpmyxxfaeeefdwwxvcbldzgsyeigcrqfsyicmjryjsjbmpbotlruoafqijmhijgyusekpybjunvkkdecoltzeoojzhagfeaexfjxxpflyfqwjqbeitccorxmcmtvidhgttvvnunobxjzmlkxtnnawjietcqapbxkpmgqmtcjiucmirajpwfrxfngvlzxqotls"; +Constant str_250 = "owmnrozgihasphhiwnaiakwomeuvfiviihtpdkxnjzxuhtluigydpktulqimbjfvbtzhzmjkuosqueectsggbcxddomsarxuwdywsqhcbmjstrbtfsnocgmvnhwrqseeoiykctsnjpsappqyrsrfmzkrlfzdvhcdbwgxxwbzvbvbwgtzdwfftqbxrinkphcxkencrttynguglhckpmmkkowvolonmmlxwtbrcdtnoiteqsmumgfekjysshtlkuwu"; +Constant str_251 = "scwbeveveximfjochplbehpnuokiaqnzoighajwbinlkrtffnpbbjiftooymhszeiofdiqywefrvvnxkhifjuhlzujmarkctrksjonmpjeyizdgdmturaudmynnlybljgnkdpaesuizniokgodwkgskagtaltakflhtxjpfvdhibwupivblsdoqxeoneklywbgsqpujazkhlphuyoxjnltidxckcdaauzczdfaywljqfgxejqydozlgxyzafskac"; +Constant str_252 = "nltwkydoacbfmecibzevjsxdvvrxrokczjfqfvqgenhzixzbyflvlnvqgygofsnlsozvxdezwinjnrlcvtbduvjibhigeklalxpniixqyfhckonpsaggcwvhqllyokpeptxlfudujhebwcpnupqwjdjmxoyxexufbdqhbxmhkihftzdimdugyeggtexgzvhkagteqnfakmtheogjiajaolhhhaaehxwfubrohffarewwqkynsybrxhpqghmzsemk"; +Constant str_253 = "zkhkdiiiemnsyznhssdpyzlaprnlspvwbmdpudlsxkqwjnqyqzbsywlhpazibzebiirvhdwwqrapgncckfchzamhnmzzzatlmkezhnxpfpqqvqqkrvxsttuqzatpqvwkaijwfwhpgdrcmtaywqdsdphugbzxwgevrrjchaxfivwohurtxobmudlwwbdqxgnozojciwwwcjsezehkyvyjhccpjkisdyrtooakwyicwadawgoffujdmghgidawwqse"; +Constant str_254 = "ufglypgsnivffjmbsbgqvbicytcsjdjclbzvezmfjknwhagmldpotsmghgfmdrcmpgixpgjmjykmqtxmtwsakwoeglbrwjnwzgmmbgldgwfnlkpnfwbuqckuxixovkgqllnpmyrcygcedbvhuykydzniqaoyiqsmqddaqzfxianhmbwyspyttbuvrowhhwvaexjgwrjzektssngbqxxclzpytujymgrxyvctvtcnizqmlyiaghrixmrptclveuot"; +Constant str_255 = "cstkjotayznboqjzcdcdzodraqcyvkwtcsdlvsboxcskfyvmegxeigmmsisrbzsicguoiynaxbqzggnlmkcfitlakwygceebvyhrkyeydjjxqpytfbvcsuaqhwthwsxwbfnroajcfkjpofcxhovwhsurreztsuafvfxqpeadpiownpuhsqjzylgfoevyytvrcywurcrplrfkqigmnrrdblvgolbaonimjwvhpievblyozfgcdkdrgounwxouhnpp"; diff --git a/inform6/Tests/Test Cases/staticarraytest-G.inf b/inform6/Tests/Test Cases/staticarraytest-G.inf new file mode 100755 index 000000000..a92a227ae --- /dev/null +++ b/inform6/Tests/Test Cases/staticarraytest-G.inf @@ -0,0 +1,350 @@ +Constant Story "StaticArrayTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for the ability to create arrays in +! static memory. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +! Comment this out to test only classical (dynamic) arrays. You can do +! this if you're compiling with an older version of Inform. +Constant TEST_STATIC_ARRAYS 1; + +[ Main loc; + #Ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 loc; + #Endif; ! TARGET_ + + loc = 0; + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #ifnot; + print "Game file format ", 0->0, ".^"; + #Endif; ! TARGET_GLULX +]; + +[ RunTest; + #ifdef TARGET_ZCODE; + print "Static memory begins at address ", 0-->7, ".^";; + #ifnot; ! TARGET_GLULX; + print "Dynamic memory begins at address ", 0-->2, ".^";; + #endif; ! TARGET; + + TestDynamicArrays(); + + #ifdef TEST_STATIC_ARRAYS; + TestStaticArrays(); + #endif; ! TEST_STATIC_ARRAYS; + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +Object testobj + with bufferarrayprop bufferarray; + +Global bytearrayref = bytearray; + +Array wordarray --> 10 testobj "foo" 'bar' check_value 14 propobj wordarray bytearray; +Array bytearray -> 5 6 7 8; +Array stringarray string "frotz"; +Array tablearray table 6; +Array bufferarray buffer 11; +Array bigarray -> 431; +Array bracket1array table [ 4 ]; +Array bracket5array table [ 55 66 77; 'eight'; 99 ]; + +Global stringarrayref = stringarray; + +Object propobj + with tablearrayprop tablearray, + with wordarrayprop wordarray; + +[ TestDynamicArrays val val2; + print "^TestDynamicArrays:^"; + + print "wordarray-->0: "; check_value(wordarray-->0, 10); print "^"; + print "wordarray-->1: "; check_value(wordarray-->1, testobj); print "^"; + print "wordarray-->2: ", (string) wordarray-->2, "; is string:"; check_value(wordarray-->2 ofclass String, 1); print "^"; + print "wordarray-->3: "; check_value(wordarray-->3, 'bar'); print "^"; + print "wordarray-->4: "; check_value(wordarray-->4, check_value); print "^"; + print "wordarray-->5: "; check_value(wordarray-->5, 14); print "^"; + print "wordarray-->6: "; check_value(wordarray-->6, propobj); print "^"; + print "wordarray-->7: "; check_value(wordarray-->7, wordarray); print "^"; + print "wordarray-->8: "; check_value(wordarray-->8, bytearray); print "^"; + + print "bytearray->0: "; check_value(bytearray->0, 5); print "^"; + print "bytearray->3: "; check_value(bytearray->3, 8); print "^"; + + print "stringarray->0: "; check_value(stringarray->0, 5); print "^"; + print "stringarray->1: "; check_value(stringarray->1, 'f'); print "^"; + print "stringarray->5: "; check_value(stringarray->5, 'z'); print "^"; + + print "tablearray-->0: "; check_value(tablearray-->0, 6); print "^"; + print "tablearray-->1: "; check_value(tablearray-->1, 0); print "^"; + print "tablearray-->6: "; check_value(tablearray-->6, 0); print "^"; + tablearray-->6 = 33; + print "tablearray-->6: "; check_value(tablearray-->6, 33); print "^"; + + print "bufferarray-->0: "; check_value(bufferarray-->0, 11); print "^"; + print "bufferarray->W+0: "; check_value(bufferarray->(WORDSIZE+0), 0); print "^"; + print "bufferarray->W+10: "; check_value(bufferarray->(WORDSIZE+10), 0); print "^"; + bufferarray->(WORDSIZE+10) = 'A'; + print "bufferarray->W+10: "; check_value(bufferarray->(WORDSIZE+10), 'A'); print "^"; + + print "bytearrayref: "; check_value(bytearrayref, bytearray); print "^"; + print "stringarrayref: "; check_value(stringarrayref, stringarray); print "^"; + print "testobj.bufferarrayprop: "; check_value(testobj.bufferarrayprop, bufferarray); print "^"; + print "propobj.tablearrayprop: "; check_value(propobj.tablearrayprop, tablearray); print "^"; + print "propobj.wordarrayprop: "; check_value(propobj.wordarrayprop, wordarray); print "^"; + + print "bigarray->430: "; check_value(bigarray->430, 0); print "^"; + bigarray->430 = 75; + print "bigarray->430: "; check_value(bigarray->430, 75); print "^"; + + print "bracket1array-->0: "; check_value(bracket1array-->0, 1); print "^"; + print "bracket1array-->1: "; check_value(bracket1array-->1, 4); print "^"; + print "bracket5array-->0: "; check_value(bracket5array-->0, 5); print "^"; + print "bracket5array-->1: "; check_value(bracket5array-->1, 55); print "^"; + print "bracket5array-->4: "; check_value(bracket5array-->4, 'eight'); print "^"; + print "bracket5array-->5: "; check_value(bracket5array-->5, 99); print "^"; + + ! The random() function implicitly constructs an array. + val = random(8, 8, 8, 8, 8); + print "random(): "; check_value(val, 8); print "^"; + + print "wordarray: "; check_address_dynamic(wordarray); + print "bytearray: "; check_address_dynamic(bytearray); + print "stringarray: "; check_address_dynamic(stringarray); + print "tablearray: "; check_address_dynamic(tablearray); + print "bufferarray: "; check_address_dynamic(bufferarray); + print "bigarray: "; check_address_dynamic(bigarray); + print "bracket1array: "; check_address_dynamic(bracket1array); + print "bracket5array: "; check_address_dynamic(bracket5array); + + #ifdef STRICT_MODE; + + print "^The following lines should produce 4 veneer programming errors, as we access outside array bounds. This is expected!^"; + val = 431; + val2 = bigarray->val; + bigarray->val = 0; + val = 9; + val2 = wordarray-->val; + wordarray-->val = 0; + + #ifnot; ! STRICT_MODE + + print "^Skipping array-bounds test because we did not compile with strict (-S) mode.^"; + + #Endif; ! STRICT_MODE +]; + +#ifdef TEST_STATIC_ARRAYS; + +Object testobjst + with bufferarrayprop bufferarrayst; + +Global bytearraystref = bytearrayst; + +Array wordarrayst static --> 11 testobjst 'bar' "foo" check_value propobjst wordarrayst bytearrayst 99; +Array bytearrayst static -> 15 16 17 18; +Array stringarrayst static string "plugh"; +Array tablearrayst static table 7; +Array bufferarrayst static buffer 13; +Array bigarrayst static -> 531; + +Global stringarraystref = stringarrayst; + +Object propobjst + with tablearrayprop tablearrayst, + with wordarrayprop wordarrayst; + +[ TestStaticArrays arr val val2; + print "^TestStaticArrays:^"; + + print "wordarrayst-->0: "; check_value(wordarrayst-->0, 11); print "^"; + print "wordarrayst-->1: "; check_value(wordarrayst-->1, testobjst); print "^"; + print "wordarrayst-->2: "; check_value(wordarrayst-->2, 'bar'); print "^"; + print "wordarrayst-->3: ", (string) wordarrayst-->3, "; is string:"; check_value(wordarrayst-->3 ofclass String, 1); print "^"; + print "wordarrayst-->4: "; check_value(wordarrayst-->4, check_value); print "^"; + print "wordarrayst-->5: "; check_value(wordarrayst-->5, propobjst); print "^"; + print "wordarrayst-->6: "; check_value(wordarrayst-->6, wordarrayst); print "^"; + print "wordarrayst-->7: "; check_value(wordarrayst-->7, bytearrayst); print "^"; + print "wordarrayst-->8: "; check_value(wordarrayst-->8, 99); print "^"; + + print "bytearrayst->0: "; check_value(bytearrayst->0, 15); print "^"; + print "bytearrayst->3: "; check_value(bytearrayst->3, 18); print "^"; + + print "stringarrayst->0: "; check_value(stringarrayst->0, 5); print "^"; + print "stringarrayst->1: "; check_value(stringarrayst->1, 'p'); print "^"; + print "stringarrayst->5: "; check_value(stringarrayst->5, 'h'); print "^"; + + print "tablearrayst-->0: "; check_value(tablearrayst-->0, 7); print "^"; + print "tablearrayst-->1: "; check_value(tablearrayst-->1, 0); print "^"; + print "tablearrayst-->6: "; check_value(tablearrayst-->7, 0); print "^"; + + print "bufferarrayst-->0: "; check_value(bufferarrayst-->0, 13); print "^"; + print "bufferarrayst->W+0: "; check_value(bufferarrayst->(WORDSIZE+0), 0); print "^"; + print "bufferarrayst->W+12: "; check_value(bufferarrayst->(WORDSIZE+12), 0); print "^"; + + print "bytearraystref: "; check_value(bytearraystref, bytearrayst); print "^"; + print "stringarraystref: "; check_value(stringarraystref, stringarrayst); print "^"; + print "testobjst.bufferarrayprop: "; check_value(testobjst.bufferarrayprop, bufferarrayst); print "^"; + print "propobjst.tablearrayprop: "; check_value(propobjst.tablearrayprop, tablearrayst); print "^"; + print "propobjst.wordarrayprop: "; check_value(propobjst.wordarrayprop, wordarrayst); print "^"; + + print "wordarrayst: "; check_address_static(wordarrayst); + print "bytearrayst: "; check_address_static(bytearrayst); + print "stringarrayst: "; check_address_static(stringarrayst); + print "tablearrayst: "; check_address_static(tablearrayst); + print "bufferarrayst: "; check_address_static(bufferarrayst); + print "bigarrayst: "; check_address_static(bigarrayst); + + #ifdef STRICT_MODE; + + print "^The following lines should produce 4 veneer programming errors, as we access outside array bounds. This is expected!^"; + val = 531; + val2 = bigarrayst->val; + val = 9; + val2 = wordarrayst-->val; + arr = bigarrayst; + arr->0 = 0; + arr = wordarrayst; + arr-->0 = 0; + + #ifnot; ! STRICT_MODE + + print "^Skipping array-bounds test because we did not compile with strict (-S) mode.^"; + + #Endif; ! STRICT_MODE +]; + +#endif; ! TEST_STATIC_ARRAYS + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +[ check_address_dynamic addr val; + #ifdef TARGET_ZCODE; + + val = 0-->7; ! start of static memory + if (addr >= 0 && addr < val) { + print addr, " is dynamic.^"; + rtrue; + } + failures++; + print "ERROR, address ", addr, " is not in dynamic memory.^"; + + #ifnot; ! TARGET_GLULX; + + val = 0-->2; ! start of dynamic memory + if (addr >= val) { + print addr, " is dynamic.^"; + rtrue; + } + failures++; + print "ERROR, address ", addr, " is not in dynamic memory.^"; + + #endif; ! TARGET; +]; + +[ check_address_static addr val; + #ifdef TARGET_ZCODE; + + val = 0-->7; ! start of static memory + if (addr >= val) { + print addr, " is static.^"; + rtrue; + } + failures++; + print "ERROR, address ", addr, " is not in static memory.^"; + + #ifnot; ! TARGET_GLULX; + + val = 0-->2; ! start of dynamic memory + if (addr >= 0 && addr < val) { + print addr, " is static.^"; + rtrue; + } + failures++; + print "ERROR, address ", addr, " is not in static memory.^"; + + #endif; ! TARGET; +]; + diff --git a/inform6/Tests/Test Cases/staticarraytest.inf b/inform6/Tests/Test Cases/staticarraytest.inf new file mode 100755 index 000000000..a92a227ae --- /dev/null +++ b/inform6/Tests/Test Cases/staticarraytest.inf @@ -0,0 +1,350 @@ +Constant Story "StaticArrayTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for the ability to create arrays in +! static memory. + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +! Comment this out to test only classical (dynamic) arrays. You can do +! this if you're compiling with an older version of Inform. +Constant TEST_STATIC_ARRAYS 1; + +[ Main loc; + #Ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 loc; + #Endif; ! TARGET_ + + loc = 0; + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #ifnot; + print "Game file format ", 0->0, ".^"; + #Endif; ! TARGET_GLULX +]; + +[ RunTest; + #ifdef TARGET_ZCODE; + print "Static memory begins at address ", 0-->7, ".^";; + #ifnot; ! TARGET_GLULX; + print "Dynamic memory begins at address ", 0-->2, ".^";; + #endif; ! TARGET; + + TestDynamicArrays(); + + #ifdef TEST_STATIC_ARRAYS; + TestStaticArrays(); + #endif; ! TEST_STATIC_ARRAYS; + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; + +Object testobj + with bufferarrayprop bufferarray; + +Global bytearrayref = bytearray; + +Array wordarray --> 10 testobj "foo" 'bar' check_value 14 propobj wordarray bytearray; +Array bytearray -> 5 6 7 8; +Array stringarray string "frotz"; +Array tablearray table 6; +Array bufferarray buffer 11; +Array bigarray -> 431; +Array bracket1array table [ 4 ]; +Array bracket5array table [ 55 66 77; 'eight'; 99 ]; + +Global stringarrayref = stringarray; + +Object propobj + with tablearrayprop tablearray, + with wordarrayprop wordarray; + +[ TestDynamicArrays val val2; + print "^TestDynamicArrays:^"; + + print "wordarray-->0: "; check_value(wordarray-->0, 10); print "^"; + print "wordarray-->1: "; check_value(wordarray-->1, testobj); print "^"; + print "wordarray-->2: ", (string) wordarray-->2, "; is string:"; check_value(wordarray-->2 ofclass String, 1); print "^"; + print "wordarray-->3: "; check_value(wordarray-->3, 'bar'); print "^"; + print "wordarray-->4: "; check_value(wordarray-->4, check_value); print "^"; + print "wordarray-->5: "; check_value(wordarray-->5, 14); print "^"; + print "wordarray-->6: "; check_value(wordarray-->6, propobj); print "^"; + print "wordarray-->7: "; check_value(wordarray-->7, wordarray); print "^"; + print "wordarray-->8: "; check_value(wordarray-->8, bytearray); print "^"; + + print "bytearray->0: "; check_value(bytearray->0, 5); print "^"; + print "bytearray->3: "; check_value(bytearray->3, 8); print "^"; + + print "stringarray->0: "; check_value(stringarray->0, 5); print "^"; + print "stringarray->1: "; check_value(stringarray->1, 'f'); print "^"; + print "stringarray->5: "; check_value(stringarray->5, 'z'); print "^"; + + print "tablearray-->0: "; check_value(tablearray-->0, 6); print "^"; + print "tablearray-->1: "; check_value(tablearray-->1, 0); print "^"; + print "tablearray-->6: "; check_value(tablearray-->6, 0); print "^"; + tablearray-->6 = 33; + print "tablearray-->6: "; check_value(tablearray-->6, 33); print "^"; + + print "bufferarray-->0: "; check_value(bufferarray-->0, 11); print "^"; + print "bufferarray->W+0: "; check_value(bufferarray->(WORDSIZE+0), 0); print "^"; + print "bufferarray->W+10: "; check_value(bufferarray->(WORDSIZE+10), 0); print "^"; + bufferarray->(WORDSIZE+10) = 'A'; + print "bufferarray->W+10: "; check_value(bufferarray->(WORDSIZE+10), 'A'); print "^"; + + print "bytearrayref: "; check_value(bytearrayref, bytearray); print "^"; + print "stringarrayref: "; check_value(stringarrayref, stringarray); print "^"; + print "testobj.bufferarrayprop: "; check_value(testobj.bufferarrayprop, bufferarray); print "^"; + print "propobj.tablearrayprop: "; check_value(propobj.tablearrayprop, tablearray); print "^"; + print "propobj.wordarrayprop: "; check_value(propobj.wordarrayprop, wordarray); print "^"; + + print "bigarray->430: "; check_value(bigarray->430, 0); print "^"; + bigarray->430 = 75; + print "bigarray->430: "; check_value(bigarray->430, 75); print "^"; + + print "bracket1array-->0: "; check_value(bracket1array-->0, 1); print "^"; + print "bracket1array-->1: "; check_value(bracket1array-->1, 4); print "^"; + print "bracket5array-->0: "; check_value(bracket5array-->0, 5); print "^"; + print "bracket5array-->1: "; check_value(bracket5array-->1, 55); print "^"; + print "bracket5array-->4: "; check_value(bracket5array-->4, 'eight'); print "^"; + print "bracket5array-->5: "; check_value(bracket5array-->5, 99); print "^"; + + ! The random() function implicitly constructs an array. + val = random(8, 8, 8, 8, 8); + print "random(): "; check_value(val, 8); print "^"; + + print "wordarray: "; check_address_dynamic(wordarray); + print "bytearray: "; check_address_dynamic(bytearray); + print "stringarray: "; check_address_dynamic(stringarray); + print "tablearray: "; check_address_dynamic(tablearray); + print "bufferarray: "; check_address_dynamic(bufferarray); + print "bigarray: "; check_address_dynamic(bigarray); + print "bracket1array: "; check_address_dynamic(bracket1array); + print "bracket5array: "; check_address_dynamic(bracket5array); + + #ifdef STRICT_MODE; + + print "^The following lines should produce 4 veneer programming errors, as we access outside array bounds. This is expected!^"; + val = 431; + val2 = bigarray->val; + bigarray->val = 0; + val = 9; + val2 = wordarray-->val; + wordarray-->val = 0; + + #ifnot; ! STRICT_MODE + + print "^Skipping array-bounds test because we did not compile with strict (-S) mode.^"; + + #Endif; ! STRICT_MODE +]; + +#ifdef TEST_STATIC_ARRAYS; + +Object testobjst + with bufferarrayprop bufferarrayst; + +Global bytearraystref = bytearrayst; + +Array wordarrayst static --> 11 testobjst 'bar' "foo" check_value propobjst wordarrayst bytearrayst 99; +Array bytearrayst static -> 15 16 17 18; +Array stringarrayst static string "plugh"; +Array tablearrayst static table 7; +Array bufferarrayst static buffer 13; +Array bigarrayst static -> 531; + +Global stringarraystref = stringarrayst; + +Object propobjst + with tablearrayprop tablearrayst, + with wordarrayprop wordarrayst; + +[ TestStaticArrays arr val val2; + print "^TestStaticArrays:^"; + + print "wordarrayst-->0: "; check_value(wordarrayst-->0, 11); print "^"; + print "wordarrayst-->1: "; check_value(wordarrayst-->1, testobjst); print "^"; + print "wordarrayst-->2: "; check_value(wordarrayst-->2, 'bar'); print "^"; + print "wordarrayst-->3: ", (string) wordarrayst-->3, "; is string:"; check_value(wordarrayst-->3 ofclass String, 1); print "^"; + print "wordarrayst-->4: "; check_value(wordarrayst-->4, check_value); print "^"; + print "wordarrayst-->5: "; check_value(wordarrayst-->5, propobjst); print "^"; + print "wordarrayst-->6: "; check_value(wordarrayst-->6, wordarrayst); print "^"; + print "wordarrayst-->7: "; check_value(wordarrayst-->7, bytearrayst); print "^"; + print "wordarrayst-->8: "; check_value(wordarrayst-->8, 99); print "^"; + + print "bytearrayst->0: "; check_value(bytearrayst->0, 15); print "^"; + print "bytearrayst->3: "; check_value(bytearrayst->3, 18); print "^"; + + print "stringarrayst->0: "; check_value(stringarrayst->0, 5); print "^"; + print "stringarrayst->1: "; check_value(stringarrayst->1, 'p'); print "^"; + print "stringarrayst->5: "; check_value(stringarrayst->5, 'h'); print "^"; + + print "tablearrayst-->0: "; check_value(tablearrayst-->0, 7); print "^"; + print "tablearrayst-->1: "; check_value(tablearrayst-->1, 0); print "^"; + print "tablearrayst-->6: "; check_value(tablearrayst-->7, 0); print "^"; + + print "bufferarrayst-->0: "; check_value(bufferarrayst-->0, 13); print "^"; + print "bufferarrayst->W+0: "; check_value(bufferarrayst->(WORDSIZE+0), 0); print "^"; + print "bufferarrayst->W+12: "; check_value(bufferarrayst->(WORDSIZE+12), 0); print "^"; + + print "bytearraystref: "; check_value(bytearraystref, bytearrayst); print "^"; + print "stringarraystref: "; check_value(stringarraystref, stringarrayst); print "^"; + print "testobjst.bufferarrayprop: "; check_value(testobjst.bufferarrayprop, bufferarrayst); print "^"; + print "propobjst.tablearrayprop: "; check_value(propobjst.tablearrayprop, tablearrayst); print "^"; + print "propobjst.wordarrayprop: "; check_value(propobjst.wordarrayprop, wordarrayst); print "^"; + + print "wordarrayst: "; check_address_static(wordarrayst); + print "bytearrayst: "; check_address_static(bytearrayst); + print "stringarrayst: "; check_address_static(stringarrayst); + print "tablearrayst: "; check_address_static(tablearrayst); + print "bufferarrayst: "; check_address_static(bufferarrayst); + print "bigarrayst: "; check_address_static(bigarrayst); + + #ifdef STRICT_MODE; + + print "^The following lines should produce 4 veneer programming errors, as we access outside array bounds. This is expected!^"; + val = 531; + val2 = bigarrayst->val; + val = 9; + val2 = wordarrayst-->val; + arr = bigarrayst; + arr->0 = 0; + arr = wordarrayst; + arr-->0 = 0; + + #ifnot; ! STRICT_MODE + + print "^Skipping array-bounds test because we did not compile with strict (-S) mode.^"; + + #Endif; ! STRICT_MODE +]; + +#endif; ! TEST_STATIC_ARRAYS + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +[ check_address_dynamic addr val; + #ifdef TARGET_ZCODE; + + val = 0-->7; ! start of static memory + if (addr >= 0 && addr < val) { + print addr, " is dynamic.^"; + rtrue; + } + failures++; + print "ERROR, address ", addr, " is not in dynamic memory.^"; + + #ifnot; ! TARGET_GLULX; + + val = 0-->2; ! start of dynamic memory + if (addr >= val) { + print addr, " is dynamic.^"; + rtrue; + } + failures++; + print "ERROR, address ", addr, " is not in dynamic memory.^"; + + #endif; ! TARGET; +]; + +[ check_address_static addr val; + #ifdef TARGET_ZCODE; + + val = 0-->7; ! start of static memory + if (addr >= val) { + print addr, " is static.^"; + rtrue; + } + failures++; + print "ERROR, address ", addr, " is not in static memory.^"; + + #ifnot; ! TARGET_GLULX; + + val = 0-->2; ! start of dynamic memory + if (addr >= 0 && addr < val) { + print addr, " is static.^"; + rtrue; + } + failures++; + print "ERROR, address ", addr, " is not in static memory.^"; + + #endif; ! TARGET; +]; + diff --git a/inform6/Tests/Test Cases/undefdirectivetest-G.inf b/inform6/Tests/Test Cases/undefdirectivetest-G.inf new file mode 100755 index 000000000..f22fd1ab5 --- /dev/null +++ b/inform6/Tests/Test Cases/undefdirectivetest-G.inf @@ -0,0 +1,234 @@ +Constant Story "UndefDirectiveTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for the Undef directive +! (remove the definition of a Constant). + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #Endif; ! TARGET_GLULX +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +[ testfunc; + ! This symbol isn't defined yet, but it will be. + return FutureSymbol; +]; + +Object sword; +Array testarray --> 4; + +! Here's a constant. +Constant UndefMe = 1; +! Undefine it. +Undef UndefMe; + +#ifndef UndefMe; +! UndefMe should be undefined now. +Constant UndefMe_post 1; +#endif; + +! Here's another constant. +Constant UndefMe2; +! Undefine it, with the optional hash sign. +#undef UndefMe2; +! Redefine it. +Constant UndefMe2 = 99; +! Undefine it again. +#undef UndefMe2; + +! It's legal to Undef a symbol which was never defined at all. +Undef NotDefinedAtAll; + +! If you Undef a symbol which will be defined later, it doesn't affect +! the later definition. +Undef WillBeDefinedLater; + + +#ifndef WillBeDefinedLater; +! WillBeDefinedLater is not yet defined. +Constant WillBeDefinedLater_pre 3; +#endif; + +Constant WillBeDefinedLater = 2; + +#ifdef WillBeDefinedLater; +! WillBeDefinedLater is defined now. +Constant WillBeDefinedLater_post 4; +#endif; + + +! Here's a constant. +Constant RemainsDefined = 5; + +#ifdef Zggrablfoo; +! This doesn't happen, because it's #if'd out. +Undef RemainsDefined; +#endif; + +#ifdef NotDefinedAtAll; +! This doesn't happen, because it's #if'd out. +Undef RemainsDefined; +#endif; + + +! "FutureSymbol" was forward-referenced from an earlier function. +! Undef'ing it has no effect, because it's not actually defined yet. +! (I think it makes sense for this to be legal.) +Undef FutureSymbol; + +! Okay, define FutureSymbol now. +Constant FutureSymbol = 6; + + +! The following lines should fail, producing errors of the form +! "Expected symbol name but found ..." +! Uncomment them to test this. +! +! Undef; +! Undef Undef; +! Undef 1234; +! Undef "Hello"; +! Undef (1); + +! The following lines should fail, producing errors of the form +! "Cannot Undef a symbol which is not a defined constant: ..." +! Uncomment them to test this. +! +! Undef Banner; +! Undef sword; +! Undef failures; +! Undef testarray; + + +[ RunTest val; + val = testarray; ! silence compiler warning + val = testfunc; ! silence compiler warning + + print "UndefMe_post: "; + check_value(UndefMe_post, 1); + print ".^"; + + #ifdef UndefMe; + ! UndefMe should be undefined now. + print "ERROR: UndefMe is defined!^"; + failures++; + #endif; + + #ifdef UndefMe2; + ! UndefMe2 should be undefined now. + print "ERROR: UndefMe2 is defined!^"; + failures++; + #endif; + + print "WillBeDefinedLater: "; + check_value(WillBeDefinedLater, 2); + print ".^"; + + print "WillBeDefinedLater_pre: "; + check_value(WillBeDefinedLater_pre, 3); + print ".^"; + + print "WillBeDefinedLater_post: "; + check_value(WillBeDefinedLater_post, 4); + print ".^"; + + print "RemainsDefined: "; + check_value(RemainsDefined, 5); + print ".^"; + + print "FutureSymbol: "; + check_value(FutureSymbol, 6); + print ".^"; + + print "Function returning FutureSymbol: "; + check_value(testfunc(), 6); + print ".^"; + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; diff --git a/inform6/Tests/Test Cases/undefdirectivetest.inf b/inform6/Tests/Test Cases/undefdirectivetest.inf new file mode 100755 index 000000000..f22fd1ab5 --- /dev/null +++ b/inform6/Tests/Test Cases/undefdirectivetest.inf @@ -0,0 +1,234 @@ +Constant Story "UndefDirectiveTest"; +Constant Headline "Not a game.^"; + +Release 1; + +! This is a compiler unit test for the Undef directive +! (remove the definition of a Constant). + +#ifdef TARGET_ZCODE; +Constant HDR_GAMERELEASE = $02; ! word +Constant HDR_GAMESERIAL = $12; ! six ASCII characters +#ifnot; +Global gg_mainwin; +Constant HDR_GLULXVERSION $04; ! long word +Constant ROM_GAMERELEASE $34; ! short word +Constant ROM_GAMESERIAL $36; ! six ASCII characters +#endif; ! TARGET_GLULX + +Global failures; + +[ Main; + #ifdef TARGET_GLULX; + @setiosys 2 0; + @push 201; @push 3; @push 0; @push 0; @push 0; + @glk $0023 5 gg_mainwin; + + @push gg_mainwin; + @glk $002F 1 0; + #endif; ! TARGET_GLULX + + Banner(); + new_line; + RunTest(); +]; + +[ Banner ix; + if (Story ~= 0) { + #ifdef TARGET_ZCODE; + #ifV5; style bold; #Endif; + print (string) Story; + #ifV5; style roman; #Endif; + #ifnot; ! TARGET_GLULX; + glk($0086, 3); ! set header style + print (string) Story; + glk($0086, 0); ! set normal style + #Endif; ! TARGET_ + } + if (Headline ~= 0) print ": ", (string) Headline; + #ifdef TARGET_ZCODE; + print "Release ", (HDR_GAMERELEASE-->0) & $03ff, " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) HDR_GAMESERIAL->ix; + #ifnot; ! TARGET_GLULX; + print "Release "; + @aloads ROM_GAMERELEASE 0 ix; + print ix; + print " / Serial number "; + for (ix=0 : ix<6 : ix++) print (char) ROM_GAMESERIAL->ix; + #Endif; ! TARGET_ + print " / Inform v"; inversion; + print ", compiler options "; + ix = false; + #ifdef STRICT_MODE; + print "S"; ix++; + #Endif; ! STRICT_MODE + #ifdef INFIX; + print "X"; ix++; + #ifnot; + #ifdef DEBUG; + print "D"; ix++; + #Endif; ! DEBUG + #Endif; ! INFIX + if (~~ix) print "(none)"; + new_line; + + #ifdef TARGET_GLULX; + @gestalt 1 0 ix; + print "Interpreter version ", ix / $10000, ".", (ix & $FF00) / $100, + ".", ix & $FF, " / "; + @gestalt 0 0 ix; + print "VM ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, " / "; + ix = HDR_GLULXVERSION-->0; + print "game file format ", ix / $10000, ".", (ix & $FF00) / $100, ".", ix & $FF, "^"; + #Endif; ! TARGET_GLULX +]; + +[ check_value val1 val2; + print val1; + if (val1 ~= val2) { + failures++; + print " (ERROR, should be ", val2, ")"; + } +]; + +[ testfunc; + ! This symbol isn't defined yet, but it will be. + return FutureSymbol; +]; + +Object sword; +Array testarray --> 4; + +! Here's a constant. +Constant UndefMe = 1; +! Undefine it. +Undef UndefMe; + +#ifndef UndefMe; +! UndefMe should be undefined now. +Constant UndefMe_post 1; +#endif; + +! Here's another constant. +Constant UndefMe2; +! Undefine it, with the optional hash sign. +#undef UndefMe2; +! Redefine it. +Constant UndefMe2 = 99; +! Undefine it again. +#undef UndefMe2; + +! It's legal to Undef a symbol which was never defined at all. +Undef NotDefinedAtAll; + +! If you Undef a symbol which will be defined later, it doesn't affect +! the later definition. +Undef WillBeDefinedLater; + + +#ifndef WillBeDefinedLater; +! WillBeDefinedLater is not yet defined. +Constant WillBeDefinedLater_pre 3; +#endif; + +Constant WillBeDefinedLater = 2; + +#ifdef WillBeDefinedLater; +! WillBeDefinedLater is defined now. +Constant WillBeDefinedLater_post 4; +#endif; + + +! Here's a constant. +Constant RemainsDefined = 5; + +#ifdef Zggrablfoo; +! This doesn't happen, because it's #if'd out. +Undef RemainsDefined; +#endif; + +#ifdef NotDefinedAtAll; +! This doesn't happen, because it's #if'd out. +Undef RemainsDefined; +#endif; + + +! "FutureSymbol" was forward-referenced from an earlier function. +! Undef'ing it has no effect, because it's not actually defined yet. +! (I think it makes sense for this to be legal.) +Undef FutureSymbol; + +! Okay, define FutureSymbol now. +Constant FutureSymbol = 6; + + +! The following lines should fail, producing errors of the form +! "Expected symbol name but found ..." +! Uncomment them to test this. +! +! Undef; +! Undef Undef; +! Undef 1234; +! Undef "Hello"; +! Undef (1); + +! The following lines should fail, producing errors of the form +! "Cannot Undef a symbol which is not a defined constant: ..." +! Uncomment them to test this. +! +! Undef Banner; +! Undef sword; +! Undef failures; +! Undef testarray; + + +[ RunTest val; + val = testarray; ! silence compiler warning + val = testfunc; ! silence compiler warning + + print "UndefMe_post: "; + check_value(UndefMe_post, 1); + print ".^"; + + #ifdef UndefMe; + ! UndefMe should be undefined now. + print "ERROR: UndefMe is defined!^"; + failures++; + #endif; + + #ifdef UndefMe2; + ! UndefMe2 should be undefined now. + print "ERROR: UndefMe2 is defined!^"; + failures++; + #endif; + + print "WillBeDefinedLater: "; + check_value(WillBeDefinedLater, 2); + print ".^"; + + print "WillBeDefinedLater_pre: "; + check_value(WillBeDefinedLater_pre, 3); + print ".^"; + + print "WillBeDefinedLater_post: "; + check_value(WillBeDefinedLater_post, 4); + print ".^"; + + print "RemainsDefined: "; + check_value(RemainsDefined, 5); + print ".^"; + + print "FutureSymbol: "; + check_value(FutureSymbol, 6); + print ".^"; + + print "Function returning FutureSymbol: "; + check_value(testfunc(), 6); + print ".^"; + + new_line; + if (failures == 0) + print "All passed.^"; + else + print failures, " errors!^"; +]; diff --git a/inform6/Tests/Test Errors/Settings/max_abbrevs_test_100_ma96.txt b/inform6/Tests/Test Errors/_Settings/max_abbrevs_test_100_ma96.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_abbrevs_test_100_ma96.txt rename to inform6/Tests/Test Errors/_Settings/max_abbrevs_test_100_ma96.txt diff --git a/inform6/Tests/Test Errors/Settings/max_abbrevs_test_64_ma_63.txt b/inform6/Tests/Test Errors/_Settings/max_abbrevs_test_64_ma_63.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_abbrevs_test_64_ma_63.txt rename to inform6/Tests/Test Errors/_Settings/max_abbrevs_test_64_ma_63.txt diff --git a/inform6/Tests/Test Errors/Settings/max_abbrevs_test_96_ma_95.txt b/inform6/Tests/Test Errors/_Settings/max_abbrevs_test_96_ma_95.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_abbrevs_test_96_ma_95.txt rename to inform6/Tests/Test Errors/_Settings/max_abbrevs_test_96_ma_95.txt diff --git a/inform6/Tests/Test Errors/Settings/max_common_props_test_280_ips_283-G.txt b/inform6/Tests/Test Errors/_Settings/max_common_props_test_280_ips_283-G.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_common_props_test_280_ips_283-G.txt rename to inform6/Tests/Test Errors/_Settings/max_common_props_test_280_ips_283-G.txt diff --git a/inform6/Tests/Test Errors/_Settings/max_common_props_test_z3.txt b/inform6/Tests/Test Errors/_Settings/max_common_props_test_z3.txt new file mode 100644 index 000000000..bf4e95e79 --- /dev/null +++ b/inform6/Tests/Test Errors/_Settings/max_common_props_test_z3.txt @@ -0,0 +1 @@ +-v3 \ No newline at end of file diff --git a/inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_at64_mds_64-G.txt b/inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_at64_mds_64-G.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_at64_mds_64-G.txt rename to inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_at64_mds_64-G.txt diff --git a/inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_at95_ma_1.txt b/inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_at95_ma_1.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_at95_ma_1.txt rename to inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_at95_ma_1.txt diff --git a/inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_at95_mds_95.txt b/inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_at95_mds_95.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_at95_mds_95.txt rename to inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_at95_mds_95.txt diff --git a/inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_at99_mds_99-G.txt b/inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_at99_mds_99-G.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_at99_mds_99-G.txt rename to inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_at99_mds_99-G.txt diff --git a/inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_str64_mds_64-G.txt b/inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_str64_mds_64-G.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_dynamic_strings_test_str64_mds_64-G.txt rename to inform6/Tests/Test Errors/_Settings/max_dynamic_strings_test_str64_mds_64-G.txt diff --git a/inform6/Tests/Test Errors/Settings/max_switch_case_values_se_0.txt b/inform6/Tests/Test Errors/_Settings/max_switch_case_values_se_0.txt similarity index 100% rename from inform6/Tests/Test Errors/Settings/max_switch_case_values_se_0.txt rename to inform6/Tests/Test Errors/_Settings/max_switch_case_values_se_0.txt diff --git a/inform6/Tests/inform6.intest b/inform6/Tests/inform6.intest index 7e9daa595..ac21ad26b 100644 --- a/inform6/Tests/inform6.intest +++ b/inform6/Tests/inform6.intest @@ -33,7 +33,7 @@ set: $INTNAME = dumb-frotz set: $INTOPTIONS = -w 1000 endif - set: $SETTINGS = $PATH/Settings/$CASE.txt + set: $SETTINGS = $PATH/_Settings/$CASE.txt if exists: $SETTINGS set: $I6OPTIONS = `$[`$SETTINGS$] endif @@ -105,11 +105,20 @@ if exists: $IMD5 match text: $AMD5 $IMD5 or: 'compiled, but produced the wrong md5 checksum' + + pass: 'passed, no need to run because md5 correct' endif if: $EXECUTE 1 - step: $INT `$INTOPTIONS $STORYFILE >$A 2>&1 - or: 'compiled, but was unable to run $INTNAME (do you need to make interpreters?)' + + set: $SCRIPT = $PATH/_Scripts/$CASE.txt + if exists: $SCRIPT + step: $INT `$INTOPTIONS $STORYFILE <$SCRIPT >$A 2>&1 + or: 'compiled, but was unable to run $INTNAME (do you need to make interpreters?)' + else + step: $INT `$INTOPTIONS $STORYFILE >$A 2>&1 + or: 'compiled, but was unable to run $INTNAME (do you need to make interpreters?)' + endif exists: $I or: 'compiled, but no ideal transcript existed'