Commit Graph

10 Commits

Author SHA1 Message Date
Abtin Keshavarzian 9d95a19e52 [tests] use constexpr for constants in unit tests (#13145)
This commit refactors various unit tests to use `constexpr` for
defining constants instead of anonymous `enum` types.

Using `constexpr` is the modern and preferred approach in C++, as it
provides explicit types for constants and improves code clarity and
type safety.
2026-05-25 19:39:27 -07:00
Abtin Keshavarzian 48333ce530 [crypto] adding HMAC Key Derivation Function (HKDF) using SHA-256 (#4440)
This commit adds a new class `Crypto::HkdfSha256` which implements
HMAC-based Extract-and-Expand Key Derivation Function from RFC-5869
using SHA-256. It also adds a unit test for the new module.
2020-12-10 11:46:07 -08:00
Abtin Keshavarzian eaf2e7b9f7 [unit-test] add a common function to dump buffer content (#4367)
This commit updates `test_utils.hpp/cpp` to include a common helper
function `DumpBuffer` to print the content of a buffer (as hex and char string)
to screen. It also removes unused helper functions and use of STL header
files and types.
2019-12-11 09:16:48 -08:00
Jonathan Hui 9d585edc46 [types] move types into specific headers (#2946) 2018-08-08 11:19:41 -07:00
Jonathan Hui 69d98d4a53 [code-style] apply clang-format 2018-02-09 21:43:42 +00:00
Jonathan Hui fbfd76a990 Apply #include code style. (#1723) 2017-05-05 11:28:29 -07:00
Łukasz Duda ede95a1220 6LoWPAN: Introduce test vectors and improvements (#947)
* 6LoWPAN: Add compression flag to the Context structure.

* IP: Add option to initialize IPv6 header.

* 6LoWPAN: Bugfixes for compression and decompression procedure.

* 6LoWPAN: Add test vectors for 6LoWPAN compression and decompression.
2016-11-09 01:00:08 -08:00
Jonathan Hui 44350178ad Change copyright to The OpenThread Authors. (#583)
- Add a top-level file named AUTHORS which identifies the copyright
holders of the project.
2016-09-13 15:57:11 -07:00
Jonathan Hui 6d958ba51b Fix compiler warnings in unit tests. (#488) 2016-08-29 11:41:59 -07:00
turon 31bc49de32 test: Lowpan module unit tests (#151)
* Added initial unit tests for 6LoWPAN layer decompression. Extended unit test framework with helper functions for setting up ASCI hex test vectors.

* Added missing license headers. Cleanly broke C++ into .hpp vs .h.

* Added multicast test vectors to 6lo decompression unit tests.

* Make pretty.

* Added Lowpan::Compress unit test.

* Allow extended initializer lists for unit test build.

* Split out sTestVectorLowpan into pure C99 file as it uses struct { .mField = initializers; } which may upset stricter C++ compilers such as clang++.

* Fix make distcheck - add stubs to test_lowpan for unhandled driver callbacks.

* Resolve most comments besides otDump suggestion.
2016-06-21 13:05:31 -07:00