-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'task/#24161-Implement_new_message_log_find_event_v2_in_…
…libelos' into 'integration' task/#24161-Implement_new_message_log_find_event_v2_in_libelos See merge request elektrobit/base-os/elos!131
- Loading branch information
Showing
21 changed files
with
854 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SPDX-License-Identifier: MIT | ||
find_package(safu 0.56.2 REQUIRED) | ||
find_package(cmocka_mocks 0.54.2 REQUIRED) | ||
|
||
create_unit_test( | ||
NAME | ||
test_libelos_elosFindEvents_utest | ||
SOURCES | ||
case_err_invalid_parameter.c | ||
case_exterr_verify_session.c | ||
case_exterr_new_object.c | ||
case_exterr_add_new_string.c | ||
case_exterr_add_new_timestamp.c | ||
case_exterr_comm_failed.c | ||
case_exterr_vector_from_json_arr.c | ||
case_success.c | ||
case_success_truncated.c | ||
elosFindEvents_utest.c | ||
LIBRARIES | ||
mock_elos_event_static | ||
mock_libelos_static | ||
cmocka_mocks::mock_jsonc | ||
safu::mock_safu | ||
) |
41 changes: 41 additions & 0 deletions
41
test/utest/libelos/elosFindEvents/case_err_invalid_parameter.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include "elosFindEvents_utest.h" | ||
|
||
int elosTestElosFindEventsErrInvalidParameterSetup(UNUSED void **state) { | ||
return 0; | ||
} | ||
|
||
int elosTestElosFindEventsErrInvalidParameterTeardown(UNUSED void **state) { | ||
return 0; | ||
} | ||
|
||
void elosTestElosFindEventsErrInvalidParameter(UNUSED void **state) { | ||
TEST("elosFindEvents"); | ||
SHOULD("%s", "return SAFU_RESULT_FAILED when any of the parameters is null"); | ||
|
||
elosSession_t session = {.connected = true}; | ||
const char filterRule[] = ".event.name 'sshd' STRCMP"; | ||
struct timespec newest = {.tv_sec = 0, .tv_nsec = 0}; | ||
struct timespec oldest = {.tv_sec = 0, .tv_nsec = 0}; | ||
elosEventVector_t *eventVector = NULL; | ||
safuResultE_t result = SAFU_RESULT_FAILED; | ||
|
||
PARAM("'session' is NULL"); | ||
result = elosFindEvents(NULL, filterRule, &newest, &oldest, &eventVector); | ||
assert_int_equal(result, SAFU_RESULT_FAILED); | ||
|
||
PARAM("'filterRule' is NULL"); | ||
result = elosFindEvents(&session, NULL, &newest, &oldest, &eventVector); | ||
assert_int_equal(result, SAFU_RESULT_FAILED); | ||
|
||
PARAM("'newest' is NULL"); | ||
result = elosFindEvents(&session, filterRule, NULL, &oldest, &eventVector); | ||
assert_int_equal(result, SAFU_RESULT_FAILED); | ||
PARAM("'oldest' is NULL"); | ||
result = elosFindEvents(&session, filterRule, &newest, NULL, &eventVector); | ||
assert_int_equal(result, SAFU_RESULT_FAILED); | ||
PARAM("'eventVector' is NULL"); | ||
result = elosFindEvents(&session, filterRule, &newest, &oldest, NULL); | ||
assert_int_equal(result, SAFU_RESULT_FAILED); | ||
} |
Oops, something went wrong.