From 184447e7e4f1399d9411f94a14ab9b9ebff32a08 Mon Sep 17 00:00:00 2001 From: Azim Khan Date: Wed, 31 May 2017 20:29:36 +0100 Subject: [PATCH] Add proper handling of hex data --- tests/suites/desktop_test.function | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/suites/desktop_test.function b/tests/suites/desktop_test.function index 6e7fd075c..b2906a8dc 100644 --- a/tests/suites/desktop_test.function +++ b/tests/suites/desktop_test.function @@ -274,9 +274,22 @@ static int convert_params( size_t cnt , char ** params , int * int_params_store } else if ( strcmp( type, "hex" ) == 0 ) { - *int_params_store = unhexify( (unsigned char *) val, val ); - *out++ = (char *)int_params_store++; - *out++ = val; + if ( verify_string( &val ) == 0 ) + { + int j; + *int_params_store = unhexify( (unsigned char *) val, val ); + printf ("\n"); + for (j = 0; j < *int_params_store; j++) + printf ("%02x ", (uint8_t)val[j]); + printf ("\n len %d\n", *int_params_store); + *out++ = val; + *out++ = (char *)(int_params_store++); + } + else + { + ret = ( DISPATCH_INVALID_TEST_DATA ); + break; + } } else if ( strcmp( type, "exp" ) == 0 ) {