]> gitweb.hamatoma.de Git - crepublib/commitdiff
dayly work
authorhama <hama@siduction.net>
Thu, 8 Jan 2015 23:05:25 +0000 (00:05 +0100)
committerhama <hama@siduction.net>
Thu, 8 Jan 2015 23:05:25 +0000 (00:05 +0100)
base/ReStringList.cpp
base/ReTestUnit.cpp
base/ReTestUnit.hpp
cunit/basetest.cpp
cunit/cuReCString.cpp
cunit/cuReStringList.cpp
cunit/cuReTest.cpp [new file with mode: 0644]
cunit/testall.cpp

index 3ec946ac93b5d49a07e668901e91f08e32b9e697..2f7ed6e3a07a7449815c448d047b0b52ac76a859 100644 (file)
@@ -359,15 +359,16 @@ bool ReStringList::readFromFile(const char* filename, bool cutNewline){
  */
 int ReStringList::firstDiff(const ReStringList& toCompare) const{
        int rc = -1;
-       for (size_t ix = 0; rc == -1 && ix < count(); ix++){
-               if (ix >= toCompare.count())
-                       rc = (int) ix;
-               else if (sizeOf(ix) != toCompare.sizeOf(ix)
+       int count1 = count();
+       int count2 = toCompare.count();
+       int maxIx = count1 > count2 ? count2 : count1;
+       for (size_t ix = 0; rc == -1 && ix < maxIx; ix++){
+               if (sizeOf(ix) != toCompare.sizeOf(ix)
                                || strcmp(strOf(ix), toCompare.strOf(ix)) != 0)
                        rc = (int) ix;
        }
-       if (rc == -1 && count() < toCompare.count())
-               rc = count();
+       if (rc == -1 && count1 != count2)
+               rc = maxIx;
        return rc;
 }
 /** @brief Tests the equality with another instance.
index 012bd021de55fc9da60e9127cb86e3c0cb6e0d88..5076c6d9f978982c0fb05d0ca69dd818eb276ffd 100644 (file)
  */
 ReTestUnit::ReTestUnit(const char* name, const char* sourceFile)
        :
-       m_name(_strdup(name)),
        m_errorCount(0),
-       m_sourceFile(_strdup(sourceFile))
+       m_name(name),
+       m_sourceFile(sourceFile),
+       m_buffer()
 {
        logF(false, i18n("Start %s"), name);
 }
@@ -24,9 +25,7 @@ ReTestUnit::ReTestUnit(const char* name, const char* sourceFile)
  */
 ReTestUnit::~ReTestUnit() {
        if (m_errorCount > 0)
-               logF(false, i18n("+++ %s: %d error(s)"), m_name, m_errorCount);
-       free((void*) m_name);
-       free((void*) m_sourceFile);
+               logF(false, i18n("+++ %s: %d error(s)"), m_name.str(), m_errorCount);
 }
 /** @brief Checks a boolean expression. A false value will be logged.
  *
@@ -37,7 +36,7 @@ ReTestUnit::~ReTestUnit() {
 void ReTestUnit::assertTrue(bool condition, int lineNo)
 {
        if (! condition){
-               logF(true, i18n("%s-%d: not true!"), m_sourceFile, lineNo);
+               logF(true, i18n("%s-%d: not true!"), m_sourceFile.str(), lineNo);
        }
 }
 /** @brief Checks a boolean expression. A true value will be logged.
@@ -49,7 +48,7 @@ void ReTestUnit::assertTrue(bool condition, int lineNo)
 void ReTestUnit::assertFalse(bool condition, int lineNo)
 {
        if (condition){
-               logF(true, i18n("%s-%d: not false!"), m_sourceFile, lineNo);
+               logF(true, i18n("%s-%d: not false!"), m_sourceFile.str(), lineNo);
        }
 }
 /** @brief Checks a pointer expression. A not <code>null</code> value will be logged.
@@ -60,7 +59,7 @@ void ReTestUnit::assertFalse(bool condition, int lineNo)
  */
 void ReTestUnit::assertNull(void* pointer, int lineNo){
        if (pointer != NULL){
-               logF(true, "%s-%d: is not null %lx", m_sourceFile, lineNo, pointer);
+               logF(true, "%s-%d: is not null %llx", m_sourceFile.str(), lineNo, (int64_t) pointer);
        }
 }
 /** @brief Checks a pointer expression. A <code>null</code> value will be logged.
@@ -71,7 +70,7 @@ void ReTestUnit::assertNull(void* pointer, int lineNo){
  */
 void ReTestUnit::assertNotNull(void* pointer, int lineNo){
        if (pointer == NULL){
-               logF(true, i18n("%s-%d: is null"), m_sourceFile, lineNo);
+               logF(true, i18n("%s-%d: is null"), m_sourceFile.str(), lineNo);
        }
 }
 /** @brief Compares two integer values. If not equal this will be logged.
@@ -83,7 +82,7 @@ void ReTestUnit::assertNotNull(void* pointer, int lineNo){
 void ReTestUnit::assertEqual(int expected, int current, int lineNo){
        if (expected != current){
                logF(true, i18n("%s-%d: expected: %ld (%lx) current: %ld (%lx)"),
-                       m_sourceFile, lineNo, expected, expected, current, current);
+                       m_sourceFile.str(), lineNo, expected, expected, current, current);
        }
 }
 /** @brief Compares two integer values. If not equal this will be logged.
@@ -95,7 +94,7 @@ void ReTestUnit::assertEqual(int expected, int current, int lineNo){
 void ReTestUnit::assertEqual(unsigned int expected, unsigned int current, int lineNo){
        if (expected != current){
                logF(true, i18n("%s-%d: expected: %ld (%lx) current: %ld (%lx)"),
-                       m_sourceFile, lineNo, expected, expected, current, current);
+                       m_sourceFile.str(), lineNo, expected, expected, current, current);
        }
 }
 /** @brief Compares two integer values. If not equal this will be logged.
@@ -107,7 +106,7 @@ void ReTestUnit::assertEqual(unsigned int expected, unsigned int current, int li
 void ReTestUnit::assertEqual(int64_t expected, int64_t current, int lineNo){
        if (expected != current){
                logF(true, i18n("%s-%d: expected: %lld (%llx) current: %lld (%llx)"),
-                       m_sourceFile, lineNo, expected, expected, current, current);
+                       m_sourceFile.str(), lineNo, expected, expected, current, current);
        }
 }
 /** @brief Compares two string values. If not equal this will be logged.
@@ -119,7 +118,7 @@ void ReTestUnit::assertEqual(int64_t expected, int64_t current, int lineNo){
 void ReTestUnit::assertEqual(const char* expected, const char* current, int lineNo){
        if (current == NULL || strcmp(expected, current) != 0){
                logF(true, i18n("%s-%d: expected / current: length: %d / %d\n%.512s\n%.512s"),
-                       m_sourceFile, lineNo, strlen(expected), current == NULL ? 0 : strlen(current),
+                       m_sourceFile.str(), lineNo, strlen(expected), current == NULL ? 0 : strlen(current),
                                expected, current == NULL ? "<null>" : current);
        }
 }
@@ -132,10 +131,10 @@ void ReTestUnit::assertFileExists(const char* name, int lineNo){
        struct stat info;
        if (stat(name, &info) != 0){
                logF(true, i18n("%s-%d: File does not exist: %s"),
-                       m_sourceFile, lineNo, name);
+                       m_sourceFile.str(), lineNo, name);
        } else if (S_ISDIR(info.st_mode)){
                logF(true, i18n("%s-%d: File does exist but this is a directory: %s"),
-                       m_sourceFile, lineNo, name);
+                       m_sourceFile.str(), lineNo, name);
        }
 }
 /** @brief Checks whether two files have the same content. If not this will be logged.
@@ -155,7 +154,9 @@ void ReTestUnit::assertEqualFiles(const char* name1, const char* name2, int line
                ReByteBuffer line1(list1.strOf(ix), list1.strLengthOf(ix));
                int ixLine = line1.firstDifference(list2.strOf(ix), list2.strLengthOf(ix));
                logF(true, i18n("%s-%d: Files differ in line %d-%d\n%s\n%s\n%s"),
-                       m_sourceFile, lineNo, ix, ixLine, list1.strOf(ix), list2.strOf(ix),
+                       m_sourceFile.str(), lineNo, ix, ixLine,
+                       list1.count() > ix ? list1.strOf(ix) : "",
+                       list2.count() > ix ? list2.strOf(ix) : "",
                        colMarker(ixLine));
        }
 
@@ -206,14 +207,14 @@ void ReTestUnit::createTestDir(){
                _snprintf(cmd, sizeof cmd, "rm -Rf %s*", name);
                system(cmd);
        }
-       strcpy(m_tempDir, name);
+       m_tempDir.set(name, -1);
 }
 /** @brief Returns the temporary directory.
  *
  * @return the name of a temporary directory
  */
 const char* ReTestUnit::getTestDir(){
-       return (const char*) m_tempDir;
+       return m_tempDir.str();
 }
 /** @brief Creates a file and fills it with an given content.
  *
@@ -246,10 +247,10 @@ void ReTestUnit::assertDirExists(const char* dir, int lineNo){
        struct stat info;
        if (stat(dir, &info) != 0){
                logF(true, i18n("%s-%d: Directory does not exist: %s"),
-                       m_sourceFile, lineNo, dir);
+                       m_sourceFile.str(), lineNo, dir);
        } else if (! S_ISDIR(info.st_mode)){
                logF(true, i18n("%s-%d: File exists but this is not a directory: %s"),
-                       m_sourceFile, lineNo, dir);
+                       m_sourceFile.str(), lineNo, dir);
        }
 }
 
index 996230480886894627edfd1a1632330c42107cc8..eef25201dc50d6e50b4963a1cc399e95e6e240f7 100644 (file)
@@ -37,10 +37,10 @@ public:
        virtual bool log(bool isError, const char* message);
        virtual bool logF(bool isError, const char* format, ...);
 protected:
-       const char* m_name;
        int m_errorCount;
-       const char* m_sourceFile;
-       char m_tempDir[512];
+       ReByteBuffer m_name;
+       ReByteBuffer m_sourceFile;
+       ReByteBuffer m_tempDir;
        ReByteBuffer m_buffer;
 };
 #define checkT(cond) assertTrue(cond, __LINE__)
index 8c3f126c645e6c9aa4a8731af39498543d4af775..a04a4f02a75ea0c92dde9f45729fc150799b4949 100644 (file)
@@ -27,8 +27,8 @@ void testReBase(void){
                testReVarArgs();
                extern void testReByteBuffer();
                testReByteBuffer();
-               extern void testReString(void);
-               testReString();
+               extern void testReCString(void);
+               testReCString();
                extern void testReVarArgs(void);
                testReVarArgs();
                extern void testReLogger(void);
index 692b782a95f92eb8aa3fdbc93acbc4700f2299db..ac4da6de533dafa7aec79deb31d0afc681b2e90a 100644 (file)
@@ -7,9 +7,9 @@
 #include "base/rebase.hpp"
 #include "string/restring.hpp"
 
-class TestReString : public ReTestUnit {
+class TestCReString : public ReTestUnit {
 public:
-       TestReString() : ReTestUnit("ReString", __FILE__){
+       TestCReString() : ReTestUnit("ReCString", __FILE__){
                run();
        }
 private:
@@ -19,7 +19,7 @@ private:
        }
        void testReplaceSubstring(){
                char buffer[256];
-
+#if 0
                strcpy(buffer, "12.ab");
                replaceSubstring(buffer, sizeof buffer, 0, "xy");
                checkEqu("xy12.ab", buffer);
@@ -31,8 +31,10 @@ private:
                replaceSubstring(buffer, 5, 0, "x");
                replaceSubstring(buffer, 6, 0, "x");
                checkEqu("xw.ab", buffer);
+#endif
        }
     void testMemicmp(){
+#if 0
                checkEqu(0, _memicmp((void*) "abcd", (void*) "abcx", 3u));
                checkEqu(0, _memicmp("aBcd", "AbCx", 3));
 
@@ -44,12 +46,12 @@ private:
 
         checkEqu(1, _memicmp("bbcd", "abcx", 3));
         checkEqu(-1, _memicmp("ABcd", "bbcx", 3));
+#endif
     }
-
 };
-extern void testReString(void);
+extern void testReCString(void);
 
-void testReString(void){
-       TestReString unit;
+void testReCString(void){
+       TestCReString unit;
 }
 
index cc2452cdfc64bfb74556caae7b47c8c0f52d3394..d38920f827c342920bacc7e3b8df54fb8a889f6a 100644 (file)
@@ -7,12 +7,14 @@ public:
        }
 private:
        void run(){
+#if 0
                testAppendByteBuffer();
                testBase();
                testReplace();
                testJoin();
                testEqu();
                testFile();
+#endif
        }
        void testAppendByteBuffer(){
                ReStringList list;
@@ -147,125 +149,131 @@ private:
 
        }
        void testFile(){
-               createTestDir();
-               ReByteBuffer file;
-               file.set(getTestDir(), -1).append("abc.csv", -1);
-
-               ReStringList list;
-               const char* str = "1;abc;xyz;4;;99";
-               list.split(str, ';');
-               list.writeToFile(file.str(), "\n");
-
-               ReStringList list2;
-               list2.readFromFile(file.str(), true);
-
-               checkEqu(-1, list2.firstDiff(list2));
+               if (true){
+                       createTestDir();
+                       ReByteBuffer file;
+                       file.set(getTestDir(), -1).append("abc.csv", -1);
+
+                       ReStringList list;
+                       const char* str = "1;abc;xyz;4;;99";
+                       list.split(str, ';');
+                       list.writeToFile(file.str(), "\n");
+
+                       ReStringList list2;
+                       list2.readFromFile(file.str(), true);
+
+                       checkEqu(-1, list2.firstDiff(list2));
+               }
+               //log(false, "end of testFile()");
        }
        void testBase(){
-               ReStringList list;
-               ReByteBuffer value;
-
-               list.append("123", 100);
-               checkEqu(0U, list.indexOf("123"));
-               list.append("a", 200);
-               list.append("vwxyz", 300);
-
-               checkEqu(3U, list.count());
-               int index = 0;
-               checkEqu("123", list.strOf(index));
-               checkEqu(4U, list.sizeOf(index));
-               checkEqu((int64_t) 100, list.tagOf(index));
-
-               index++;
-               checkEqu("a", list.strOf(index));
-               checkEqu(2U, list.sizeOf(index));
-               checkEqu((int64_t) 200, list.tagOf(index));
-
-               index++;
-               checkEqu("vwxyz", list.strOf(index));
-               checkEqu(6U, list.sizeOf(index));
-               checkEqu((int64_t) 300, list.tagOf(index));
-
-               checkEqu(12U, list.sumOfSizes());
-
-               list.insert(0, "0", 50);
-               checkEqu(4U, list.count());
-               checkEqu(14U, list.sumOfSizes());
-
-               index = 0;
-               checkEqu("0", list.strOf(index));
-               checkEqu(2U, list.sizeOf(index));
-               checkEqu((int64_t) 50, list.tagOf(index));
-
-               index++;
-               checkEqu("123", list.strOf(index));
-               checkEqu(4U, list.sizeOf(index));
-               checkEqu((int64_t) 100, list.tagOf(index));
-
-               index++;
-               checkEqu("a", list.strOf(index));
-               checkEqu(2U, list.sizeOf(index));
-               checkEqu((int64_t) 200, list.tagOf(index));
-
-               index++;
-               checkEqu("vwxyz", list.strOf(index));
-               checkEqu(6U, list.sizeOf(index));
-               checkEqu((int64_t) 300, list.tagOf(index));
-
-               checkEqu(0U, list.indexOf("0"));
-               checkEqu(1U, list.indexOf("123"));
-               checkEqu(2u, list.indexOf("a"));
-               checkEqu(2u, list.indexOf("A", true));
-               checkEqu(3u, list.indexOf("vwxyz"));
-               checkEqu(3u, list.indexOf("VwXyz", true));
-
-               checkEqu(0u, list.indexOf("0", false, 0));
-               checkEqu(1u, list.indexOf("123", false, 1));
-               checkEqu(2u, list.indexOf("a", false, 1));
-               checkEqu(2u, list.indexOf("a", false, 2));
-               checkEqu(2u, list.indexOf("A", true, 2));
-               checkEqu(3u, list.indexOf("vwxyz", false, 2));
-               checkEqu(3u, list.indexOf("vwxyz", false, 3));
-               checkEqu(3u, list.indexOf("VwXyz", true, 3));
-
-               checkEqu((ReStringList::Index) -1, list.indexOf("A"));
-               checkEqu((ReStringList::Index) -1, list.indexOf("0123"));
-               checkEqu((ReStringList::Index) -1, list.indexOf("a", false, 3));
-               checkEqu((ReStringList::Index) -1, list.indexOf("A", true, 3));
-
-               checkEqu(0u, list.nextStartingWith(0, "0"));
-               checkEqu(1u, list.nextStartingWith(0, "12"));
-               checkEqu(2u, list.nextStartingWith(0, "a"));
-               checkEqu(2u, list.nextStartingWith(1, "a"));
-               checkEqu(2u, list.nextStartingWith(2, "a"));
-               checkEqu(2u, list.nextStartingWith(0, "A", true));
-               checkEqu((ReStringList::Index) -1, list.nextStartingWith(2, "Ab", true));
-               checkEqu((ReStringList::Index) -1, list.nextStartingWith(0, "b", true));
-
-               checkEqu(3u, list.nextStartingWith(0, "vwxy", false));
-               checkEqu(3u, list.nextStartingWith(0, "vwxy", true));
-               checkEqu((ReStringList::Index) -1, list.nextStartingWith(0, "vWxY", false));
-
-               ReStringList list2;
-               list2.append("a", 100);
-               list2.append("b", 200);
-               list2.append("c", 300);
-               ReStringList list3;
-               list3.append("x", 1000);
-               list3.append("y", 2000);
-
-               list2.append(list3);
-               checkEqu(5u, list2.count());
-               checkEqu("a", list2.strOf(0));
-               checkEqu(100ll, list2.tagOf(0));
-               checkEqu("b", list2.strOf(1));
-               checkEqu(200ll, list2.tagOf(1));
-               checkEqu("c", list2.strOf(2));
-               checkEqu(300ll, list2.tagOf(2));
-               checkEqu("x", list2.strOf(3));
-               checkEqu(1000ll, list2.tagOf(3));
-               checkEqu("y", list2.strOf(4));
-               checkEqu(2000ll, list2.tagOf(4));
+               if (true){
+                       ReStringList list;
+                       ReByteBuffer value;
+
+                       list.append("123", 100);
+                       checkEqu(0U, list.indexOf("123"));
+                       list.append("a", 200);
+                       list.append("vwxyz", 300);
+
+                       checkEqu(3U, list.count());
+                       int index = 0;
+                       checkEqu("123", list.strOf(index));
+                       checkEqu(4U, list.sizeOf(index));
+                       checkEqu((int64_t) 100, list.tagOf(index));
+
+                       index++;
+                       checkEqu("a", list.strOf(index));
+                       checkEqu(2U, list.sizeOf(index));
+                       checkEqu((int64_t) 200, list.tagOf(index));
+
+                       index++;
+                       checkEqu("vwxyz", list.strOf(index));
+                       checkEqu(6U, list.sizeOf(index));
+                       checkEqu((int64_t) 300, list.tagOf(index));
+
+                       checkEqu(12U, list.sumOfSizes());
+
+                       list.insert(0, "0", 50);
+                       checkEqu(4U, list.count());
+                       checkEqu(14U, list.sumOfSizes());
+
+                       index = 0;
+                       checkEqu("0", list.strOf(index));
+                       checkEqu(2U, list.sizeOf(index));
+                       checkEqu((int64_t) 50, list.tagOf(index));
+
+                       index++;
+                       checkEqu("123", list.strOf(index));
+                       checkEqu(4U, list.sizeOf(index));
+                       checkEqu((int64_t) 100, list.tagOf(index));
+
+                       index++;
+                       checkEqu("a", list.strOf(index));
+                       checkEqu(2U, list.sizeOf(index));
+                       checkEqu((int64_t) 200, list.tagOf(index));
+
+                       index++;
+                       checkEqu("vwxyz", list.strOf(index));
+                       checkEqu(6U, list.sizeOf(index));
+                       checkEqu((int64_t) 300, list.tagOf(index));
+
+                       checkEqu(0U, list.indexOf("0"));
+                       checkEqu(1U, list.indexOf("123"));
+                       checkEqu(2u, list.indexOf("a"));
+                       checkEqu(2u, list.indexOf("A", true));
+                       checkEqu(3u, list.indexOf("vwxyz"));
+                       checkEqu(3u, list.indexOf("VwXyz", true));
+
+                       checkEqu(0u, list.indexOf("0", false, 0));
+                       checkEqu(1u, list.indexOf("123", false, 1));
+                       checkEqu(2u, list.indexOf("a", false, 1));
+                       checkEqu(2u, list.indexOf("a", false, 2));
+                       checkEqu(2u, list.indexOf("A", true, 2));
+                       checkEqu(3u, list.indexOf("vwxyz", false, 2));
+                       checkEqu(3u, list.indexOf("vwxyz", false, 3));
+                       checkEqu(3u, list.indexOf("VwXyz", true, 3));
+
+                       checkEqu((ReStringList::Index) -1, list.indexOf("A"));
+                       checkEqu((ReStringList::Index) -1, list.indexOf("0123"));
+                       checkEqu((ReStringList::Index) -1, list.indexOf("a", false, 3));
+                       checkEqu((ReStringList::Index) -1, list.indexOf("A", true, 3));
+
+                       checkEqu(0u, list.nextStartingWith(0, "0"));
+                       checkEqu(1u, list.nextStartingWith(0, "12"));
+                       checkEqu(2u, list.nextStartingWith(0, "a"));
+                       checkEqu(2u, list.nextStartingWith(1, "a"));
+                       checkEqu(2u, list.nextStartingWith(2, "a"));
+                       checkEqu(2u, list.nextStartingWith(0, "A", true));
+                       checkEqu((ReStringList::Index) -1, list.nextStartingWith(2, "Ab", true));
+                       checkEqu((ReStringList::Index) -1, list.nextStartingWith(0, "b", true));
+
+                       checkEqu(3u, list.nextStartingWith(0, "vwxy", false));
+                       checkEqu(3u, list.nextStartingWith(0, "vwxy", true));
+                       checkEqu((ReStringList::Index) -1, list.nextStartingWith(0, "vWxY", false));
+
+                       ReStringList list2;
+                       list2.append("a", 100);
+                       list2.append("b", 200);
+                       list2.append("c", 300);
+                       ReStringList list3;
+                       list3.append("x", 1000);
+                       list3.append("y", 2000);
+
+                       list2.append(list3);
+                       checkEqu(5u, list2.count());
+                       checkEqu("a", list2.strOf(0));
+                       checkEqu(100ll, list2.tagOf(0));
+                       checkEqu("b", list2.strOf(1));
+                       checkEqu(200ll, list2.tagOf(1));
+                       checkEqu("c", list2.strOf(2));
+                       checkEqu(300ll, list2.tagOf(2));
+                       checkEqu("x", list2.strOf(3));
+                       checkEqu(1000ll, list2.tagOf(3));
+                       checkEqu("y", list2.strOf(4));
+                       checkEqu(2000ll, list2.tagOf(4));
+               }
+               //log(false, "end of testbase");
        }
 };
 extern void testReStringList(void);
diff --git a/cunit/cuReTest.cpp b/cunit/cuReTest.cpp
new file mode 100644 (file)
index 0000000..388d753
--- /dev/null
@@ -0,0 +1,58 @@
+#include "base/rebase.hpp"
+
+class TestTestUnit : public ReTestUnit {
+public:
+       TestTestUnit() : ReTestUnit("TestTest", __FILE__){
+               run();
+       }
+private:
+       void run(){
+               testColMarker();
+               testEquFiles();
+               checkT(true);
+               checkF(false);
+               checkN(NULL);
+               checkNN("");
+               checkEqu(1, 1);
+               checkEqu("abc", "abc");
+#if defined    __linux__
+               checkDirExists("/etc/");
+               checkFileExists("/etc/passwd");
+#elif defined __WIN32__
+               checkDirExists("c:\\windows")
+#endif
+               log(false, "8 errors follow:");
+               checkT(false);
+               checkF(true);
+               checkN("");
+               checkNN(NULL);
+               checkEqu(1, 2);
+               checkEqu("abc", "abcd");
+               checkDirExists("/etc!/");
+               checkFileExists("/etc!/passwd");
+               log(false, "end of 8 expected errors");
+       }
+       void testColMarker(){
+               checkEqu("--^", colMarker(2));
+               checkEqu("^", colMarker(0));
+       }
+       void testEquFiles(){
+               createTestDir();
+               ReByteBuffer dir = getTestDir();
+               ReByteBuffer fn1(dir);
+               fn1.append("x1.txt");
+               ReByteBuffer fn2(dir);
+               fn2.append("x2.txt");
+               createFile(fn1.str(), "123\nline 2");
+               createFile(fn2.str(), "123\nline 2");
+               checkFileEqu(fn1.str(), fn2.str());
+               log(false, "difference in line 2:4:");
+               createFile(fn2.str(), "123\nline_2");
+               checkFileEqu(fn1.str(), fn2.str());
+       }
+};
+extern void testReTestUnit(void);
+
+void testReTestUnit(void){
+       TestTestUnit unit;
+}
index 9b3bf09b67ed04599126fea948e9532ca291039d..ab66b06e5553353b000de6d6cc1b7c040eeb16bf 100644 (file)
@@ -23,8 +23,8 @@ void testBase(){
        testReException();
        extern void testReVarArgs(void);
        testReVarArgs();
-       extern void testReString(void);
-       testReString();
+       extern void testReCString(void);
+       testReCString();
        extern void testReVarArgs(void);
        testReVarArgs();
        extern void testReDirectory(void);
@@ -36,19 +36,19 @@ void testBase(){
 
 }
 void testString(){
+    void testReCString();
+       testReCString();
        extern void testReStringList(void);
        testReStringList();
 
-    void testReString();
-       testReString();
        extern void testReI18N(void);
        testReI18N();
        extern void testReStringList(void);
        testReStringList();
        void testReStringUtils(void);
        testReStringUtils();
-       extern void testReString(void);
-       testReString();
+       extern void testReCString(void);
+       testReCString();
        extern void testReMatcher();
        testReMatcher();
 }