Fix code format of various reporter btests

This commit is contained in:
Jon Siwek 2020-02-14 22:02:33 -08:00
parent e896846752
commit 11d8b8c040
8 changed files with 64 additions and 60 deletions

View file

@ -1,4 +1,8 @@
3.2.0-dev.46 | 2020-02-14 22:02:50 -0800
* Fix code format of various reporter btests (Jon Siwek, Corelight)
3.2.0-dev.45 | 2020-02-14 21:14:49 -0800 3.2.0-dev.45 | 2020-02-14 21:14:49 -0800
* Update libkqueue for a linux bugfix (Jon Siwek, Corelight) * Update libkqueue for a linux bugfix (Jon Siwek, Corelight)

View file

@ -1 +1 @@
3.2.0-dev.45 3.2.0-dev.46

View file

@ -3,7 +3,7 @@
# than looping indefinitly, the error inside the handler should reported to stderr. # than looping indefinitly, the error inside the handler should reported to stderr.
# #
# TODO: interpreter exceptions currently may cause memory leaks, so disable leak checks # TODO: interpreter exceptions currently may cause memory leaks, so disable leak checks
# @TEST-EXEC: ASAN_OPTIONS="$ASAN_OPTIONS,detect_leaks=0" zeek %INPUT >output 2>&1 # @TEST-EXEC: ASAN_OPTIONS="$ASAN_OPTIONS,detect_leaks=0" zeek -b %INPUT >output 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
global a: table[count] of count; global a: table[count] of count;
@ -11,7 +11,7 @@ global a: table[count] of count;
global c = 0; global c = 0;
event reporter_error(t: time, msg: string, location: string) event reporter_error(t: time, msg: string, location: string)
{ {
c += 1; c += 1;
if ( c > 1 ) if ( c > 1 )
@ -22,9 +22,9 @@ event reporter_error(t: time, msg: string, location: string)
print "1st error printed on script level"; print "1st error printed on script level";
print a[2]; print a[2];
} }
} }
event zeek_init() event zeek_init()
{ {
print a[1]; print a[1];
} }

View file

@ -1,10 +1,10 @@
# The format string below should end up as a literal part of the reporter's # The format string below should end up as a literal part of the reporter's
# error message to stderr and shouldn't be replaced internally. # error message to stderr and shouldn't be replaced internally.
# #
# @TEST-EXEC-FAIL: zeek %INPUT >output 2>&1 # @TEST-EXEC-FAIL: zeek -b %INPUT >output 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
event zeek_init() event zeek_init()
{ {
event dont_interpret_this("%s"); event dont_interpret_this("%s");
} }

View file

@ -1,8 +1,8 @@
# #
# @TEST-EXEC-FAIL: zeek %INPUT >output 2>&1 # @TEST-EXEC-FAIL: zeek -b %INPUT >output 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
event zeek_init() event zeek_init()
{ {
print TESTFAILURE; print TESTFAILURE;
} }

View file

@ -1,13 +1,13 @@
# #
# @TEST-EXEC-FAIL: zeek %INPUT >output 2>&1 # @TEST-EXEC-FAIL: zeek -b %INPUT >output 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
global a: table[count] of count; global a: table[count] of count;
event zeek_init() event zeek_init()
{ {
print a[2]; print a[2];
} }
print a[1]; print a[1];

View file

@ -1,12 +1,12 @@
# #
# @TEST-EXEC-FAIL: zeek %INPUT >output 2>&1 # @TEST-EXEC-FAIL: zeek -b %INPUT >output 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
event foo(a: string) event foo(a: string)
{ {
} }
event zeek_init() event zeek_init()
{ {
event foo(42); event foo(42);
} }

View file

@ -4,23 +4,23 @@
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps" btest-diff logger-test.log # @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath | $SCRIPTS/diff-remove-timestamps" btest-diff logger-test.log
event zeek_init() event zeek_init()
{ {
Reporter::info("init test-info"); Reporter::info("init test-info");
Reporter::warning("init test-warning"); Reporter::warning("init test-warning");
Reporter::error("init test-error"); Reporter::error("init test-error");
} }
event zeek_done() event zeek_done()
{ {
Reporter::info("done test-info"); Reporter::info("done test-info");
Reporter::warning("done test-warning"); Reporter::warning("done test-warning");
Reporter::error("done test-error"); Reporter::error("done test-error");
} }
global first = 1; global first = 1;
event connection_established(c: connection) event connection_established(c: connection)
{ {
if ( ! first ) if ( ! first )
return; return;
@ -30,7 +30,7 @@ event connection_established(c: connection)
Reporter::warning("processing test-warning"); Reporter::warning("processing test-warning");
Reporter::error("processing test-error"); Reporter::error("processing test-error");
first = 0; first = 0;
} }
global f = open("logger-test.log"); global f = open("logger-test.log");