Merge remote-tracking branch 'origin/topic/jsiwek/gh-710-expire-func-type-check'

* origin/topic/jsiwek/gh-710-expire-func-type-check:
  GH-710: Check that &expire_func is a function and not hook/event
This commit is contained in:
Tim Wojtulewicz 2020-08-24 14:30:43 -07:00
commit b687730a01
5 changed files with 31 additions and 1 deletions

View file

@ -0,0 +1,3 @@
error in /home/jon/pro/zeek/zeek/testing/btest/.tmp/language.expire-func-type-check/expire-func-type-check.zeek, line 12: &expire_func attribute is not a function (&expire_func=myev)
error in /home/jon/pro/zeek/zeek/testing/btest/.tmp/language.expire-func-type-check/expire-func-type-check.zeek, line 13: &expire_func attribute is not a function (&expire_func=myhk)
error in /home/jon/pro/zeek/zeek/testing/btest/.tmp/language.expire-func-type-check/expire-func-type-check.zeek, line 14: &expire_func attribute is not a function (&expire_func=foo)

View file

@ -0,0 +1,14 @@
# @TEST-EXEC-FAIL: zeek -b %INPUT >output 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
event myev(t: table[string] of count)
{ }
hook myhk(t: table[string] of count)
{ }
global foo = 3;
global t: table[string] of count &expire_func=myev;
global tt: table[string] of count &expire_func=myhk;
global ttt: table[string] of count &expire_func=foo;