summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/dlt/dlt_user.h4
-rw-r--r--src/tests/dlt-test-client.c10
-rw-r--r--src/tests/dlt-test-filetransfer.c9
3 files changed, 15 insertions, 8 deletions
diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h
index d5d8ed7..a24117e 100644
--- a/include/dlt/dlt_user.h
+++ b/include/dlt/dlt_user.h
@@ -89,9 +89,9 @@
extern "C" {
#endif
-#define DLT_USER_BUF_MAX_SIZE 2048 /**< maximum size of each user buffer, also used for injection buffer */
+#define DLT_USER_BUF_MAX_SIZE 1390 /**< maximum size of each user buffer, also used for injection buffer */
-#define DLT_USER_RESENDBUF_MAX_SIZE (DLT_USER_BUF_MAX_SIZE + 100) /**< Size of resend buffer; Max DLT message size is 2K plus some extra header space */
+#define DLT_USER_RESENDBUF_MAX_SIZE (DLT_USER_BUF_MAX_SIZE + 100) /**< Size of resend buffer; Max DLT message size is 1390 bytes plus some extra header space */
/* Use a semaphore or mutex from your OS to prevent concurrent access to the DLT buffer. */
#define DLT_SEM_LOCK() { sem_wait(&dlt_mutex); }
diff --git a/src/tests/dlt-test-client.c b/src/tests/dlt-test-client.c
index a3a79d9..83a6fe6 100644
--- a/src/tests/dlt-test-client.c
+++ b/src/tests/dlt-test-client.c
@@ -84,6 +84,8 @@
#define DLT_TESTCLIENT_NUM_TESTS 9
+static int g_testsFailed = 0;
+
/* Function prototypes */
int dlt_testclient_message_callback(DltMessage *message, void *data);
@@ -372,7 +374,7 @@ int main(int argc, char* argv[])
dlt_filter_free(&(dltdata.filter),dltdata.vflag);
- return 0;
+ return g_testsFailed == 0 ? 0 : 1;
}
int dlt_testclient_message_callback(DltMessage *message, void *data)
@@ -1340,7 +1342,7 @@ int dlt_testclient_message_callback(DltMessage *message, void *data)
DLT_MSG_READ_VALUE(length_tmp,ptr,datalength,uint16_t);
length=DLT_ENDIAN_GET_16(message->standardheader->htyp, length_tmp);
// Size of the truncated message after headers
- if(length == 2001)
+ if(length == DLT_USER_BUF_MAX_SIZE - 41 - sizeof(uint16_t) - sizeof(uint32_t))
{
dltdata->test_counter_macro[7]++;
}
@@ -2495,7 +2497,7 @@ int dlt_testclient_message_callback(DltMessage *message, void *data)
DLT_MSG_READ_VALUE(length_tmp,ptr,datalength,uint16_t);
length=DLT_ENDIAN_GET_16(message->standardheader->htyp, length_tmp);
// Size of the truncated message after headers
- if(length == 2001)
+ if(length == DLT_USER_BUF_MAX_SIZE - 41 - sizeof(uint16_t) - sizeof(uint32_t))
{
dltdata->test_counter_function[7]++;
}
@@ -2784,6 +2786,8 @@ int dlt_testclient_message_callback(DltMessage *message, void *data)
close(dltdata->sock);
}
+ g_testsFailed = dltdata->tests_failed;
+
return 0;
}
diff --git a/src/tests/dlt-test-filetransfer.c b/src/tests/dlt-test-filetransfer.c
index 8c4b5c3..5ec4114 100644
--- a/src/tests/dlt-test-filetransfer.c
+++ b/src/tests/dlt-test-filetransfer.c
@@ -76,6 +76,7 @@ char *file3_2;
char *file3_3;
//!Just some variables
int i,countPackages, transferResult;
+static int g_numFailed = 0;
//!Prints the test result
void printTestResultPositiveExpected(const char *function, int result){
@@ -86,6 +87,7 @@ void printTestResultPositiveExpected(const char *function, int result){
else
{
printf("%s failed\n",function);
+ g_numFailed++;
}
}
@@ -99,6 +101,7 @@ void printTestResultNegativeExpected(const char *function, int result){
else
{
printf("%s failed\n",function);
+ g_numFailed++;
}
}
@@ -366,9 +369,9 @@ int testFile3Run3(){
int main(void)
{
//First file contains some text
- file1 = "/usr/share/dlt-filetransfer/dlt-test-filetransfer-file";
+ file1 = "/usr/local/share/dlt-filetransfer/dlt-test-filetransfer-file";
//Second file is a picture
- file2 = "/usr/share/dlt-filetransfer/dlt-test-filetransfer-image.png";
+ file2 = "/usr/local/share/dlt-filetransfer/dlt-test-filetransfer-image.png";
//Third file doesn't exist. Just to test the reaction when the file isn't available.
file3_1 = "dlt-test-filetransfer-doesntExist_1";
//Third file doesn't exist. Just to test the reaction when the file isn't available.
@@ -401,5 +404,5 @@ int main(void)
//Unregister the app from the dlt-daemon
DLT_UNREGISTER_APP();
- return(0);
+ return g_numFailed == 0 ? 0 : 1;
}