extend btest to include a coercion overflow

This commit is contained in:
Vern Paxson 2021-09-04 16:07:15 -07:00
parent 7f3ab84e5c
commit 9d896d114b
3 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
runtime error in /Users/vern/warehouse/zeek-ZAM-final2/testing/btest/.tmp/language.vector-coerce-expr2/vector-coerce-expr2.zeek, line 49: overflow promoting from unsigned to signed arithmetic value
[5.5, 5.2, -3.9, 20.0]
[11, 5, , 107, , , 1046]
[-2, -4, , -7, , -18, -999]

View file

@ -1,4 +1,6 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in int and /Users/vern/warehouse/zeek-ZAM-final2/testing/btest/.tmp/language.vector-coerce-expr2/vector-coerce-expr2.zeek, line 49: overflow promoting from unsigned/double to signed arithmetic value (int and 18446744073709551615)
[5.5, 5.2, -3.9, 20.0] [5.5, 5.2, -3.9, 20.0]
[11, 5, , 107, , , 1046] [11, 5, , 107, , , 1046]
[-2, -4, , -7, , -18, -999] [-2, -4, , -7, , -18, -999]
[, -1, 11, 15]

View file

@ -39,3 +39,14 @@ event zeek_init()
v3 = -v1; v3 = -v1;
print v3; print v3;
} }
event zeek_init()
{
local b = vector(2, -4, 6, 8);
local c = vector(0xffffffffffffffff, 3, 5, 7);
local d: vector of int;
d = b + c;
print d;
}