From c97540d41b217f3dfb7119403a7d3dfcb9043db2 Mon Sep 17 00:00:00 2001 From: srz-zumix Date: Tue, 7 Apr 2015 08:32:29 +0900 Subject: [PATCH] update r809 --- doc/Doxyfile | 2 +- include/impl/iutest_printer_c.inl | 10 ++++++++-- include/iutest_ver_c.h | 4 ++-- test/iutest_unit_tests.c | 15 +++++++++++++++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index 94d6c44..fc3086b 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -32,7 +32,7 @@ PROJECT_NAME = iutest_c # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.5.0.8 +PROJECT_NUMBER = 1.5.0.9 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/include/impl/iutest_printer_c.inl b/include/impl/iutest_printer_c.inl index a3ef549..3eb4f7a 100644 --- a/include/impl/iutest_printer_c.inl +++ b/include/impl/iutest_printer_c.inl @@ -6,7 +6,7 @@ * * @author t.sirayanagi * @par copyright - * Copyright (C) 2012-2014, Takazumi Shirayanagi\n + * Copyright (C) 2012-2015, Takazumi Shirayanagi\n * This software is released under the new BSD License, * see LICENSE */ @@ -127,6 +127,7 @@ IUTEST_C_INL_INLINE IUTEST_ATTRIBUTE_UNUSED_ char* iuTest_PrintTo(char* dst, con *dst++ = ' '; *dst++ = iuString_ToHex(((*src)>>4)&0xF); *dst++ = iuString_ToHex(((*src)>>0)&0xF); + ++src; } } else @@ -137,17 +138,22 @@ IUTEST_C_INL_INLINE IUTEST_ATTRIBUTE_UNUSED_ char* iuTest_PrintTo(char* dst, con *dst++ = ' '; *dst++ = iuString_ToHex(((*src)>>4)&0xF); *dst++ = iuString_ToHex(((*src)>>0)&0xF); + ++src; } + *dst++ = ','; + *dst++ = ' '; *dst++ = '.'; *dst++ = '.'; *dst++ = '.'; *dst++ = ' '; - for( i=0; i < MAX/2; ++i ) + src += size - MAX; + for( i=0; i < MAX / 2; ++i ) { *dst++ = ','; *dst++ = ' '; *dst++ = iuString_ToHex(((*src)>>4)&0xF); *dst++ = iuString_ToHex(((*src)>>0)&0xF); + ++src; } } *dst++ = ' '; diff --git a/include/iutest_ver_c.h b/include/iutest_ver_c.h index e96ea9e..15cd137 100644 --- a/include/iutest_ver_c.h +++ b/include/iutest_ver_c.h @@ -16,11 +16,11 @@ #define INCG_IRIS_IUTEST_VER_C_H_D65CB7A7_D2AD_40FE_8F5F_8FBF376A0010_ /* define ============================================================*/ -#define IUTEST_C_VER 0x01050008 /*!< iutest version 1.5.0.8 */ +#define IUTEST_C_VER 0x01050009 /*!< iutest version 1.5.0.9 */ #define IUTEST_C_MAJORVER 0x01 /*!< Major Version */ #define IUTEST_C_MINORVER 0x05 /*!< Minor Version */ #define IUTEST_C_BUILD 0x00 /*!< Build */ -#define IUTEST_C_REVISION 0x08 /*!< Revision */ +#define IUTEST_C_REVISION 0x09 /*!< Revision */ /** * @mainpage diff --git a/test/iutest_unit_tests.c b/test/iutest_unit_tests.c index 743725d..a630769 100644 --- a/test/iutest_unit_tests.c +++ b/test/iutest_unit_tests.c @@ -122,6 +122,21 @@ IUTEST(FormatUnit, PrintTo) const char* p = iuTest_PrintTo(s, &c, sizeof(c)); IUTEST_ASSERT_STREQ("0x000000000000002A", p); } + { + int c[2]={42, 43}; + const char* p = iuTest_PrintTo(s, c, sizeof(c)); + IUTEST_ASSERT_STREQ("0x0000002B0000002A", p); + } #endif + { + char c[9]={42, 43, 44, 45, 46, 47, 48, 49, 50}; + const char* p = iuTest_PrintTo(s, c, sizeof(c)); + IUTEST_ASSERT_STREQ("{ 2A, 2B, 2C, 2D, 2E, 2F, 30, 31, 32 }", p); + } + { + int c[4]={42, 43, 44, 45}; + const char* p = iuTest_PrintTo(s, c, sizeof(c)); + IUTEST_ASSERT_STREQ("{ 2A, 00, 00, 00, 2B, ... , 00, 2D, 00, 00, 00 }", p); + } }