Merge branch 'fix-set-intersection' of github.com:/ynadji/zeek

* 'fix-set-intersection' of github.com:/ynadji/zeek:
  Curse you tabs!
  Remove unused tbl
  Add reverse order intersection check
  Fix C++ Intersection code
  Change set intersection test to be correct
This commit is contained in:
Christian Kreibich 2021-11-04 14:28:35 -07:00
commit f080a814c4
5 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,7 @@
4.2.0-dev.292 | 2021-11-04 14:28:35 -0700
* Fix C++ set intersection code (Yacin Nadji, Corelight)
4.2.0-dev.286 | 2021-11-03 09:36:41 -0700 4.2.0-dev.286 | 2021-11-03 09:36:41 -0700
* GH-693: use pcap_dump_open_append where supported (Tim Wojtulewicz, Corelight) * GH-693: use pcap_dump_open_append where supported (Tim Wojtulewicz, Corelight)

View file

@ -1 +1 @@
4.2.0-dev.286 4.2.0-dev.292

View file

@ -1715,8 +1715,7 @@ TableValPtr TableVal::Intersection(const TableVal& tv) const
t0 = tmp; t0 = tmp;
} }
const PDict<TableEntryVal>* tbl = AsTable(); for ( const auto& tble : *t1 )
for ( const auto& tble : *tbl )
{ {
auto k = tble.GetHashKey(); auto k = tble.GetHashKey();

View file

@ -44,7 +44,8 @@ remove element (PASS)
remove element (PASS) remove element (PASS)
!in operator (PASS) !in operator (PASS)
union (PASS) union (PASS)
intersection (FAIL) intersection (PASS)
intersection (PASS)
difference (PASS) difference (PASS)
difference (PASS) difference (PASS)
union/inter. (PASS) union/inter. (PASS)

View file

@ -148,9 +148,11 @@ function basic_functionality()
local a_or_b = a | b; local a_or_b = a | b;
local a_and_b = a & b; local a_and_b = a & b;
local b_and_a = b & a;
test_case( "union", a_or_b == a_plus_b ); test_case( "union", a_or_b == a_plus_b );
test_case( "intersection", a_and_b == a_plus_b ); test_case( "intersection", a_and_b == a_also_b );
test_case( "intersection", b_and_a == a_also_b );
test_case( "difference", a - b == a_sans_b ); test_case( "difference", a - b == a_sans_b );
test_case( "difference", b - a == b_sans_a ); test_case( "difference", b - a == b_sans_a );