From 1236195e9b93aeb6bfa625956fa027f96003756d Mon Sep 17 00:00:00 2001 From: Lutz Helwing Date: Wed, 15 Jul 2015 14:14:19 +0200 Subject: DLT daemon improvement - dlt_init()-check DLT daemon improvement - parameter value range check Adapt unit tests to check for enum return values Changed C version to gnu99 and C++ version to gnu++0c Signed-off-by: Alexander Wenzel --- tests/gtest_dlt_common.cpp | 2535 ++++++++++++++++++++++---------------------- 1 file changed, 1267 insertions(+), 1268 deletions(-) (limited to 'tests/gtest_dlt_common.cpp') diff --git a/tests/gtest_dlt_common.cpp b/tests/gtest_dlt_common.cpp index adf492c..7ad8ee7 100644 --- a/tests/gtest_dlt_common.cpp +++ b/tests/gtest_dlt_common.cpp @@ -30,20 +30,18 @@ #include #include -extern "C" { +extern "C" +{ #include "dlt-daemon.h" #include "dlt-daemon_cfg.h" -#include "dlt_user.h" -#include "dlt_user_shared.h" -#include "dlt_user_shared_cfg.h" #include "dlt_user_cfg.h" -#include "dlt_client.h" #include "dlt_version.h" + int dlt_buffer_increase_size(DltBuffer *); int dlt_buffer_minimize_size(DltBuffer *); int dlt_buffer_reset(DltBuffer *); -int dlt_buffer_push(DltBuffer *,const unsigned char *,unsigned int); -int dlt_buffer_push3(DltBuffer *,const unsigned char *,unsigned int,const unsigned char *,unsigned int,const unsigned char *,unsigned int); +DltReturnValue dlt_buffer_push(DltBuffer *,const unsigned char *,unsigned int); +DltReturnValue dlt_buffer_push3(DltBuffer *,const unsigned char *,unsigned int,const unsigned char *,unsigned int,const unsigned char *,unsigned int); int dlt_buffer_get(DltBuffer *,unsigned char *, int,int); int dlt_buffer_pull(DltBuffer *,unsigned char *, int); int dlt_buffer_remove(DltBuffer *); @@ -60,58 +58,59 @@ TEST(t_dlt_buffer_init_dynamic, normal) DltBuffer init_dynamic; // Normal Use-Case for initializing a buffer - EXPECT_LE(0,dlt_buffer_init_dynamic(&init_dynamic, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&init_dynamic)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&init_dynamic, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK,dlt_buffer_free_dynamic(&init_dynamic)); // Min Values for a success init - EXPECT_LE(0, dlt_buffer_init_dynamic(&init_dynamic, 12,12,12)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&init_dynamic)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&init_dynamic, 12,12,12)); + EXPECT_LE(DLT_RETURN_OK,dlt_buffer_free_dynamic(&init_dynamic)); } TEST(t_dlt_buffer_init_dynamic, abnormal) { // DltBuffer buf; // Initialze buffer twice, expected -1 for second init -// EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_free_dynamic(&buf)); // Initialize buffer with max-value of uint32, expected 0 -// EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, UINT_MAX,UINT_MAX,UINT_MAX)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + // TODO: what should the maximum parameter values be? UINT_MAX is too large and leads to segfault +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, UINT_MAX,UINT_MAX,UINT_MAX)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_free_dynamic(&buf)); // Initialize buffer with min-value of uint32, expected 0 -// EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, 0,0,0)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, 0,0,0)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_free_dynamic(&buf)); // Initialize buffer min-value > max-value, expected -1 // EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_free_dynamic(&buf)); // Initialsize buffer step-value > max-value, expected -1 -// EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE * 2)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_GE(-1,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE * 2)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_init_dynamic, nullpointer) { DltBuffer buf; // NULL-Pointer, expect -1 - EXPECT_GE(-1, dlt_buffer_init_dynamic(NULL, 0, 0, 0)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(NULL, 0, 0, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(NULL, 0, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(NULL, 0, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(NULL, DLT_USER_RINGBUFFER_MIN_SIZE, 0, 0)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(NULL, DLT_USER_RINGBUFFER_MIN_SIZE, 0, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(NULL, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(NULL, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, 0, 0, 0)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, 0, 0, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, 0, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, 0, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, 0, 0)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, 0, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_GE(-1, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(NULL, 0, 0, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(NULL, 0, 0, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(NULL, 0, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(NULL, 0, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(NULL, DLT_USER_RINGBUFFER_MIN_SIZE, 0, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(NULL, DLT_USER_RINGBUFFER_MIN_SIZE, 0, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(NULL, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(NULL, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(&buf, 0, 0, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(&buf, 0, 0, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(&buf, 0, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(&buf, 0, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, 0, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, 0, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); } /* End Method: dlt_common::dlt_buffer_init_dynamic */ @@ -124,24 +123,24 @@ TEST(t_dlt_buffer_free_dynamic, normal) DltBuffer buf; // Normal Use-Case szenario - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Normal Use-Case szenario - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, 12,12,12)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, 12,12,12)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_free_dynamic, abnormal) { // DltBuffer buf; // Free uninizialised buffer, expected -1 -// EXPECT_GE(-1,dlt_buffer_free_dynamic(&buf)); +// EXPECT_GE(-1, dlt_buffer_free_dynamic(&buf)); - // Free buffer twice, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); -// EXPECT_GE(-1,dlt_buffer_free_dynamic(&buf)); + // Free buffer twice, expected -1 +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_GE(-1, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_free_dynamic, nullpointer) @@ -160,17 +159,17 @@ TEST(t_dlt_buffer_increase_size, normal) DltBuffer buf; // Normal Use-Case, expected 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_increase_size(&buf)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(0, dlt_buffer_increase_size(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Fill buffer to max-value, expected 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); for(int i = 0; i <= (DLT_USER_RINGBUFFER_MAX_SIZE / DLT_USER_RINGBUFFER_MIN_SIZE); i += DLT_USER_RINGBUFFER_STEP_SIZE) { - EXPECT_LE(0,dlt_buffer_increase_size(&buf)); + EXPECT_LE(0, dlt_buffer_increase_size(&buf)); } - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_increase_size, abnormal) { @@ -180,19 +179,19 @@ TEST(t_dlt_buffer_increase_size, abnormal) // EXPECT_GE(-1, dlt_buffer_increase_size(&buf)); // Fill buffer over max-value, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // EXPECT_GE(-1, dlt_buffer_increase_size(&buf)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // min-value > max-value, trying to increase buffer, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // EXPECT_GE(-1, dlt_buffer_increase_size(&buf)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // trying to increase buffer with 0 , expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); // EXPECT_GE(-1, dlt_buffer_increase_size(&buf)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_increase_size, nullpointer) { @@ -210,17 +209,17 @@ TEST(t_dlt_buffer_minimize_size, normal) DltBuffer buf; // Normal Use-Case, expected 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_minimize_size(&buf)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(0, dlt_buffer_minimize_size(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // minimize buffer to min-value, expected 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); for(int i = (DLT_USER_RINGBUFFER_MAX_SIZE / DLT_USER_RINGBUFFER_MIN_SIZE); i >= 0; i -= DLT_USER_RINGBUFFER_STEP_SIZE) { - EXPECT_LE(0,dlt_buffer_minimize_size(&buf)); + EXPECT_LE(0, dlt_buffer_minimize_size(&buf)); } - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_minimize_size, abnormal) { @@ -230,19 +229,19 @@ TEST(t_dlt_buffer_minimize_size, abnormal) // EXPECT_GE(-1, dlt_buffer_minimize_size(&buf)); // minimize buffer under min-value, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // EXPECT_GE(-1, dlt_buffer_minimize_size(&buf)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // min-value > max-value, trying to minimize buffer, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // EXPECT_GE(-1, dlt_buffer_minimize_size(&buf)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // trying to minimize buffer with 0 , expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, 0)); // EXPECT_GE(-1, dlt_buffer_minimize_size(&buf)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_minimize_size, nullpointer) { @@ -260,8 +259,8 @@ TEST(t_dlt_buffer_reset, normal) DltBuffer buf; // Normal Use-Case. expect 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_reset(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(0, dlt_buffer_reset(&buf)); } TEST(t_dlt_buffer_reset, abnormal) @@ -289,17 +288,17 @@ TEST(t_dlt_buffer_push, normal) unsigned int size = sizeof(test); // Normal Use-Case, expected 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0, dlt_buffer_push(&buf,(unsigned char *)&test,size)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&test,size)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Push till buffer is full, expected 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); for(unsigned int i=0; i<= (DLT_USER_RINGBUFFER_MIN_SIZE/size); i++) { - EXPECT_LE(0, dlt_buffer_push(&buf,(unsigned char *)&test,size)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&test,size)); } - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_push, abnormal) { @@ -312,33 +311,33 @@ TEST(t_dlt_buffer_push, abnormal) // set size == 0, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push(&buf,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(&buf,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // set size == 0 and char == 0 expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push(&buf,0,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(&buf,0,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Push till buffer is overfilled , expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // for(int i=0; i<= (DLT_USER_RINGBUFFER_MIN_SIZE/size) + size; i++) // { // if(i <= DLT_USER_RINGBUFFER_MIN_SIZE) -// EXPECT_LE(0, dlt_buffer_push(&buf,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&test,size)); // else -// EXPECT_GE(-1, dlt_buffer_push(&buf,(unsigned char *)&test,size)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(&buf,(unsigned char *)&test,size)); // } -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // All use-case, wich works with null pointer, has to discuss -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push(&buf,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push(&buf,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(&buf,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(&buf,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_push, nullpointer) @@ -347,10 +346,10 @@ TEST(t_dlt_buffer_push, nullpointer) int size = sizeof(test); // NULL-Pointer, expected -1 - EXPECT_GE(-1, dlt_buffer_push(NULL,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push(NULL,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push(NULL,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push(NULL,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(NULL,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(NULL,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(NULL,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push(NULL,(unsigned char *)&test,size)); } /* End Method: dlt_common::dlt_buffer_push*/ @@ -365,21 +364,21 @@ TEST(t_dlt_buffer_push3, normal) int size = sizeof(test); // Normal Use-Case, expected 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0, dlt_buffer_push3(&buf,(unsigned char *)&test,size,0,0,0,0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push3(&buf,(unsigned char *)&test,size,0,0,0,0)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Push till buffer is full, expected 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); for(int i=0; i<= (DLT_USER_RINGBUFFER_MIN_SIZE/size); i++) { - EXPECT_LE(0, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); } - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_push3, abnormal) { @@ -388,201 +387,201 @@ TEST(t_dlt_buffer_push3, abnormal) // int size = sizeof(test); // Use uninizialsied, expected -1 -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); // set size == 0, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0, (unsigned char *)&test,0, (unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0, (unsigned char *)&test,0, (unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // set size == 0 and char == 0 expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,0,0,0,0,0,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,0,0,0,0,0,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // works with null pointer, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,NULL,0,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,NULL,0,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Push till buffer is overfilled , expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // for(int i=0; i<= (DLT_USER_RINGBUFFER_MIN_SIZE/size) + size; i++) // { // if(i <= DLT_USER_RINGBUFFER_MIN_SIZE) -// EXPECT_LE(0, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); // else -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); // } -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // All use-case, wich works with null pointer, has to discuss -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,NULL,0,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,NULL,0,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,NULL,0,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,NULL,size,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,NULL,size,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,NULL,size,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,NULL,size,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,0,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,0,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,0,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,0,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,size,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,size,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,size,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,size,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,NULL,0,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,NULL,0,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,NULL,0,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,NULL,0,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,NULL,size,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,NULL,size,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,NULL,size,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,NULL,size,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,0,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,0,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,0,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,0,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,size,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,size,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,size,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,0,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,0,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,0,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,0,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,size,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,size,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,size,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,size,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,(unsigned char *)&test,0,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,(unsigned char *)&test,0,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,(unsigned char *)&test,size,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,0,(unsigned char *)&test,size,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,0,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,0,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,0,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,0,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,size,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,size,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,size,(unsigned char *)&test,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,size,(unsigned char *)&test,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,0,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,0,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,NULL,0)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_GE(-1, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,NULL,size)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,NULL,0,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,NULL,0,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,NULL,0,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,NULL,size,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,NULL,size,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,NULL,size,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,NULL,size,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,0,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,0,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,0,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,0,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,size,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,size,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,size,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,0,(unsigned char *)&test,size,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,NULL,0,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,NULL,0,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,NULL,0,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,NULL,0,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,NULL,size,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,NULL,size,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,NULL,size,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,NULL,size,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,0,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,0,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,0,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,0,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,size,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,size,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,size,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,NULL,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,0,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,0,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,0,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,0,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,size,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,size,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,size,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,NULL,size,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,(unsigned char *)&test,0,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,(unsigned char *)&test,0,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,(unsigned char *)&test,size,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,0,(unsigned char *)&test,size,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,0,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,0,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,0,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,0,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,size,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,size,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,size,(unsigned char *)&test,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,NULL,size,(unsigned char *)&test,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,0,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,0,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,NULL,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(&buf,(unsigned char *)&test,size,(unsigned char *)&test,size,NULL,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_push3, nullpointer) { @@ -590,70 +589,70 @@ TEST(t_dlt_buffer_push3, nullpointer) int size = sizeof(test); //Null Pointer, expected -1 - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,NULL,0,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,NULL,0,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,NULL,0,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,NULL,0,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,NULL,size,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,NULL,size,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,NULL,size,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,NULL,size,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,0,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,0,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,0,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,0,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,size,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,size,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,size,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,size,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,NULL,0,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,NULL,0,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,NULL,0,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,NULL,0,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,NULL,size,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,NULL,size,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,NULL,size,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,NULL,size,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,0,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,0,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,0,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,0,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,size,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,size,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,size,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,0,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,0,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,0,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,0,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,size,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,size,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,size,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,size,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,0,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,0,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,0,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,0,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,size,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,size,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,size,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,size,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,0,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,0,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,0,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,0,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,size,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,size,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,size,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,size,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,0,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,0,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,0,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,0,(unsigned char *)&test,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,size,NULL,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,size,NULL,size)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,0)); - EXPECT_GE(-1, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,NULL,0,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,NULL,0,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,NULL,0,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,NULL,0,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,NULL,size,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,NULL,size,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,NULL,size,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,NULL,size,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,0,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,0,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,0,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,0,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,size,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,size,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,size,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,0,(unsigned char *)&test,size,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,NULL,0,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,NULL,0,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,NULL,0,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,NULL,0,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,NULL,size,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,NULL,size,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,NULL,size,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,NULL,size,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,0,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,0,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,0,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,0,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,size,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,size,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,size,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,NULL,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,0,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,0,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,0,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,0,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,size,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,size,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,size,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,NULL,size,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,0,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,0,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,0,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,0,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,size,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,size,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,size,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,0,(unsigned char *)&test,size,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,0,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,0,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,0,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,0,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,size,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,size,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,size,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,NULL,size,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,0,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,0,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,0,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,0,(unsigned char *)&test,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,size,NULL,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,size,NULL,size)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_buffer_push3(NULL,(unsigned char *)&test,size,(unsigned char *)&test,size,(unsigned char *)&test,size)); } /* End Method: dlt_common::dlt_buffer_push3 */ @@ -669,15 +668,15 @@ TEST(t_dlt_buffer_pull, normal) int size = sizeof(DltUserHeader); // Normal Use-Case, empty pull, expected -1 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_pull(&buf, (unsigned char*)&header, size)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Normal Use-Case, expected > 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); EXPECT_LE(1, dlt_buffer_pull(&buf, (unsigned char*)&header, size)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_pull, abnormal) { @@ -688,15 +687,15 @@ TEST(t_dlt_buffer_pull, abnormal) // EXPECT_GE(-1, dlt_buffer_pull(&buf, (unsigned char*)&header, sizeof(DltUserHeader))); // data == 0 and max_size == 0, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); // EXPECT_GE(-1, dlt_buffer_pull(&buf, 0, 0)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // no push before pull, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // EXPECT_GE(-1, dlt_buffer_pull(&buf, 0, 0)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_pull, nullpointer) { @@ -708,12 +707,12 @@ TEST(t_dlt_buffer_pull, nullpointer) EXPECT_GE(-1, dlt_buffer_pull(NULL, NULL, sizeof(DltUserHeader))); EXPECT_GE(-1, dlt_buffer_pull(NULL, (unsigned char *)&header, 0)); EXPECT_GE(-1, dlt_buffer_pull(NULL, (unsigned char *)&header, sizeof(DltUserHeader))); - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_pull(&buf, NULL, 0)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_pull(&buf, NULL, sizeof(DltUserHeader))); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } /* End Method: dlt_common::dlt_buffer_pull */ @@ -727,15 +726,15 @@ TEST(t_dlt_buffer_remove, normal) int size = sizeof(DltUserHeader); // Normal Use-Case, empty pull, expected -1 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_remove(&buf)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Normal Use-Case, expected > 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,size)); - EXPECT_LE(0,dlt_buffer_remove(&buf)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,size)); + EXPECT_LE(0, dlt_buffer_remove(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_remove, abnormal) { @@ -747,14 +746,14 @@ TEST(t_dlt_buffer_remove, abnormal) // EXPECT_GE(-1, dlt_buffer_remove(&buf)); // no push before remove, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // EXPECT_GE(-1, dlt_buffer_remove(&buf)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Call remove 10 time, expected > 1 till buffer is empty // pushed one time so expect one > 1 and 9 times < 0 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,size)); // for(int i=0; i<10;i++) // { // if(i == 0) @@ -762,7 +761,7 @@ TEST(t_dlt_buffer_remove, abnormal) // else // EXPECT_GE(-1, dlt_buffer_remove(&buf)); // } -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_remove, nullpointer) { @@ -782,15 +781,15 @@ TEST(t_dlt_buffer_copy, normal) int size = sizeof(DltUserHeader); // Normal Use-Case, empty pull, expected -1 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_copy(&buf, (unsigned char *)&header, size)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Normal Use-Case, expected > 0 - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); EXPECT_LE(1, dlt_buffer_copy(&buf, (unsigned char *)&header, size)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_copy, abnormal) { @@ -802,9 +801,9 @@ TEST(t_dlt_buffer_copy, abnormal) // EXPECT_LE(-1, dlt_buffer_copy(&buf, (unsigned char *)&header, size)); // no push before copy, expected -1 -// EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); // EXPECT_LE(-1, dlt_buffer_copy(&buf, (unsigned char *)&header, size)); -// EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_copy, nullpointer) { @@ -817,12 +816,12 @@ TEST(t_dlt_buffer_copy, nullpointer) EXPECT_LE(-1, dlt_buffer_copy(NULL,NULL,0)); EXPECT_LE(-1, dlt_buffer_copy(NULL,(unsigned char *)&header,size)); EXPECT_LE(-1, dlt_buffer_copy(NULL,(unsigned char *)&header,0)); - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_LE(-1, dlt_buffer_copy(&buf,NULL,size)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0,dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_LE(-1, dlt_buffer_copy(&buf,NULL,0)); - EXPECT_LE(0,dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } /* End Method: dlt_common::dlt_buffer_copy */ @@ -837,82 +836,82 @@ TEST(t_dlt_buffer_get, normal) int size = sizeof(DltUserHeader); // Normal Use-Case - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,size)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,size)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); EXPECT_LE(0, dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,size)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,size)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); EXPECT_LE(0, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[0] = 50000; EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[1] = 50000; EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[2] = -50000; EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[2] = 0; EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[0] = 4000; ((int*)(buf.shm))[1] = 5000; ((int*)(buf.shm))[2] = 0; EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[0] = 10; ((int*)(buf.shm))[1] = 5; ((int*)(buf.shm))[2] = 5; EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[2] = 50000; EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,size)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,size)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[0] = 19; EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char*)&header,size,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,size)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,size)); printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); ((int*)(buf.shm))[2] = 19; EXPECT_LE(0, dlt_buffer_get(&buf,(unsigned char*)&header,5,1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_get, abnormal) { @@ -924,11 +923,11 @@ TEST(t_dlt_buffer_get, abnormal) // EXPECT_GE(-1, dlt_buffer_get(&buf,(unsigned char *)&header,size, 0)); // Integer with 12345678 -// EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); -// EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,size)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,size)); // printf("#### %i\n", dlt_buffer_get(&buf,(unsigned char*)&header,size,0)); // EXPECT_LE(0, dlt_buffer_get(&buf,(unsigned char*)&header,size,12345678)); -// EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); +// EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_get, nullpointer) { @@ -945,18 +944,18 @@ TEST(t_dlt_buffer_get, nullpointer) EXPECT_GE(-1, dlt_buffer_get(NULL, (unsigned char*)&header, 0, 1)); EXPECT_GE(-1, dlt_buffer_get(NULL, (unsigned char*)&header, size, 0)); EXPECT_GE(-1, dlt_buffer_get(NULL, (unsigned char*)&header, size, 1)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_get(&buf, NULL, 0, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_get(&buf, NULL, 0, 1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_get(&buf, NULL, size, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_GE(-1, dlt_buffer_get(&buf, NULL, size, 1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } /* End Method: dlt_common::dlt_buffer_get */ @@ -970,27 +969,27 @@ TEST(t_dlt_buffer_get_message_count, normal) DltUserHeader header; // Normal Usce-Case without pushing data, expected 0 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); //printf("##### %i\n", dlt_buffer_get_message_count(&buf)); EXPECT_LE(0, dlt_buffer_get_message_count(&buf)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Normal Use-Case, with pushing data, expected > 0 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); //printf("#### %i\n", dlt_buffer_get_message_count(&buf)); EXPECT_LE(0, dlt_buffer_get_message_count(&buf)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Pushing 1000 mesages, expected 10000 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); for(int i = 1; i <= 10000; i++) { - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); //printf("#### %i\n", dlt_buffer_get_message_count(&buf)); EXPECT_LE(i, dlt_buffer_get_message_count(&buf)); } - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_get_message_count, abnormal) @@ -1017,17 +1016,17 @@ TEST(t_dlt_buffer_get_total_size, normal) DltUserHeader header; // Normal Use-Case, expected max buffer size (DLT_USER_RINGBUFFER_MAX_SIZE) - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); //printf("##### %i\n", dlt_buffer_get_total_size(&buf)); EXPECT_LE(DLT_USER_RINGBUFFER_MAX_SIZE, dlt_buffer_get_total_size(&buf)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Normal Use-Case, 1st pushing data, expected max buffer size (DLT_USER_RINGBUFFER_MAX_SIZE) - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); //printf("##### %i\n", dlt_buffer_get_total_size(&buf)); EXPECT_LE(DLT_USER_RINGBUFFER_MAX_SIZE, dlt_buffer_get_total_size(&buf)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_get_total_size, abnormal) { @@ -1052,27 +1051,27 @@ TEST(t_dlt_buffer_get_used_size, normal) DltUserHeader header; // Normal Use Cas buffer empty, expected 0 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); //printf("##### %i\n", dlt_buffer_get_used_size(&buf)); EXPECT_LE(0, dlt_buffer_get_used_size(&buf)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Normal Use-Case with pushing data, expected > 0 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); //printf("##### %i\n", dlt_buffer_get_used_size(&buf)); EXPECT_LE(0, dlt_buffer_get_used_size(&buf)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); // Normal Use-Case with pushing 10000 data, expected > 0 - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); for(int i = 1; i <= 10000; i++) { - EXPECT_LE(0,dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_push(&buf,(unsigned char *)&header,sizeof(DltUserHeader))); //printf("#### %i\n", dlt_buffer_get_used_size(&buf)); EXPECT_LE(1, dlt_buffer_get_used_size(&buf)); } - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_get_used_size, abnormal) { @@ -1101,22 +1100,22 @@ TEST(t_dlt_buffer_write_block, normal) int size2 = 1024; // Normal Use-Case, void method, expected no error - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf,&write, data, size1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf,&write, data, size2)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); int tmp =0; for(int i = 0; i<= 10000; i+=10) { tmp += i; EXPECT_NO_THROW(dlt_buffer_write_block(&buf,&write, data, i)); } - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_write_block, abnormal) { @@ -1139,24 +1138,24 @@ TEST(t_dlt_buffer_write_block, nullpointer) EXPECT_NO_THROW(dlt_buffer_write_block(NULL, &write, NULL, test1)); EXPECT_NO_THROW(dlt_buffer_write_block(NULL, &write, (unsigned char *)&data, 0)); EXPECT_NO_THROW(dlt_buffer_write_block(NULL, &write, (unsigned char *)&data, test1)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf, NULL, NULL, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf, NULL, NULL, test1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf, NULL, (unsigned char *)&data, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf, NULL, (unsigned char *)&data, test1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf, &write, NULL, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf, &write, NULL, test1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } /* End Method: dlt_common::dlt_buffer_write_block */ @@ -1173,15 +1172,15 @@ TEST(t_dlt_buffer_read_block, normal) int size2 = 1024; // Normal Use-Case, void method, expected no error - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf,&write, data, size1)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf,&write, data, size1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_write_block(&buf,&read, data, size2)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf,&write, data, size2)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } TEST(t_dlt_buffer_read_block, abnormal) { @@ -1204,27 +1203,27 @@ TEST(t_dlt_buffer_read_block, nullpointer) EXPECT_NO_THROW(dlt_buffer_read_block(NULL, &read, NULL, test1)); EXPECT_NO_THROW(dlt_buffer_read_block(NULL, &read, (unsigned char *)&data, 0)); EXPECT_NO_THROW(dlt_buffer_read_block(NULL, &read, (unsigned char *)&data, test1)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf, NULL, NULL, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf, NULL, NULL, test1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf, NULL, (unsigned char *)&data, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf, NULL, (unsigned char *)&data, test1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf, &read, NULL, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf, &read, NULL, test1)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_read_block(&buf, &read, (unsigned char *)&data, 0)); - EXPECT_LE(0, dlt_buffer_free_dynamic(&buf)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_free_dynamic(&buf)); } /* End Method: dlt_common::dlt_buffer_read_block */ @@ -1237,13 +1236,13 @@ TEST(t_dlt_buffer_info, normal) DltBuffer buf; // Normal Use-Case - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_info(&buf)); } TEST(t_dlt_buffer_info, abnormal) { - // actual no abnormal test cases - // because of void funktion and missing gtest tools for that + // actually no abnormal test cases + // because of void function and missing gtest tools for that } TEST(t_dlt_buffer_info, nullpointer) { @@ -1261,7 +1260,7 @@ TEST(t_dlt_buffer_status, normal) DltBuffer buf; // Normal Use-Case - EXPECT_LE(0, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); + EXPECT_LE(DLT_RETURN_OK, dlt_buffer_init_dynamic(&buf, DLT_USER_RINGBUFFER_MIN_SIZE, DLT_USER_RINGBUFFER_MAX_SIZE, DLT_USER_RINGBUFFER_STEP_SIZE)); EXPECT_NO_THROW(dlt_buffer_status(&buf)); } TEST(t_dlt_buffer_status, abnormal) @@ -1292,32 +1291,32 @@ TEST(t_dlt_message_init, normal) DltMessage msg; // Normal Use-Case, expected 0 - EXPECT_LE(0, dlt_message_init(&msg, 0)); - EXPECT_LE(0, dlt_message_free(&msg, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_message_init(&msg, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_message_free(&msg, 0)); - EXPECT_LE(0, dlt_message_init(&msg, 1)); - EXPECT_LE(0, dlt_message_free(&msg, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_message_init(&msg, 1)); + EXPECT_LE(DLT_RETURN_OK, dlt_message_free(&msg, 0)); } TEST(t_dlt_message_init, abnormal) { // DltMessage msg; // Double use init, expected -1 -// EXPECT_LE(0, dlt_message_init(&msg,0)); -// EXPECT_GE(-1, dlt_message_init(&msg,0)); -// EXPECT_LE(0, dlt_message_free(&msg,0)); -// EXPECT_LE(0, dlt_message_init(&msg,1)); -// EXPECT_GE(-1, dlt_message_init(&msg,1)); -// EXPECT_LE(0, dlt_message_free(&msg,1)); +// EXPECT_LE(DLT_RETURN_OK, dlt_message_init(&msg,0)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_message_init(&msg,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_message_free(&msg,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_message_init(&msg,1)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_message_init(&msg,1)); +// EXPECT_LE(DLT_RETURN_OK, dlt_message_free(&msg,1)); // set Verbose to 12345678, expected -1 -// EXPECT_GE(-1, dlt_message_init(&msg,12345678)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_message_init(&msg,12345678)); } TEST(t_dlt_message_init, nullpointer) { //NULL-Pointer, expected -1 - EXPECT_GE(-1, dlt_message_init(NULL, 0)); - EXPECT_GE(-1, dlt_message_init(NULL, 1)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_message_init(NULL, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_message_init(NULL, 1)); } /* End Method: dlt_common::dlt_message_init*/ @@ -1330,33 +1329,33 @@ TEST(t_dlt_message_free, normal) DltMessage msg; // Normal Use Case, expected 0 - EXPECT_LE(0, dlt_message_init(&msg, 0)); - EXPECT_LE(0, dlt_message_free(&msg, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_message_init(&msg, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_message_free(&msg, 0)); - EXPECT_LE(0, dlt_message_init(&msg, 0)); - EXPECT_LE(0, dlt_message_free(&msg, 1)); + EXPECT_LE(DLT_RETURN_OK, dlt_message_init(&msg, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_message_free(&msg, 1)); } TEST(t_dlt_message_free, abnormal) { // DltMessage msg; // Double use free, expected -1 -// EXPECT_LE(0, dlt_message_init(&msg,0)); -// EXPECT_LE(0, dlt_message_free(&msg,0)); -// EXPECT_GE(-1, dlt_message_free(&msg,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_message_init(&msg,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_message_free(&msg,0)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_message_free(&msg,0)); -// EXPECT_LE(0, dlt_message_init(&msg,0)); -// EXPECT_LE(0, dlt_message_free(&msg,1)); -// EXPECT_GE(-1, dlt_message_free(&msg,1)); +// EXPECT_LE(DLT_RETURN_OK, dlt_message_init(&msg,0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_message_free(&msg,1)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_message_free(&msg,1)); // set Verbose to 12345678, expected -1 -// EXPECT_GE(-1, dlt_message_free(&msg,12345678)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_message_free(&msg,12345678)); } TEST(t_dlt_message_free, nullpointer) { //NULL-Pointer, expected -1 - EXPECT_GE(-1, dlt_message_free(NULL, 0)); - EXPECT_GE(-1, dlt_message_free(NULL, 1)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_message_free(NULL, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_message_free(NULL, 1)); } /* End Method: dlt_common::dlt_message_free */ @@ -1375,13 +1374,13 @@ TEST(t_dlt_file_open, normal) /*---------------------------------------*/ // Normal Use-Case, expected 0 - EXPECT_LE(0, dlt_file_init(&file, 0)); - EXPECT_LE(0, dlt_file_open(&file, openfile, 0)); - EXPECT_LE(0, dlt_file_free(&file, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_init(&file, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_open(&file, openfile, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_free(&file, 0)); - EXPECT_LE(0, dlt_file_init(&file, 0)); - EXPECT_LE(0, dlt_file_open(&file, openfile, 1)); - EXPECT_LE(0, dlt_file_free(&file, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_init(&file, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_open(&file, openfile, 1)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_free(&file, 0)); } TEST(t_dlt_file_open, abnormal) { @@ -1394,14 +1393,14 @@ TEST(t_dlt_file_open, abnormal) /*---------------------------------------*/ // Uninizialsied, expected -1 -// EXPECT_GE(-1, dlt_file_open(&file, openfile, 0)); -// EXPECT_GE(-1, dlt_file_open(&file, openfile, 1)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(&file, openfile, 0)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(&file, openfile, 1)); // Verbose set to 12345678 -// EXPECT_GE(-1, dlt_file_open(&file, openfile, 12345678)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(&file, openfile, 12345678)); // Path doesn't exist, expected -1 -// EXPECT_GE(-1, dlt_file_open(&file, "This Path doesn't exist!!", 0)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(&file, "This Path doesn't exist!!", 0)); } TEST(t_dlt_file_open, nullpointer) { @@ -1414,12 +1413,12 @@ TEST(t_dlt_file_open, nullpointer) /*---------------------------------------*/ // NULL-Pointer, expected -1 - EXPECT_GE(-1, dlt_file_open(NULL, NULL, 0)); - EXPECT_GE(-1, dlt_file_open(NULL, NULL, 1)); - EXPECT_GE(-1, dlt_file_open(NULL, openfile, 0)); - EXPECT_GE(-1, dlt_file_open(NULL, openfile, 1)); - EXPECT_GE(-1, dlt_file_open(&file, NULL, 0)); - EXPECT_GE(-1, dlt_file_open(&file, NULL, 1)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(NULL, NULL, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(NULL, NULL, 1)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(NULL, openfile, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(NULL, openfile, 1)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(&file, NULL, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_file_open(&file, NULL, 1)); } /* End Method: dlt_common::dlt_file_open */ @@ -1441,20 +1440,20 @@ TEST(t_dlt_message_print_ascii, normal) /*---------------------------------------*/ // Normal Use-Case, expected 0 - EXPECT_LE(0, dlt_file_init(&file, 0)); - EXPECT_LE(0, dlt_file_open(&file, openfile, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_init(&file, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_open(&file, openfile, 0)); while (dlt_file_read(&file,0)>=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i 0 - EXPECT_LE(0, dlt_file_init(&file, 0)); - EXPECT_LE(0, dlt_filter_init(&filter, 0)); - EXPECT_LE(0, dlt_filter_load(&filter, openfilter, 0)); - EXPECT_LE(0, dlt_file_set_filter(&file, &filter, 0)); - EXPECT_LE(0, dlt_file_open(&file, openfile, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_init(&file, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_filter_init(&filter, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_filter_load(&filter, openfilter, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_set_filter(&file, &filter, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_open(&file, openfile, 0)); while (dlt_file_read(&file,0)>=0){} for(int i=0;i=0){} // for(int i=0;i0 - EXPECT_LE(0, dlt_file_init(&file, 0)); - EXPECT_LE(0, dlt_file_open(&file, openfile, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_init(&file, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_open(&file, openfile, 0)); while (dlt_file_read(&file,0)>=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i=0){} // for(int i=0;i=0){} // for(int i=0;i 0 but // we don't have text: @@ -2916,8 +2915,8 @@ TEST(t_dlt_message_payload, nullpointer) // (gdb) p ptr // $28 = (uint8_t *) 0x5124010337d46c00 -// EXPECT_GE(-1, dlt_message_payload(&file.msg, text, DLT_DAEMON_TEXTSIZE, 0, 0)); -// EXPECT_GE(-1, dlt_message_payload(&file.msg, text, DLT_DAEMON_TEXTSIZE, 0, 1)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_message_payload(&file.msg, text, DLT_DAEMON_TEXTSIZE, 0, 0)); +// EXPECT_GE(DLT_RETURN_ERROR, dlt_message_payload(&file.msg, text, DLT_DAEMON_TEXTSIZE, 0, 1)); } /* End Method:dlt_common::dlt_message_payload */ @@ -2936,20 +2935,20 @@ TEST(t_dlt_message_set_extraparamters, normal) /*---------------------------------------*/ // Normal Use-Case, expect 0 - EXPECT_LE(0, dlt_file_init(&file, 0)); - EXPECT_LE(0, dlt_file_open(&file, openfile, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_init(&file, 0)); + EXPECT_LE(DLT_RETURN_OK, dlt_file_open(&file, openfile, 0)); while (dlt_file_read(&file,0)>=0){} for(int i=0;i=0){} // for(int i=0;i=0){} for(int i=0;i=0){} for(int i=0;i=0){} for(int i=0;i=0){} for(int i=0;i=0){} // for(int i=0;i|"; // char text3[DLT_DAEMON_TEXTSIZE]; -// EXPECT_LE(0, dlt_print_hex_string(text3,DLT_DAEMON_TEXTSIZE,(unsigned char *)test3, strlen(test3))); +// EXPECT_LE(DLT_RETURN_OK, dlt_print_hex_string(text3,DLT_DAEMON_TEXTSIZE,(unsigned char *)test3, strlen(test3))); //printf("text:%s\n", text3); // convert text3 to an ascii string to compare with the original // char * converted = (char*) malloc(strlen(test3) +1); @@ -3476,12 +3475,12 @@ TEST(t_dlt_print_hex_string, abnormal) // converted[strlen(test3)] = '\0'; //printf("%s\n", converted); // EXPECT_STREQ(test3, converted); -// free(converted); +// free(converted); // Empty char *, expect 0 // const char * test4 = ""; // char text4[DLT_DAEMON_TEXTSIZE]; -// EXPECT_LE(0, dlt_print_hex_string(text4,DLT_DAEMON_TEXTSIZE,(unsigned char *)test4, strlen(test4))); +// EXPECT_LE(DLT_RETURN_OK, dlt_print_hex_string(text4,DLT_DAEMON_TEXTSIZE,(unsigned char *)test4, strlen(test4))); //printf("text:%s\n", text4); // convert text4 to an ascii string to compare with the original // converted = (char*) malloc(strlen(test4) +1); @@ -3498,16 +3497,16 @@ TEST(t_dlt_print_hex_string, abnormal) // converted[strlen(test4)] = '\0'; //printf("%s\n", converted); // EXPECT_STREQ(test4, converted); -// free(converted); +// free(converted); } TEST(t_dlt_print_hex_string, nullpointer) { const char * test5 = "HELLO"; char text5[DLT_DAEMON_TEXTSIZE]; - EXPECT_GE(-1, dlt_print_hex_string(NULL,0,NULL, 0)); - EXPECT_GE(-1, dlt_print_hex_string(NULL,0,(unsigned char *)test5, 0)); - EXPECT_GE(-1, dlt_print_hex_string(text5,0,NULL, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_hex_string(NULL,0,NULL, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_hex_string(NULL,0,(unsigned char *)test5, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_hex_string(text5,0,NULL, 0)); } /* End Method:dlt_common::dlt_print_hex_string */ @@ -3519,44 +3518,44 @@ TEST(t_dlt_print_mixed_string, normal) { const char * test1 = "HELLO_MIXED"; char text1[DLT_DAEMON_TEXTSIZE]; - EXPECT_LE(0, dlt_print_mixed_string(text1,DLT_DAEMON_TEXTSIZE,(unsigned char *)test1,strlen(test1),0)); + EXPECT_LE(DLT_RETURN_OK, dlt_print_mixed_string(text1,DLT_DAEMON_TEXTSIZE,(unsigned char *)test1,strlen(test1),0)); printf("%s\n", text1); const char * test2 = "HELLO_MIXED"; char text2[DLT_DAEMON_TEXTSIZE]; - EXPECT_LE(0, dlt_print_mixed_string(text2,DLT_DAEMON_TEXTSIZE,(unsigned char *)test2,strlen(test2),1)); + EXPECT_LE(DLT_RETURN_OK, dlt_print_mixed_string(text2,DLT_DAEMON_TEXTSIZE,(unsigned char *)test2,strlen(test2),1)); printf("%s\n", text2); const char * test3 = "qwertzuiopasdfghjklyxcvbnm1234567890"; char text3[DLT_DAEMON_TEXTSIZE]; - EXPECT_LE(0, dlt_print_mixed_string(text3,DLT_DAEMON_TEXTSIZE,(unsigned char *)test3,strlen(test3),0)); + EXPECT_LE(DLT_RETURN_OK, dlt_print_mixed_string(text3,DLT_DAEMON_TEXTSIZE,(unsigned char *)test3,strlen(test3),0)); printf("%s\n", text3); const char * test4 = "qwertzuiopasdfghjklyxcvbnm1234567890"; char text4[DLT_DAEMON_TEXTSIZE]; - EXPECT_LE(0, dlt_print_mixed_string(text4,DLT_DAEMON_TEXTSIZE,(unsigned char *)test4,strlen(test4),1)); + EXPECT_LE(DLT_RETURN_OK, dlt_print_mixed_string(text4,DLT_DAEMON_TEXTSIZE,(unsigned char *)test4,strlen(test4),1)); printf("%s\n", text4); } TEST(t_dlt_print_mixed_string, abnormal) { // const char * test5 = "^°!\"§$%&/()=?`´¹²³¼½¬{[]}\\¸@€üöä+#*'~`,.-;:_·…–<>|"; // char text5[DLT_DAEMON_TEXTSIZE]; -// EXPECT_LE(0, dlt_print_mixed_string(text5,DLT_DAEMON_TEXTSIZE,(unsigned char *)test5,strlen(test5),0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_print_mixed_string(text5,DLT_DAEMON_TEXTSIZE,(unsigned char *)test5,strlen(test5),0)); // printf("%s\n", text5); // const char * test6 = "^°!\"§$%&/()=?`´¹²³¼½¬{[]}\\¸@€üöä+#*'~`,.-;:_·…–<>|"; // char text6[DLT_DAEMON_TEXTSIZE]; -// EXPECT_LE(0, dlt_print_mixed_string(text6,DLT_DAEMON_TEXTSIZE,(unsigned char *)test6,strlen(test6),1)); +// EXPECT_LE(DLT_RETURN_OK, dlt_print_mixed_string(text6,DLT_DAEMON_TEXTSIZE,(unsigned char *)test6,strlen(test6),1)); // printf("%s\n", text6); // const char * test7 = ""; // char text7[DLT_DAEMON_TEXTSIZE]; -// EXPECT_LE(0, dlt_print_mixed_string(text7,DLT_DAEMON_TEXTSIZE,(unsigned char *)test7,strlen(test7),0)); +// EXPECT_LE(DLT_RETURN_OK, dlt_print_mixed_string(text7,DLT_DAEMON_TEXTSIZE,(unsigned char *)test7,strlen(test7),0)); // printf("%s\n", text7); // const char * test8 = ""; // char text8[DLT_DAEMON_TEXTSIZE]; -// EXPECT_LE(0, dlt_print_mixed_string(text8,DLT_DAEMON_TEXTSIZE,(unsigned char *)test8,strlen(test8),1)); +// EXPECT_LE(DLT_RETURN_OK, dlt_print_mixed_string(text8,DLT_DAEMON_TEXTSIZE,(unsigned char *)test8,strlen(test8),1)); // printf("%s\n", text8); } TEST(t_dlt_print_mixed_string, nullpointer) @@ -3564,12 +3563,12 @@ TEST(t_dlt_print_mixed_string, nullpointer) const char * test9 = ""; char text9[DLT_DAEMON_TEXTSIZE]; - EXPECT_GE(-1, dlt_print_mixed_string(NULL,0,0,0,0)); - EXPECT_GE(-1, dlt_print_mixed_string(NULL,0,0,0,1)); - EXPECT_GE(-1, dlt_print_mixed_string(NULL,0,(unsigned char *)test9,0,0)); - EXPECT_GE(-1, dlt_print_mixed_string(NULL,0,(unsigned char *)test9,0,1)); - EXPECT_GE(-1, dlt_print_mixed_string(text9,0,NULL,0,0)); - EXPECT_GE(-1, dlt_print_mixed_string(text9,0,NULL,0,1)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_mixed_string(NULL,0,0,0,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_mixed_string(NULL,0,0,0,1)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_mixed_string(NULL,0,(unsigned char *)test9,0,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_mixed_string(NULL,0,(unsigned char *)test9,0,1)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_mixed_string(text9,0,NULL,0,0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_mixed_string(text9,0,NULL,0,1)); } /* End Method:dlt_common::dlt_print_mixed_string */ @@ -3583,14 +3582,14 @@ TEST(t_dlt_print_char_string, normal) const char * test1 = "HELLO"; char text1[DLT_DAEMON_TEXTSIZE]; char * ptr1 = text1; - EXPECT_LE(0, dlt_print_char_string(&ptr1,DLT_DAEMON_TEXTSIZE,(unsigned char *)test1, strlen(test1))); + EXPECT_LE(DLT_RETURN_OK, dlt_print_char_string(&ptr1,DLT_DAEMON_TEXTSIZE,(unsigned char *)test1, strlen(test1))); printf("text:%s\n", text1); EXPECT_STREQ(text1, test1); const char * test2 = "qwertzuiopasdfghjklyxcvbnm1234567890"; char text2[DLT_DAEMON_TEXTSIZE]; char * ptr2 = text2; - EXPECT_LE(0, dlt_print_char_string(&ptr2,DLT_DAEMON_TEXTSIZE,(unsigned char *)test2, strlen(test2))); + EXPECT_LE(DLT_RETURN_OK, dlt_print_char_string(&ptr2,DLT_DAEMON_TEXTSIZE,(unsigned char *)test2, strlen(test2))); printf("text:%s\n", text2); EXPECT_STREQ(text2, test2); } @@ -3600,7 +3599,7 @@ TEST(t_dlt_print_char_string, abnormal) // const char * test3 = "^°!\"§$%&/()=?`´¹²³¼½¬{[]}\\¸@€üöä+#*'~`,.-;:_·…–<>|"; // char text3[DLT_DAEMON_TEXTSIZE]; // char * ptr3 = text3; -// EXPECT_LE(0, dlt_print_char_string(&ptr3,DLT_DAEMON_TEXTSIZE,(unsigned char *)test3, strlen(test3))); +// EXPECT_LE(DLT_RETURN_OK, dlt_print_char_string(&ptr3,DLT_DAEMON_TEXTSIZE,(unsigned char *)test3, strlen(test3))); // printf("text:%s\n", text3); // EXPECT_STREQ(text3, test3); @@ -3608,7 +3607,7 @@ TEST(t_dlt_print_char_string, abnormal) // const char * test4 = ""; // char text4[DLT_DAEMON_TEXTSIZE]; // char * ptr4 = text4; -// EXPECT_LE(0, dlt_print_char_string(&ptr4,DLT_DAEMON_TEXTSIZE,(unsigned char *)test4, strlen(test4))); +// EXPECT_LE(DLT_RETURN_OK, dlt_print_char_string(&ptr4,DLT_DAEMON_TEXTSIZE,(unsigned char *)test4, strlen(test4))); // printf("text:%s\n", text4); // EXPECT_STREQ(text4, test4); } @@ -3618,9 +3617,9 @@ TEST(t_dlt_print_char_string, nullpointer) char text5[DLT_DAEMON_TEXTSIZE]; char * ptr5 = text5; - EXPECT_GE(-1, dlt_print_char_string(NULL,0,NULL, 0)); - EXPECT_GE(-1, dlt_print_char_string(NULL,0,(unsigned char *)test5, 0)); - EXPECT_GE(-1, dlt_print_char_string(&ptr5,0,NULL, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_char_string(NULL,0,NULL, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_char_string(NULL,0,(unsigned char *)test5, 0)); + EXPECT_GE(DLT_RETURN_ERROR, dlt_print_char_string(&ptr5,0,NULL, 0)); } /* End Method:dlt_common::dlt_print_char_string */ -- cgit v1.2.1