OSDN Git Service

Fixed test case for bug 1639453.
authorGal Hammer <galh@users.sourceforge.net>
Mon, 14 May 2007 06:02:44 +0000 (06:02 +0000)
committerGal Hammer <galh@users.sourceforge.net>
Mon, 14 May 2007 06:02:44 +0000 (06:02 +0000)
Added test case for bug 1714088.

Testing/CppUnit/Changes.txt
Testing/CppUnit/StringDifferencing/DiffColoring.cpp
Testing/CppUnit/StringDifferencing/DiffColoring.h

index d0d6dca..bb978c9 100644 (file)
@@ -1,5 +1,10 @@
 Testing\selftest\Changes.txt\r
 \r
+2007-05-14 Gal\r
+ Fixed test case for bug 1639453.\r
+ Added test case for bug 1714088.\r
+  StringDifferencing: DiffColoring.cpp DiffColoring.h\r
+\r
 2007-03-26 Gal\r
  Fix and addition to line coloring tests\r
   StringDifferencing: DiffColoring.cpp DiffColoring.h\r
index 9b9048e..9803650 100644 (file)
@@ -221,7 +221,7 @@ void DiffColoring::Bug1639453()
                &diffs);\r
        count = diffs.GetSize();\r
        CPPUNIT_ASSERT(count == 1);\r
-       CPPUNIT_ASSERT(diffs[0] == wdiff(7, 6, 7, 10));\r
+       CPPUNIT_ASSERT(diffs[0] == wdiff(8, 7, 7, 10));\r
 \r
        // A more complex strings.\r
        string1 = _T("[overlay_oid_origin, overlay_oid_target], [nil, nil]");\r
@@ -265,3 +265,22 @@ void DiffColoring::Bug1683061()
        CPPUNIT_ASSERT(diffs[0] == wdiff(3, 2, 3, 3));\r
 }\r
 \r
+/**\r
+* @brief Bug #1683061: Displays not existing content.\r
+*/\r
+void DiffColoring::Bug1714088()\r
+{\r
+       wdiffarray diffs;\r
+       CString string1(_T("arg_separator.output = \";\""));\r
+       CString string2(_T(";arg_separator.output = \"&amp;\""));\r
+       int count = 0;\r
+\r
+       // Compare case, all white spaces, whitespace break, char level\r
+       sd_ComputeWordDiffs(string1, string2,\r
+               true, WHITESPACE_COMPARE_ALL, 0, true,\r
+               &diffs);\r
+       count = diffs.GetSize();\r
+       CPPUNIT_ASSERT(count == 2);\r
+       CPPUNIT_ASSERT(diffs[0] == wdiff(26, 25, 0, 0));\r
+       CPPUNIT_ASSERT(diffs[1] == wdiff(26, 25, 25, 28));\r
+}\r
index a4b01ce..14a20b0 100644 (file)
@@ -30,6 +30,7 @@ class DiffColoring : public CPPUNIT_NS::TestFixture
        CPPUNIT_TEST( Bug1491334 );\r
        CPPUNIT_TEST( Bug1639453 );\r
        CPPUNIT_TEST( Bug1683061 );\r
+       CPPUNIT_TEST( Bug1714088 );\r
        CPPUNIT_TEST_SUITE_END();\r
 \r
 public:\r
@@ -47,6 +48,7 @@ protected:
        void Bug1491334();\r
        void Bug1639453();\r
        void Bug1683061();\r
+       void Bug1714088();\r
 };\r
 \r
 #endif // _DIFF_COLORING_H_INCLUDED_\r