Commit graph

390 commits

Author SHA1 Message Date
Vern Paxson
77f6a658e6 additional test suite updates for "-u" usage issues 2021-12-14 15:35:24 -08:00
Vern Paxson
deb518588a fix typo in btest filename 2021-12-14 11:33:21 -08:00
Tim Wojtulewicz
b966a3876f GH-1741: Print error if calling a non-hook with hook keyword 2021-12-09 14:35:40 -07:00
Vern Paxson
417f9ffe98 fix btest comment to more accurately describe the test 2021-11-29 13:17:57 -08:00
Vern Paxson
8f8c594220 btests for erroneous script conditionals 2021-11-24 15:19:44 -08:00
Vern Paxson
06bbd167cd fixes for constructing and assigning records with fields that are empty vectors 2021-11-24 11:16:33 -08:00
Yacin Nadji
cdb52e6460 Curse you tabs! 2021-11-03 15:46:17 -04:00
Yacin Nadji
d426e285eb Add reverse order intersection check 2021-11-03 14:52:45 -04:00
Yacin Nadji
75e584cb73 Change set intersection test to be correct 2021-11-03 14:21:02 -04:00
Christian Kreibich
a8ab977b0e Expand table/set tests to cover new index types 2021-10-01 14:03:08 -07:00
Christian Kreibich
b7603faf3d Whitespace tweak in a btest, no other change 2021-10-01 14:03:08 -07:00
Vern Paxson
509428a9dc removing -uu functionality and associated script analysis now no longer needed 2021-09-22 11:17:28 -07:00
Christian Kreibich
cfcf1f83cc Add btests for new functionality
- Expand language.set to cover sets of sets
- Expand language.table to cover tables indexed with tables
- Add language.table-nested-set-ordering to capture the reproducer from GHI-1753
2021-09-20 17:51:43 -07:00
Tim Wojtulewicz
8414d13030 Merge remote-tracking branch 'origin/topic/vern/vector-hole-loops'
* origin/topic/vern/vector-hole-loops:
  fix for looping over vectors with holes per https://github.com/zeek/zeek/issues/1763
  btest for https://github.com/zeek/zeek/issues/1763
2021-09-08 12:04:56 -07:00
Vern Paxson
acaaa0d36a fix race condition in btest output ordering 2021-09-08 10:23:39 -07:00
Vern Paxson
74fbfa3aae whoops, forgot to canonicalize filenames in new btest 2021-09-08 10:23:39 -07:00
Vern Paxson
9d896d114b extend btest to include a coercion overflow 2021-09-08 10:23:39 -07:00
Vern Paxson
7f3ab84e5c fixed a typo in a comment 2021-09-08 10:23:39 -07:00
Vern Paxson
9757d37332 test case for vector coercions, including holes 2021-09-08 10:23:39 -07:00
Vern Paxson
87fce26a0b btest for https://github.com/zeek/zeek/issues/1763 2021-09-07 10:21:50 -07:00
Johanna Amann
13cfa4c938 Fix handling of timers when cloning TableVals
When cloning TableVals, a new timer was created for the wrong object
(the existing TableVal, not the clone). This lead to the already
existing timer being no longer accessible. Which, in turn, leads to an
abandoned timer reading into no longer allocated data when the original
TableVal is deleted.

Fixes GH-1687
2021-07-21 12:52:22 +01:00
Robin Sommer
8d19c43429 Remove tests for deprecated operators. 2021-07-14 11:23:13 +02:00
Robin Sommer
7f2769bd17 Add tests for operations on vectors of string. 2021-07-14 11:21:42 +02:00
Tim Wojtulewicz
67b45bc502 Merge remote-tracking branch 'origin/topic/vern/ZAM-prep'
* origin/topic/vern/ZAM-prep: (45 commits)
  whoops overlooked the need to canonicalize filenames
  another set of tweaks per review comments
  addressed a number of code review comments
  baseline updates for merge
  support "any" coercions for "-O gen-C++"
  better descriptions for named record constructors
  test suite baseline updates for "-a opt" optimize-AST alternative
  test suite baseline updates for "-a xform" alternative / AST transformation
  error propagation fix for AST reduction
  updates to "-a inline" test suite alternative baseline
  updates for the main test suite baseline
  updates to test suite tests for compatibility with upcoming ZAM functionality
  "-O compile-all" option to specify compilation of inlined functions
  compile inlined functions if they're also used indirectly
  provide ZAM-generated code with low-level access to record fields
  fix for cloning records with fields of type "any"
  direct access for ZAM to VectorVal internal vector
  ZVal constructors, accessors & methods in support of ZAM
  switch ZVal representation of types from Type objects to TypeVal's
  revised error-reporting interface for ZVal's, to accommodate ZAM inner loop
  ...
2021-06-28 11:03:13 -07:00
Christian Kreibich
0b55c55140 Remove unnecessary -B arguments from Zeek invocations in testsuite
Now that Zeek no longer silently accepts -B when not compiled in debug
mode, these tests were failing.
2021-06-24 17:05:32 -07:00
Vern Paxson
2acaacee2d whoops overlooked the need to canonicalize filenames 2021-06-09 15:29:39 -07:00
Vern Paxson
7904701ffb another set of tweaks per review comments 2021-06-09 09:41:41 -07:00
Vern Paxson
4172b9e147 Merge remote-tracking branch 'origin/master' into topic/vern/ZAM-prep 2021-06-03 08:13:48 -07:00
Vern Paxson
b6e9776a11 updates to test suite tests for compatibility with upcoming ZAM functionality 2021-06-01 09:25:30 -07:00
Jon Siwek
77f1ede661 GH-839: Fix use of &optional sub-records within table/set indices 2021-05-26 13:28:13 -07:00
Jon Siwek
48ee0f31a1 GH-1244: Change modp_dtoa2() to use scientific notation for small values
This fixes problems where printing floating point numbers less than
10^-6 output as "0.0".  Such numbers now use using scientific notation
and preserve the value's actual floating point representation.
2021-05-17 17:44:23 -07:00
Vern Paxson
f9c1f57f9c notes for tests that are problematic when using compile-to-C++ 2021-05-05 16:55:04 -07:00
Jon Siwek
13f3cb377f GH-1534: Fix excessive coredump for duplicate enum definitions
An adequate error message was previously reported for duplicate enum
definitions, this just now prevents trying to access it as a constant in
subsequent parsing and further generating a coredump.
2021-04-29 15:20:09 -07:00
Jon Siwek
486f187b15 GH-1483: Improve error for mismatched container initialization types
For example, trying to assign a vector, table, set, or record
constructor expression to a global variable of a different type now
provides a more explanatory error message than the previous
"Val::CONVERTER" fatal-error and coredump.
2021-04-20 19:14:13 -07:00
Jon Siwek
e8247c2472 Merge remote-tracking branch 'origin/topic/vern/vector-holes'
* origin/topic/vern/vector-holes:
  Remove NEWS entry regarding changed vector-holes functionality
  Fix potential segfaults in VectorVal Insert/Remove methods
  Fix copy() to work with a vector that has trailing holes
  update test suite for vector holes now being supported for numeric types
  add vector tests for creating holes, "in" operator, "?" operator, copying vectors with holes
  restore support for vectors with holes remove vestigial comment
  fix using ++/-- to vectors that contain holes
2021-04-20 14:43:01 -07:00
Jon Siwek
fd5cdbbe50 Fix potential segfaults in VectorVal Insert/Remove methods
The existence/hole check for managed types was needed to prevent
accessing a nil-optional value.
2021-04-19 19:29:37 -07:00
Jon Siwek
819fc1aac0 Fix copy() to work with a vector that has trailing holes
Previously, the trailing holes would not be preserved in the copy.
2021-04-19 19:23:04 -07:00
Jon Siwek
846cc53780 Merge remote-tracking branch 'origin/topic/jsiwek/fix-table-vector-index'
* origin/topic/jsiwek/fix-table-vector-index:
  Fix indexing of set/table types with a vector
2021-04-15 17:59:31 -07:00
Jon Siwek
df9b57118d Merge remote-tracking branch 'origin/topic/jsiwek/gh-1503-improve-expire-func-type-check'
* origin/topic/jsiwek/gh-1503-improve-expire-func-type-check:
  Extend language.expire-func-type-check btest
  GH-1503: Improve &expire_func compatibility type-checking
2021-04-15 17:42:33 -07:00
Jon Siwek
05b992b865 Extend language.expire-func-type-check btest
Now covers more forms of both valid and invalid &expire_funcs
2021-04-15 16:13:35 -07:00
Jon Siwek
735ac0b4fa Fix indexing of set/table types with a vector
Previous behavor:

  internal error: bad index type in CompositeHash::ComputeSingletonHash
  Aborted (core dumped)
2021-04-14 21:58:14 -07:00
Vern Paxson
e96b29d4d8 add vector tests for creating holes, "in" operator, "?" operator, copying vectors with holes 2021-04-14 18:19:13 -07:00
Jon Siwek
01f6264c87 GH-1503: Improve &expire_func compatibility type-checking
Previously, incompatible &expire_funcs could mistakenly be used, such as
when using that attribute on the unspecified table()/set()
initializations/assignments, resulting in invalid function calls that
eventually crash Zeek.
2021-04-12 16:27:50 -07:00
Jon Siwek
952d8de8fd Add btest for unterminated pattern parsing error behavior
And clarified the error message that it's more about finding an
unterminated pattern than knowing for sure there's remaining pattern
text spanning multiple lines.
2021-04-09 11:15:06 -07:00
Jon Siwek
312547ab0a GH-1497: Support CRLF line-endings in Zeek scripts and signature files 2021-04-08 20:32:30 -07:00
Jon Siwek
3e9ac00f21 Separate stdout from stderr in btest baselines
Redirecting both to the same file can show platform-specific differences
(e.g. Alpine), likely due to different buffering defaults.
2021-03-30 16:23:23 -07:00
Tim Wojtulewicz
f45df63cd0 Merge remote-tracking branch 'origin/topic/vern/zval'
* origin/topic/vern/zval: (42 commits)
  whitespace tweaks
  resolved some TODO comments
  remove unnecessary casts, and change necessary ones to use static_cast<>
  explain cmp_func default
  change functions for ZVal type management to static members
  fix some unsigned/signed integer warnings
  address lint concern about uninitialized variable
  Remove use of obsolete forward-declaration macros
  fix #include's that lack zeek/ prefixes
  explicitly populate holes created in vectors
  fixes for now-incorrect assumption that GetField always returns an existing ValPtr
  memory management for assignment to vector elements
  memory management for assignment to record fields
  destructor cleanup from ZAM_vector/ZAM_record
  fix #include's that lack zeek/ prefixes
  overlooked another way in which vector holes can be created
  initialize vector holes to the correct corresponding type
  explicitly populate holes created in vectors
  fix other instances of GetField().get() assuming long-lived ValPtr's
  fix for now-incorrect assumption that GetField always returns an existing ValPtr
  ...
2021-03-23 20:44:19 -07:00
Jon Siwek
f46d3dec8f Merge remote-tracking branch 'origin/topic/vern/cpp-new-func'
- Removed a couple of dead statements during merge

* origin/topic/vern/cpp-new-func:
  option for deterministic descriptions of sets & tables
  determinism for concurrent Zeek test suite invocations; split out deprecations
  disambiguate descriptions of enums; include attributes when describing records
  more liberal view of attribute equality; allow suppressing attr type-checking
  support for operations on sets that return new values
  low-level addition of enum values
  sundry accessors/cast-ers; RE_Matcher's track their construction values
  convenience functions for comparing IP addresses
2021-03-23 19:27:11 -07:00
Vern Paxson
a808e166a4 determinism for concurrent Zeek test suite invocations; split out deprecations 2021-03-18 16:17:25 -07:00
Vern Paxson
e21c0f1115 correcting some simple typos 2021-03-18 08:19:46 -07:00