Completely remove all traces of the COUNTER type.

Relates to GH-1095
This commit is contained in:
Johanna Amann 2020-07-30 12:10:54 -07:00
parent 01fa5611ef
commit 417a6eb1e9
28 changed files with 79 additions and 140 deletions

View file

@ -1,5 +1,4 @@
type inference (PASS)
counter alias (PASS)
hexadecimal (PASS)
inequality operator (PASS)
relational operator (PASS)
@ -19,9 +18,6 @@ bitwise and (PASS)
bitwise and (PASS)
bitwise or (PASS)
bitwise or (PASS)
bitwise or (PASS)
bitwise xor (PASS)
bitwise xor (PASS)
bitwise xor (PASS)
bitwise complement (PASS)
bitwise complement (PASS)

View file

@ -1,18 +1,18 @@
1st stuff
hrw, 0, zeek/cluster/node/proxy-1/
hrw (custom pool), 0, zeek/cluster/node/proxy-1/
hrw (custom pool), 0, zeek/cluster/node/proxy-2/
hrw, 1, zeek/cluster/node/proxy-1/
hrw (custom pool), 1, zeek/cluster/node/proxy-1/
hrw (custom pool), 1, zeek/cluster/node/proxy-2/
hrw, 2, zeek/cluster/node/proxy-1/
hrw (custom pool), 2, zeek/cluster/node/proxy-1/
hrw, 3, zeek/cluster/node/proxy-1/
hrw (custom pool), 3, zeek/cluster/node/proxy-1/
hrw (custom pool), 3, zeek/cluster/node/proxy-2/
hrw, 13, zeek/cluster/node/proxy-1/
hrw (custom pool), 13, zeek/cluster/node/proxy-2/
hrw, 37, zeek/cluster/node/proxy-1/
hrw (custom pool), 37, zeek/cluster/node/proxy-2/
hrw, 42, zeek/cluster/node/proxy-1/
hrw (custom pool), 42, zeek/cluster/node/proxy-2/
hrw (custom pool), 42, zeek/cluster/node/proxy-1/
hrw, 101, zeek/cluster/node/proxy-1/
hrw (custom pool), 101, zeek/cluster/node/proxy-2/
rr, zeek/cluster/node/proxy-1/
@ -32,19 +32,19 @@ rr (custom pool), zeek/cluster/node/proxy-1/
rr, zeek/cluster/node/proxy-1/
rr (custom pool), zeek/cluster/node/proxy-2/
hrw, 0, zeek/cluster/node/proxy-1/
hrw (custom pool), 0, zeek/cluster/node/proxy-1/
hrw (custom pool), 0, zeek/cluster/node/proxy-2/
hrw, 1, zeek/cluster/node/proxy-1/
hrw (custom pool), 1, zeek/cluster/node/proxy-1/
hrw (custom pool), 1, zeek/cluster/node/proxy-2/
hrw, 2, zeek/cluster/node/proxy-1/
hrw (custom pool), 2, zeek/cluster/node/proxy-1/
hrw, 3, zeek/cluster/node/proxy-1/
hrw (custom pool), 3, zeek/cluster/node/proxy-1/
hrw (custom pool), 3, zeek/cluster/node/proxy-2/
hrw, 13, zeek/cluster/node/proxy-1/
hrw (custom pool), 13, zeek/cluster/node/proxy-2/
hrw, 37, zeek/cluster/node/proxy-1/
hrw (custom pool), 37, zeek/cluster/node/proxy-2/
hrw, 42, zeek/cluster/node/proxy-1/
hrw (custom pool), 42, zeek/cluster/node/proxy-2/
hrw (custom pool), 42, zeek/cluster/node/proxy-1/
hrw, 101, zeek/cluster/node/proxy-1/
hrw (custom pool), 101, zeek/cluster/node/proxy-2/
2nd stuff

View file

@ -1,11 +1,11 @@
1st stuff
hrw, 0, zeek/cluster/node/proxy-1/
hrw, 1, zeek/cluster/node/proxy-1/
hrw, 0, zeek/cluster/node/proxy-2/
hrw, 1, zeek/cluster/node/proxy-2/
hrw, 2, zeek/cluster/node/proxy-1/
hrw, 3, zeek/cluster/node/proxy-1/
hrw, 3, zeek/cluster/node/proxy-2/
hrw, 13, zeek/cluster/node/proxy-2/
hrw, 37, zeek/cluster/node/proxy-2/
hrw, 42, zeek/cluster/node/proxy-2/
hrw, 42, zeek/cluster/node/proxy-1/
hrw, 101, zeek/cluster/node/proxy-2/
rr, zeek/cluster/node/proxy-1/
rr, zeek/cluster/node/proxy-2/
@ -15,13 +15,13 @@ rr, zeek/cluster/node/proxy-1/
rr, zeek/cluster/node/proxy-2/
rr, zeek/cluster/node/proxy-1/
rr, zeek/cluster/node/proxy-2/
hrw, 0, zeek/cluster/node/proxy-1/
hrw, 1, zeek/cluster/node/proxy-1/
hrw, 0, zeek/cluster/node/proxy-2/
hrw, 1, zeek/cluster/node/proxy-2/
hrw, 2, zeek/cluster/node/proxy-1/
hrw, 3, zeek/cluster/node/proxy-1/
hrw, 3, zeek/cluster/node/proxy-2/
hrw, 13, zeek/cluster/node/proxy-2/
hrw, 37, zeek/cluster/node/proxy-2/
hrw, 42, zeek/cluster/node/proxy-2/
hrw, 42, zeek/cluster/node/proxy-1/
hrw, 101, zeek/cluster/node/proxy-2/
2nd stuff
hrw, 0, zeek/cluster/node/proxy-2/

View file

@ -1,7 +1,5 @@
got distributed event hrw, 0
got distributed event hrw, 1
got distributed event hrw, 2
got distributed event hrw, 3
got distributed event hrw, 42
got distributed event rr, 0
got distributed event rr, 2
got distributed event rr, 13

View file

@ -1,6 +1,8 @@
got distributed event hrw, 0
got distributed event hrw, 1
got distributed event hrw, 3
got distributed event hrw, 13
got distributed event hrw, 37
got distributed event hrw, 42
got distributed event hrw, 101
got distributed event rr, 1
got distributed event rr, 3

View file

@ -8,18 +8,18 @@ T
F
[id=0, user_data=alice]
[id=3, user_data=dave]
[id=3, user_data=dave]
[id=0, user_data=alice]
[id=0, user_data=alice]
[id=4, user_data=eve]
[id=4, user_data=eve]
[id=4, user_data=eve]
[id=0, user_data=alice]
[id=3, user_data=dave]
[id=1, user_data=bob]
[id=0, user_data=alice]
[id=1, user_data=bob]
T
[id=4, user_data=eve]
[id=3, user_data=dave]
[id=3, user_data=dave]
[id=3, user_data=dave]
[id=4, user_data=eve]
[id=4, user_data=eve]
[id=4, user_data=eve]
[id=4, user_data=eve]
@ -30,11 +30,11 @@ T
T
[id=0, user_data=alice]
[id=3, user_data=dave]
[id=3, user_data=dave]
[id=0, user_data=alice]
[id=0, user_data=alice]
[id=4, user_data=eve]
[id=4, user_data=eve]
[id=4, user_data=eve]
[id=0, user_data=alice]
[id=3, user_data=dave]
[id=1, user_data=bob]
[id=0, user_data=alice]
[id=1, user_data=bob]

View file

@ -15,16 +15,12 @@ event zeek_init()
local c4: count = 255;
local c5: count = 18446744073709551615; # maximum allowed value
local c6: count = 0xffffffffffffffff; # maximum allowed value
local c7: counter = 5;
local c8 = 1;
local c7 = 1;
# Type inference test
test_case( "type inference", type_name(c8) == "count" );
test_case( "type inference", type_name(c7) == "count" );
# Counter alias test
test_case( "counter alias", c2 == c7 );
# Test various constant representations
@ -49,13 +45,10 @@ event zeek_init()
test_case( "assignment operator", c2 == 6 );
test_case( "bitwise and", c2 & 0x4 == 0x4 );
test_case( "bitwise and", c4 & 0x4 == 0x4 );
test_case( "bitwise and", c8 & 0x4 == 0x0 );
test_case( "bitwise and", c7 & 0x4 == 0x0 );
test_case( "bitwise or", c2 | 0x4 == c2 );
test_case( "bitwise or", c4 | 0x4 == c4 );
test_case( "bitwise or", c8 | 0x4 == c7 );
test_case( "bitwise xor", c7 ^ 0x4 == c8 );
test_case( "bitwise xor", c4 ^ 0x4 == 251 );
test_case( "bitwise xor", c8 ^ 0x4 == c7 );
test_case( "bitwise complement", ~c6 == 0 );
test_case( "bitwise complement", ~~c4 == c4 );

View file

@ -179,7 +179,6 @@ void Plugin::RenderVal(const threading::Value* val, ODesc &d) const
break;
case TYPE_COUNT:
case TYPE_COUNTER:
d.Add(val->val.uint_val);
break;

View file

@ -107,7 +107,6 @@ threading::Value* Foo::EntryToVal(zeek::TypeTag type, zeek::TypeTag subtype)
break;
case zeek::TYPE_COUNT:
case zeek::TYPE_COUNTER:
val->val.uint_val = random();
break;