mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
Merge remote-tracking branch 'origin/master' into topic/vladg/mysql
This commit is contained in:
commit
e86fc160db
14 changed files with 129 additions and 10 deletions
11
testing/btest/Baseline/language.vector-in-operator/out
Normal file
11
testing/btest/Baseline/language.vector-in-operator/out
Normal file
|
@ -0,0 +1,11 @@
|
|||
[zero, one, , , , five, , seven]
|
||||
vec[0] = zero.exe
|
||||
vec[1] = one.exe
|
||||
vec[2] = <not set>
|
||||
vec[3] = <not set>
|
||||
vec[4] = <not set>
|
||||
vec[5] = five.exe
|
||||
vec[6] = <not set>
|
||||
vec[7] = seven.exe
|
||||
vec[8] = <not set>
|
||||
vec[9] = <not set>
|
38
testing/btest/Baseline/language.when-unitialized-rhs/out
Normal file
38
testing/btest/Baseline/language.when-unitialized-rhs/out
Normal file
|
@ -0,0 +1,38 @@
|
|||
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.when-unitialized-rhs/when-unitialized-rhs.bro, line 9: value used but not set (crashMe)
|
||||
error in /Users/jsiwek/Projects/bro/bro/testing/btest/.tmp/language.when-unitialized-rhs/when-unitialized-rhs.bro, line 14: value used but not set (x)
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
2nd when stmt executing, 999
|
||||
1st when stmt executing, not anymore you don't
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
17
testing/btest/language/vector-in-operator.bro
Normal file
17
testing/btest/language/vector-in-operator.bro
Normal file
|
@ -0,0 +1,17 @@
|
|||
# @TEST-EXEC: bro -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
local ten = "0123456789";
|
||||
local vec: vector of string = { "zero", "one" };
|
||||
local n = 0;
|
||||
vec[5] = "five";
|
||||
vec[7] = "seven";
|
||||
print vec;
|
||||
vec = vec + ".exe";
|
||||
|
||||
for ( c in ten )
|
||||
{
|
||||
local is_set: bool = (n in vec);
|
||||
print fmt("vec[%s] = %s", n, is_set ? vec[n] : "<not set>");
|
||||
++n;
|
||||
}
|
32
testing/btest/language/when-unitialized-rhs.bro
Normal file
32
testing/btest/language/when-unitialized-rhs.bro
Normal file
|
@ -0,0 +1,32 @@
|
|||
# @TEST-EXEC: bro -b -r $TRACES/wikipedia.trace %INPUT >out 2>&1
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
|
||||
|
||||
global crashMe: function(): string;
|
||||
global x: int;
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
when( local result = crashMe() )
|
||||
{
|
||||
print "1st when stmt executing", result;
|
||||
}
|
||||
|
||||
when( local other_result = x )
|
||||
{
|
||||
print "2nd when stmt executing", other_result;
|
||||
}
|
||||
}
|
||||
|
||||
global conn_count = 0;
|
||||
|
||||
event new_connection(c: connection)
|
||||
{
|
||||
++conn_count;
|
||||
print conn_count;
|
||||
|
||||
if ( conn_count == 10 )
|
||||
{
|
||||
x = 999;
|
||||
crashMe = function(): string { return "not anymore you don't"; };
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue