tests: logging: log_api: Fix in mock backend
Mock backend is using 32 bytes for hexdump data and
only hexdumps with less data shall be compared against
expected one. Wrong operator was used and comparing
was performed only when hexdump size exceeded 32 bytes.
Spotted by Coverity CID 236015.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
diff --git a/tests/subsys/logging/log_api/src/mock_backend.c b/tests/subsys/logging/log_api/src/mock_backend.c
index 55b1c4a..e7e4862 100644
--- a/tests/subsys/logging/log_api/src/mock_backend.c
+++ b/tests/subsys/logging/log_api/src/mock_backend.c
@@ -370,7 +370,7 @@
zassert_equal(0, strcmp(metadata, exp->str), NULL);
zassert_equal(length, exp->data_len, NULL);
- if (length > sizeof(exp->data)) {
+ if (length <= sizeof(exp->data)) {
zassert_equal(memcmp(data, exp->data, length), 0, NULL);
}
}