1
0
mirror of synced 2024-11-15 03:27:40 +01:00
Commit Graph

36 Commits

Author SHA1 Message Date
WerWolv
df1d302bcb sys: Added time and source to logger output 2022-02-02 17:19:50 +01:00
WerWolv
c2bcbfb1e0 pattern: std::from_chars is not widely supported and doesn't support u128... 2022-02-02 17:12:19 +01:00
WerWolv
ce59226909 sys: Reformat all 2022-02-01 22:09:44 +01:00
WerWolv
1991afb87b
sys: Get rid of SharedData struct and cleanup code structure (#411)
* sys: Initial refactoring of the SharedData class

* sys/pattern: More refactoring, make every provider have its own patterns

* sys: Finished up refactoring. No more SharedData!

* sys: Fixed compile on Unix

* tests: Fixed unit tests

* sys: Moved view and lang files

* pattern: Added assignment operator support to for loops

* tests: Fixed compile issue
2022-02-01 18:09:40 +01:00
WerWolv
61fc479c79 pattern: Fixed many code inconsistencies and bugs 2022-01-31 14:37:12 +01:00
WerWolv
362413dbe7 tests: Run tests only once 2022-01-29 21:49:15 +01:00
WerWolv
3f5b258629 ux: Auto focus goto and find text box. Execute function on enter 2022-01-29 21:49:15 +01:00
WerWolv
ceaf9ac24b tests: Re-enabled net tests 2022-01-29 17:33:07 +01:00
WerWolv
e6f1dd0490 tests: Improved testing environment, added helpers tests 2022-01-29 17:14:15 +01:00
WerWolv
7b1a146976 pattern: Fixed crashes, removed reference to evaluator in every pattern 2022-01-29 12:40:49 +01:00
WerWolv
0e08b0226b sys: Added clang-format file, formatted entire project 2022-01-24 20:53:17 +01:00
WerWolv
914b26caec tests: Fixed missing type renaming 2022-01-23 12:26:15 +01:00
WerWolv
48aacc0c2e sys: (s8, s16, s32, s64, s128) -> (i8, i16, i32, i64, i128) 2022-01-22 22:37:52 +01:00
WerWolv
63edfb8d52 tests: Fixed compiling of bitfield test 2022-01-12 09:17:14 +01:00
WerWolv
b496fedea8 tests: Fixed pointer test 2022-01-10 22:15:05 +01:00
WerWolv
ad223a4e5c sys: Refactor pattern language api functions a bit 2021-12-20 20:40:28 +01:00
WerWolv
a05d09ffea build: Build unit tests again when needed 2021-12-14 21:27:02 +01:00
WerWolv
3e736b36b6 api: Refactored providers to allow for loading interfaces and config views 2021-12-12 00:41:44 +01:00
RADICS Áron
467e9d1463
Tests for the CRC and hash algorithms (#335)
* Update TEST_ASSERT to do nothing if condition is true

The TEST_ASSERT should not return if the condition is true, because:
- it prevents the usage of multiple TEST_ASSERT in a single test case,
- that behavior differs from how the assert in the standard library
works, and thus may give unexpected results.

Make the TEST_ASSERT to print an error message (with an formatted
optional user part) when it fails to make debugging easier.

* Fix some bugs in TestProvider, add unit tests

Use pointer-to-vector in TestProvider so writes can be tested, too.

* Add test EncodeDecode16, fix some encode16 bugs

The function mbedtls_mpi_write_string needs a bit longer buffer than the
resulting string actually will be.

Known bug: mbedtls_mpi_read_binary ingores initial null bytes

* Add test EncodeDecode64, fix some bugs

The functions mbedtls_base64_encode and mbedtls_base64_decode needs a
bit longer buffer than the resulting string actually will be.

* Remove check for empty data from TestProvider

It can be valid to get the hash of empty string.

* Add tests for CRC calculation

Two type of thests:
- compare the result of the CRC calculation to a known to be good
results,
- generate random data as message, calculate of it's CRC and append that
to the message, the CRC of this new data should be 0.

* Add test for hash algorithms

* Add includes in tests

* Remove the use of C++20 ranges

It seems that Apple Clang does not support range-based constrained
algorithms at this time.

* Replace encode16 implementation

To encode the zero bytes at the begining of the input vector, too.
2021-11-26 22:14:44 +01:00
WerWolv
d9a77d396c tests: Fixed endian test being marked as failing 2021-10-20 11:23:06 +02:00
WerWolv
442f164159 tests: Added endian changer tests 2021-10-20 11:17:55 +02:00
WerWolv
d6f9ec3f8f tests: Improved pattern unit tests 2021-10-20 11:06:24 +02:00
WerWolv
1b6035d6c6 tests: Added properly working custom unit tests 2021-10-14 21:19:31 +02:00
WerWolv
9b316795fc tests: Refactor to add support for other types of tests 2021-10-12 21:32:33 +02:00
WerWolv
a93049056a tests: Run all tests multiple times
Tests are all done pretty quickly anyways and this should detect use-after-frees and co
2021-10-03 23:10:08 +02:00
WerWolv
51a98736e8 tests: Fixed compile errors 2021-10-03 12:32:58 +02:00
WerWolv
62656f4c51 tests: Added pointer test 2021-09-25 23:31:37 +02:00
WerWolv
c051f5d3e7
patterns: Rewrite evaluation engine (#306)
* patterns: Rewrite most of the evaluator to mainly use polymorphism instead of just RTTI

* patterns: Fixed a couple of AST memory leaks

* patterns: Parse string operations correctly

* patterns: Various fixes and cleanup

* patterns: Implement primitive function definitions

Function parameters now need to provide their type in the definition

* patterns: Added function variable definition and assignment

* patterns: Added remaining function statements

* patterns: Added unsized and while-sized arrays

* patterns: Added multi variable declarations to functions

* patterns: Added std::format built-in function

* patterns: Allow passing custom types to functions

* patterns: Added attributes and new "format" attribute

* patterns: Use libfmt for std::print instead of custom version

* patterns: Remove unnecessary string compare function

* pattern: Fix preprocessor directives

* patterns: Fix unit tests

* patterns: Added cast expression

* patterns: Handle endianess in function parameters

* patterns: Added casting to different endian

* patterns: Added 'str' type for functions
2021-09-21 21:29:18 +02:00
WerWolv
26a0352851 tests: Fixed unit test compiling 2021-09-21 02:48:41 +02:00
WerWolv
22a904baf4 tests: Added RValue, Namespaces and extra semicolon test 2021-09-13 10:49:24 +02:00
WerWolv
7fbb540674 tests: Added operator test 2021-09-12 21:54:18 +02:00
WerWolv
bed5361879 tests: Added bitfield test 2021-09-12 20:29:05 +02:00
WerWolv
3d15a108af tests: Added more tests 2021-09-11 23:13:49 +02:00
WerWolv
aac6385dc6 build: Fixed unit tests on linux. Fuck cmake... 2021-09-11 18:09:15 +02:00
WerWolv
8396e40fa0 tests: Added initial test structure 2021-09-11 14:41:18 +02:00
WerWolv
71b06f4b20 build: Only copy yara crypto wrapper if it changed 2021-09-11 14:40:53 +02:00