]> gitweb.hamatoma.de Git - crepublib/commitdiff
cunit tests without errors
authorhama <hama@siduction.net>
Fri, 16 Jan 2015 22:54:39 +0000 (23:54 +0100)
committerhama <hama@siduction.net>
Fri, 16 Jan 2015 22:54:39 +0000 (23:54 +0100)
base/ReProgramArgs.cpp
cunit/cuReTest.cpp
cunit/testall.cpp

index d8d541a4b85f7978242b6eb85bcb92da97fa22d8..3f82448377e56d55d77318ce83c448cf038b2c12 100644 (file)
@@ -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;
        }
index 388d7539b268d7fded95df9d157a0b833a1c451e..2f7766bf4636f79544b19a86ac2bb1a0741fbc3a 100644 (file)
@@ -7,8 +7,11 @@ public:
        }
 private:
        void run(){
+               testBasic();
                testColMarker();
                testEquFiles();
+       }
+       void testBasic(){
                checkT(true);
                checkF(false);
                checkN(NULL);
index 2e8906a41dbe125a4197e7a0c5d3073ea51a6b91..7ce041eb529d21e0c9c0f561e8c4f348e91234a1 100644 (file)
 #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());
        }