From 3c742c73a76440c8452e223cba7ae077450c3728 Mon Sep 17 00:00:00 2001 From: hama Date: Fri, 16 Jan 2015 23:54:39 +0100 Subject: [PATCH] cunit tests without errors --- base/ReProgramArgs.cpp | 6 ++++-- cunit/cuReTest.cpp | 3 +++ cunit/testall.cpp | 9 +++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/base/ReProgramArgs.cpp b/base/ReProgramArgs.cpp index d8d541a..3f82448 100644 --- a/base/ReProgramArgs.cpp +++ b/base/ReProgramArgs.cpp @@ -333,10 +333,12 @@ void ReProgramArgs::search(char shortName, const char* longName, lengthLongName = strlen(longName); } while (! found && m_properties.next(position, &name, &properties)){ + const char* ptr = properties.str(); + printf("%s\n", ptr); list.split(properties.str(), '\1'); - if (longName == NULL && shortName == list.strOf(IxShort)[0]) + if (longName == NULL && list.count() > IxShort && shortName == list.strOf(IxShort)[0]) found = true; - else if (lengthLongName > 0 && list.sizeOf(IxLong) == lengthLongName + 1 + else if (lengthLongName > 0 && list.count() > IxLong && list.sizeOf(IxLong) == lengthLongName + 1 && strncmp(longName, list.strOf(IxLong), lengthLongName) == 0) found = true; } diff --git a/cunit/cuReTest.cpp b/cunit/cuReTest.cpp index 388d753..2f7766b 100644 --- a/cunit/cuReTest.cpp +++ b/cunit/cuReTest.cpp @@ -7,8 +7,11 @@ public: } private: void run(){ + testBasic(); testColMarker(); testEquFiles(); + } + void testBasic(){ checkT(true); checkF(false); checkN(NULL); diff --git a/cunit/testall.cpp b/cunit/testall.cpp index 2e8906a..7ce041e 100644 --- a/cunit/testall.cpp +++ b/cunit/testall.cpp @@ -11,11 +11,12 @@ #endif void testBase(){ - extern void testReHashList(void); - testReHashList(); + extern void testReLogger(void); + testReLogger(); + testReLogger(); extern void testReTestUnit(); - // testReTestUnit(); + testReTestUnit(); extern void testReByteBuffer(); testReByteBuffer(); extern void testReSeqArray(void); @@ -62,9 +63,9 @@ void testOs(){ void testAll(){ try { + testOs(); testBase(); testString(); - testOs(); } catch (ReException e){ fprintf(stderr, "testBase.cpp: unexpected exception: %s\n", e.getMessage()); } -- 2.39.5