diff --git a/testing/btest/Baseline/core.fake_dns/out b/testing/btest/Baseline/core.fake_dns/out index fe6c13aeb8..bc04a9ec86 100644 --- a/testing/btest/Baseline/core.fake_dns/out +++ b/testing/btest/Baseline/core.fake_dns/out @@ -1,8 +1,8 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. { 51f3:f001:5b82:e802:c401:6750:7b95:89bb, -4cc7:de52:d869:b2f9:f215:19b8:c828:3bdd, -7a5f:b783:9808:380e:b1a2:ce20:b58e:2a4a +7a5f:b783:9808:380e:b1a2:ce20:b58e:2a4a, +4cc7:de52:d869:b2f9:f215:19b8:c828:3bdd } lookup_hostname_txt, fake_text_lookup_result_bro.wp.dg.cx lookup_hostname, { diff --git a/testing/btest/Baseline/core.scalar-vector/out b/testing/btest/Baseline/core.scalar-vector/out index 49b3872f4c..4f5fc89efa 100644 --- a/testing/btest/Baseline/core.scalar-vector/out +++ b/testing/btest/Baseline/core.scalar-vector/out @@ -1,11 +1,11 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -warning in <...>/scalar-vector.zeek, line 7: mixing vector and scalar operands is deprecated (string) (vector) -warning in <...>/scalar-vector.zeek, line 8: mixing vector and scalar operands is deprecated (vector) (string) -warning in <...>/scalar-vector.zeek, line 9: mixing vector and scalar operands is deprecated (string) (vector) -warning in <...>/scalar-vector.zeek, line 13: mixing vector and scalar operands is deprecated (count) (vector) -warning in <...>/scalar-vector.zeek, line 14: mixing vector and scalar operands is deprecated (count) (vector) -warning in <...>/scalar-vector.zeek, line 15: mixing vector and scalar operands is deprecated (vector) (count) -warning in <...>/scalar-vector.zeek, line 16: mixing vector and scalar operands is deprecated (vector) (count) +warning in <...>/scalar-vector.zeek, line 11: mixing vector and scalar operands is deprecated (string) (vector) +warning in <...>/scalar-vector.zeek, line 12: mixing vector and scalar operands is deprecated (vector) (string) +warning in <...>/scalar-vector.zeek, line 13: mixing vector and scalar operands is deprecated (string) (vector) +warning in <...>/scalar-vector.zeek, line 17: mixing vector and scalar operands is deprecated (count) (vector) +warning in <...>/scalar-vector.zeek, line 18: mixing vector and scalar operands is deprecated (count) (vector) +warning in <...>/scalar-vector.zeek, line 19: mixing vector and scalar operands is deprecated (vector) (count) +warning in <...>/scalar-vector.zeek, line 20: mixing vector and scalar operands is deprecated (vector) (count) [F, T, F] [aa, ba, ca] [aa, ab, ac] diff --git a/testing/btest/Baseline/language.cross-product-init/output b/testing/btest/Baseline/language.cross-product-init/output index 3705de05a1..c4cff483cc 100644 --- a/testing/btest/Baseline/language.cross-product-init/output +++ b/testing/btest/Baseline/language.cross-product-init/output @@ -1,7 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. { [bar, 1.2.0.0/19] , -[foo, 1.2.0.0/19] , [foo, 5.6.0.0/21] , +[foo, 1.2.0.0/19] , [bar, 5.6.0.0/21] } diff --git a/testing/btest/Baseline/language.mismatched-container-ctor-types/.stderr b/testing/btest/Baseline/language.mismatched-container-ctor-types/.stderr index 807ddb4f5a..8c193d4b3c 100644 --- a/testing/btest/Baseline/language.mismatched-container-ctor-types/.stderr +++ b/testing/btest/Baseline/language.mismatched-container-ctor-types/.stderr @@ -1,9 +1,9 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -error in <...>/mismatched-container-ctor-types.zeek, line 6: unexpected use of vector constructor in 'table' initialization (vector()) -error in <...>/mismatched-container-ctor-types.zeek, line 7: unexpected use of table constructor in 'vector' initialization (table()) -error in <...>/mismatched-container-ctor-types.zeek, line 8: unexpected use of set constructor in 'vector' initialization (set()) -error in <...>/mismatched-container-ctor-types.zeek, line 9: unexpected use of record constructor in 'vector' initialization ([]) -error in <...>/mismatched-container-ctor-types.zeek, line 10: unexpected use of record constructor in 'vector' initialization (R()) +error in <...>/mismatched-container-ctor-types.zeek, line 6: type clash in assignment (t = vector()) +error in <...>/mismatched-container-ctor-types.zeek, line 7: type clash in assignment (v0 = table()) +error in <...>/mismatched-container-ctor-types.zeek, line 8: type clash in assignment (v1 = set()) +error in <...>/mismatched-container-ctor-types.zeek, line 9: type clash in assignment (v2 = []) +error in <...>/mismatched-container-ctor-types.zeek, line 10: type clash in assignment (v3 = R()) error in <...>/mismatched-container-ctor-types.zeek, line 12: type clash in assignment (lt = vector()) error in <...>/mismatched-container-ctor-types.zeek, line 13: type clash in assignment (lv0 = table()) error in <...>/mismatched-container-ctor-types.zeek, line 14: type clash in assignment (lv1 = set()) diff --git a/testing/btest/Baseline/language.record-bad-ctor/out b/testing/btest/Baseline/language.record-bad-ctor/out index 40931641f1..cbb840cdcc 100644 --- a/testing/btest/Baseline/language.record-bad-ctor/out +++ b/testing/btest/Baseline/language.record-bad-ctor/out @@ -1,3 +1,4 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. error in <...>/record-bad-ctor.zeek, line 6: no type given (asdfasdf) -error in <...>/record-bad-ctor.zeek, line 7: non-optional field "ports" missing in initialization ([ports=]) +expression error in <...>/record-bad-ctor.zeek, line 11: value used but not set (asdfasdf2) +error in <...>/record-bad-ctor.zeek, line 11: initialization failed (blah2) diff --git a/testing/btest/Baseline/language.record-type-checking/out b/testing/btest/Baseline/language.record-type-checking/out index 713a1a0a01..f625ea05fa 100644 --- a/testing/btest/Baseline/language.record-type-checking/out +++ b/testing/btest/Baseline/language.record-type-checking/out @@ -1,11 +1,8 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. error in port and <...>/record-type-checking.zeek, line 9: arithmetic mixed with non-arithmetic (port and 0) -error in <...>/record-type-checking.zeek, line 9: bad record initializer ([$a=]) error in port and <...>/record-type-checking.zeek, line 12: arithmetic mixed with non-arithmetic (port and 1) -error in <...>/record-type-checking.zeek, line 12: bad record initializer ((coerce [$a=] to error)) error in port and <...>/record-type-checking.zeek, line 18: arithmetic mixed with non-arithmetic (port and 2) error in <...>/record-type-checking.zeek, line 22 and count: type clash for field "a" ((coerce [$a=3] to MyRec) and count) -error in <...>/record-type-checking.zeek, line 22: bad record initializer ((coerce [$a=3] to error)) error in port and <...>/record-type-checking.zeek, line 27: arithmetic mixed with non-arithmetic (port and 1000) error in port and <...>/record-type-checking.zeek, line 33: arithmetic mixed with non-arithmetic (port and 1001) error in port and <...>/record-type-checking.zeek, line 40: arithmetic mixed with non-arithmetic (port and 1002) diff --git a/testing/btest/Baseline/language.redef-same-prefixtable-idx/.stderr b/testing/btest/Baseline/language.redef-same-prefixtable-idx/.stderr new file mode 100644 index 0000000000..ebf136334a --- /dev/null +++ b/testing/btest/Baseline/language.redef-same-prefixtable-idx/.stderr @@ -0,0 +1,3 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +warning in /Users/vern/warehouse/zeek/master/testing/btest/.tmp/language.redef-same-prefixtable-idx/redef-same-prefixtable-idx.zeek, line 7: initialization not preceded by =/+=/-= is deprecated (3.0.0.0/8 = 1.0.0.0/8) +warning in /Users/vern/warehouse/zeek/master/testing/btest/.tmp/language.redef-same-prefixtable-idx/redef-same-prefixtable-idx.zeek, line 8: initialization not preceded by =/+=/-= is deprecated (3.0.0.0/8 = 2.0.0.0/8) diff --git a/testing/btest/Baseline/language.set-type-checking/out b/testing/btest/Baseline/language.set-type-checking/out index 3bd6cc0dc1..d930791048 100644 --- a/testing/btest/Baseline/language.set-type-checking/out +++ b/testing/btest/Baseline/language.set-type-checking/out @@ -8,8 +8,10 @@ error in <...>/set-type-checking.zeek, line 10: inconsistent type in set constru error in port and <...>/set-type-checking.zeek, line 16: arithmetic mixed with non-arithmetic (port and 2) error in <...>/set-type-checking.zeek, line 16 and port: type mismatch (2 and port) error in <...>/set-type-checking.zeek, line 16: inconsistent type in set constructor (set(2)) -error in port: arithmetic mixed with non-arithmetic (port and 3) -error in <...>/set-type-checking.zeek, line 20: initialization type mismatch in set (set(3) and 3) +error in port and <...>/set-type-checking.zeek, line 20: arithmetic mixed with non-arithmetic (port and 3) +error in <...>/set-type-checking.zeek, line 20 and port: type mismatch (3 and port) +error in <...>/set-type-checking.zeek, line 20: inconsistent type in set constructor (set(3)) +error in <...>/set-type-checking.zeek, line 20: type clash in assignment (gea = set(3)) error in port and <...>/set-type-checking.zeek, line 25: arithmetic mixed with non-arithmetic (port and 1000) error in <...>/set-type-checking.zeek, line 25 and port: type mismatch (1000 and port) error in <...>/set-type-checking.zeek, line 25: inconsistent type in set constructor (set(1000)) diff --git a/testing/btest/Baseline/language.table-aggr-init-type-check/output b/testing/btest/Baseline/language.table-aggr-init-type-check/output index 0fb4c3a300..6fbe2173f8 100644 --- a/testing/btest/Baseline/language.table-aggr-init-type-check/output +++ b/testing/btest/Baseline/language.table-aggr-init-type-check/output @@ -1,3 +1,5 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -error in <...>/table-aggr-init-type-check.zeek, line 21: type mismatch in table value initialization: assigning 'types' to table with values of type 'record' (three = 1, 2) -error in <...>/table-aggr-init-type-check.zeek, line 25: type mismatch in table value initialization: incompatible record types (four = [$b=No.]) +error in <...>/table-aggr-init-type-check.zeek, lines 4-7 and <...>/table-aggr-init-type-check.zeek, line 21: type clash (MyRec and 1, 2) +error in <...>/table-aggr-init-type-check.zeek, line 21: inconsistent types in table constructor (table(three = 1, 2)) +error in <...>/table-aggr-init-type-check.zeek, lines 4-7 and <...>/table-aggr-init-type-check.zeek, line 25: incompatible record types (MyRec and [$b=No.]) +error in <...>/table-aggr-init-type-check.zeek, line 25: inconsistent types in table constructor (table(four = [$b=No.])) diff --git a/testing/btest/Baseline/language.table-list-assign-type-check/output b/testing/btest/Baseline/language.table-list-assign-type-check/output index 4e61c25b09..b33c42c8ce 100644 --- a/testing/btest/Baseline/language.table-list-assign-type-check/output +++ b/testing/btest/Baseline/language.table-list-assign-type-check/output @@ -1,8 +1,11 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. error in count and <...>/table-list-assign-type-check.zeek, line 16: arithmetic mixed with non-arithmetic (count and Internal Web Server) error in <...>/table-list-assign-type-check.zeek, lines 15-20: inconsistent types in table constructor (table(www, 80 = Internal Web Server, dns1, 53 = Internal DNS 1, dns2, 53 = Internal DNS 2, dhcp-for-wifi, 443 = DHCP Management interface for WiFi)) +error in <...>/table-list-assign-type-check.zeek, lines 15-20: type clash in assignment (service_table_bad_yield = table(www, 80 = Internal Web Server, dns1, 53 = Internal DNS 1, dns2, 53 = Internal DNS 2, dhcp-for-wifi, 443 = DHCP Management interface for WiFi)) error in count and <...>/table-list-assign-type-check.zeek, line 24: arithmetic mixed with non-arithmetic (count and 80) error in <...>/table-list-assign-type-check.zeek, lines 23-28: inconsistent types in table constructor (table(www, 80 = Internal Web Server, dns1, 53 = Internal DNS 1, dns2, 53 = Internal DNS 2, dhcp-for-wifi, 443 = DHCP Management interface for WiFi)) +error in <...>/table-list-assign-type-check.zeek, lines 23-28: type clash in assignment (service_table_bad_index = table(www, 80 = Internal Web Server, dns1, 53 = Internal DNS 1, dns2, 53 = Internal DNS 2, dhcp-for-wifi, 443 = DHCP Management interface for WiFi)) error in string and <...>/table-list-assign-type-check.zeek, line 31: arithmetic mixed with non-arithmetic (string and 1) error in <...>/table-list-assign-type-check.zeek, line 31 and string: type mismatch (1 and string) error in <...>/table-list-assign-type-check.zeek, line 31: inconsistent type in set constructor (set(1, 2, 3)) +error in <...>/table-list-assign-type-check.zeek, line 31: type clash in assignment (test_set_bad = set(1, 2, 3)) diff --git a/testing/btest/Baseline/language.table-type-checking/out b/testing/btest/Baseline/language.table-type-checking/out index 82a60de830..72bfcb7b5b 100644 --- a/testing/btest/Baseline/language.table-type-checking/out +++ b/testing/btest/Baseline/language.table-type-checking/out @@ -4,8 +4,7 @@ error in <...>/table-type-checking.zeek, line 7: inconsistent types in table con error in port and <...>/table-type-checking.zeek, line 10: type clash (port and one) error in <...>/table-type-checking.zeek, line 10: inconsistent types in table constructor (table(one = 1)) error in <...>/table-type-checking.zeek, line 17: type clash in assignment (gda = gda2) -error in <...>/table-type-checking.zeek, line 21 and <...>/table-type-checking.zeek, line 4: index type doesn't match table (three and list of port) -expression error in <...>/table-type-checking.zeek, line 21: type clash in table assignment (three = 3) +error in <...>/table-type-checking.zeek, line 21: type clash in assignment (gea = table(three = 3)) error in port and <...>/table-type-checking.zeek, line 26: type clash (port and thousand) error in <...>/table-type-checking.zeek, line 26: inconsistent types in table constructor (table(thousand = 1000)) error in port and <...>/table-type-checking.zeek, line 32: type clash (port and thousand-one) diff --git a/testing/btest/Baseline/language.vector-type-checking/out b/testing/btest/Baseline/language.vector-type-checking/out index 588779a80e..71eb85a096 100644 --- a/testing/btest/Baseline/language.vector-type-checking/out +++ b/testing/btest/Baseline/language.vector-type-checking/out @@ -6,8 +6,7 @@ error in count and <...>/vector-type-checking.zeek, line 10: arithmetic mixed wi error in <...>/vector-type-checking.zeek, line 10 and count: type mismatch (one and count) error in <...>/vector-type-checking.zeek, line 10: inconsistent types in vector constructor (vector(one)) error in <...>/vector-type-checking.zeek, line 17: type clash in assignment (gda = gda2) -error in count and <...>/vector-type-checking.zeek, line 21: arithmetic mixed with non-arithmetic (count and three) -error in <...>/vector-type-checking.zeek, line 21: initialization type mismatch at index 0 (vector(three) and three) +error in <...>/vector-type-checking.zeek, line 21: type clash in assignment (gea = vector(three)) error in count and <...>/vector-type-checking.zeek, line 26: arithmetic mixed with non-arithmetic (count and thousand) error in <...>/vector-type-checking.zeek, line 26 and count: type mismatch (thousand and count) error in <...>/vector-type-checking.zeek, line 26: inconsistent types in vector constructor (vector(thousand)) diff --git a/testing/btest/core/fake_dns.zeek b/testing/btest/core/fake_dns.zeek index 46dd50c5ee..dd8a88ae40 100644 --- a/testing/btest/core/fake_dns.zeek +++ b/testing/btest/core/fake_dns.zeek @@ -1,4 +1,4 @@ -# @TEST-EXEC: ZEEK_DNS_FAKE=1 zeek -b %INPUT >out +# @TEST-EXEC: ZEEK_DNS_FAKE=1 zeek -D -b %INPUT >out # @TEST-EXEC: btest-diff out redef exit_only_after_terminate = T; diff --git a/testing/btest/core/scalar-vector.zeek b/testing/btest/core/scalar-vector.zeek index 3382066816..004ef5eec1 100644 --- a/testing/btest/core/scalar-vector.zeek +++ b/testing/btest/core/scalar-vector.zeek @@ -1,3 +1,7 @@ +# Skip this test when using ZAM, as it will generate a hard error in addition +# to the warning. +# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1" +# # @TEST-EXEC: zeek -b %INPUT > out 2>&1 # @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath" btest-diff out diff --git a/testing/btest/language/cross-product-init.zeek b/testing/btest/language/cross-product-init.zeek index f5027cfd3c..ec029e9f0c 100644 --- a/testing/btest/language/cross-product-init.zeek +++ b/testing/btest/language/cross-product-init.zeek @@ -1,4 +1,4 @@ -# @TEST-EXEC: zeek -b %INPUT >output 2>&1 +# @TEST-EXEC: zeek -b -D %INPUT >output 2>&1 # @TEST-EXEC: btest-diff output global my_subs = { 1.2.3.4/19, 5.6.7.8/21 }; diff --git a/testing/btest/language/record-bad-ctor.zeek b/testing/btest/language/record-bad-ctor.zeek index 40bafa47de..49de10ebb7 100644 --- a/testing/btest/language/record-bad-ctor.zeek +++ b/testing/btest/language/record-bad-ctor.zeek @@ -5,4 +5,9 @@ global asdfasdf; const blah = [$ports=asdfasdf]; -print blah; +const x = blah; + +global asdfasdf2: port; +const blah2 = [$ports=asdfasdf2]; + +print blah, blah2; diff --git a/testing/btest/language/redef-same-prefixtable-idx.zeek b/testing/btest/language/redef-same-prefixtable-idx.zeek index c96af48f3e..74d0feb82c 100644 --- a/testing/btest/language/redef-same-prefixtable-idx.zeek +++ b/testing/btest/language/redef-same-prefixtable-idx.zeek @@ -1,4 +1,5 @@ # @TEST-EXEC: zeek -b %INPUT >out +# @TEST-EXEC: btest-diff .stderr # @TEST-EXEC: btest-diff out const my_table: table[subnet] of subnet &redef; diff --git a/testing/btest/language/table-init-attrs.zeek b/testing/btest/language/table-init-attrs.zeek index 5f1e742479..5f1ec64309 100644 --- a/testing/btest/language/table-init-attrs.zeek +++ b/testing/btest/language/table-init-attrs.zeek @@ -11,7 +11,7 @@ redef my_set_ctor_init += { "test3", }; -redef my_set_ctor_init += set("test4"); +redef my_set_ctor_init += { "test4" }; const my_table_ctor_init: table[count] of string = table([1] = "test1") &redef &default="nope"; @@ -29,7 +29,7 @@ redef my_set_init += { "test3", }; -redef my_set_init += set("test4"); +redef my_set_init += { "test4" }; const my_table_init: table[count] of string = { [1] = "test1" } &redef &default="nope"; @@ -38,7 +38,7 @@ redef my_table_init += { [3] = "test3", }; -redef my_table_init += table([4] = "test4"); +redef my_table_init += { [4] = "test4" }; # For tables that yield tables, we can apply attributes to the both other and # inner tables... diff --git a/testing/btest/language/type-check-operator-in.zeek b/testing/btest/language/type-check-operator-in.zeek index b0f0430eb6..c7121b3725 100644 --- a/testing/btest/language/type-check-operator-in.zeek +++ b/testing/btest/language/type-check-operator-in.zeek @@ -15,26 +15,26 @@ local string_records: set[string, MyRec] = set(); local record_strings: set[MyRec, string] = set(); # These are all valid. -["asdf"] in strings; -["hi", 0] in string_counts; -myrec in records; -[myrec] in records; -MyRec() in records; -[$a = 2] in records; -[MyRec()] in records; -[[$a = 2]] in records; -["hi", myrec] in string_records; +print ["asdf"] in strings; +print ["hi", 0] in string_counts; +print myrec in records; +print [myrec] in records; +print MyRec() in records; +print [$a = 2] in records; +print [MyRec()] in records; +print [[$a = 2]] in records; +print ["hi", myrec] in string_records; # All below should fail type-checking. -myrec in "asdf"; -myrec in string_records; -myrec in record_strings; +print myrec in "asdf"; +print myrec in string_records; +print myrec in record_strings; # Patterns do not apply transparently to collections of strings, so fail # to type-check too: -/foo/ in strings; +print /foo/ in strings; # Complex index types need to match, too. (For tests with matching types, # see set.zeek / table.zeek.) @@ -43,5 +43,5 @@ local table_set: set[table[string] of string] = set(); local stringvec_set: set[vector of string] = set(); local string_count_map: table[string] of count = table(); -string_count_map in table_set; -vector(1, 2, 3) in stringvec_set; +print string_count_map in table_set; +print vector(1, 2, 3) in stringvec_set; diff --git a/testing/btest/scripts/base/frameworks/software/version-parsing.zeek b/testing/btest/scripts/base/frameworks/software/version-parsing.zeek index 5730348c3d..852ae980eb 100644 --- a/testing/btest/scripts/base/frameworks/software/version-parsing.zeek +++ b/testing/btest/scripts/base/frameworks/software/version-parsing.zeek @@ -35,7 +35,7 @@ global matched_software: table[string] of Software::Description = { ["curl/7.15.1 (i486-pc-linux-gnu) libcurl/7.15.1 OpenSSL/0.9.8a zlib/1.2.3 libidn/0.5.18"] = [$name="curl", $version=[$major=7,$minor=15,$minor2=1,$addl="i486-pc-linux-gnu"], $unparsed_version=""], ["Apache"] = - [$name="Apache", $unparsed_version=""], + [$name="Apache", $version=[], $unparsed_version=""], ["Zope/(Zope 2.7.8-final, python 2.3.5, darwin) ZServer/1.1 Plone/Unknown"] = [$name="Zope/(Zope", $version=[$major=2,$minor=7,$minor2=8,$addl="final"], $unparsed_version=""], ["The Bat! (v2.00.9) Personal"] =