tweaks for "-O C++" of BTest's with conditional code

This commit is contained in:
Vern Paxson 2023-04-01 20:26:55 -07:00
parent 5718046b96
commit 2f9272f2d5
3 changed files with 1 additions and 10 deletions

View file

@ -9,11 +9,7 @@ event zeek_init()
{ {
local make_epoch_result = function(pass_name: string): function(ts: time): time local make_epoch_result = function(pass_name: string): function(ts: time): time
{ {
@if ( Version::at_least("4.1") )
return function [pass_name] (ts: time): time return function [pass_name] (ts: time): time
@else
return function (ts: time)
@endif
{ {
print pass_name; print pass_name;
return ts; return ts;
@ -35,11 +31,7 @@ event zeek_init()
{ {
local make_epoch_result = function(pass_name: string): function(ts: time): time local make_epoch_result = function(pass_name: string): function(ts: time): time
{ {
@if ( Version::at_least("4.1") )
return function [pass_name] (ts: time): time { return function [pass_name] (ts: time): time {
@else
return function (ts: time) {
@endif
print pass_name; print pass_name;
return ts; return ts;
}; };

View file

@ -9,10 +9,8 @@ event analyzer_violation(c: connection, atype: AllAnalyzers::Tag, aid: count, re
print "analyzer_violation", c$id, atype, aid, reason; print "analyzer_violation", c$id, atype, aid, reason;
} }
@if ( Version::at_least("5.1") )
event analyzer_violation_info(tag: AllAnalyzers::Tag, info: AnalyzerViolationInfo) event analyzer_violation_info(tag: AllAnalyzers::Tag, info: AnalyzerViolationInfo)
{ {
print "reason", info$reason; print "reason", info$reason;
print "data", fmt("%s", info$data); print "data", fmt("%s", info$data);
} }
@endif

View file

@ -1,4 +1,5 @@
# @TEST-DOC: Test support for pcap_file on Supervisor::ClusterEndpoint and Supervisor::NodeConfig # @TEST-DOC: Test support for pcap_file on Supervisor::ClusterEndpoint and Supervisor::NodeConfig
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# #
# @TEST-PORT: MANAGER_PORT # @TEST-PORT: MANAGER_PORT
# @TEST-PORT: WORKER_PORT # @TEST-PORT: WORKER_PORT