Title: [160167] trunk/Tools
Revision
160167
Author
[email protected]
Date
2013-12-05 04:00:50 -0800 (Thu, 05 Dec 2013)

Log Message

Remove duplicated/dead code from cpp style checker unit tests.
https://bugs.webkit.org/show_bug.cgi?id=125226

Patch by Tamas Gergely <[email protected]> on 2013-12-05
Reviewed by Ryosuke Niwa.

Remove the first definition of OrderOfIncludesTest class as it is
overwritten by the second. Remove a duplicated assert statement
from the second class.

* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(OrderOfIncludesTest.setUp):
(OrderOfIncludesTest.test_try_drop_common_suffixes):
  The last assert was duplicated.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (160166 => 160167)


--- trunk/Tools/ChangeLog	2013-12-05 11:07:11 UTC (rev 160166)
+++ trunk/Tools/ChangeLog	2013-12-05 12:00:50 UTC (rev 160167)
@@ -1,3 +1,19 @@
+2013-12-05  Tamas Gergely  <[email protected]>
+
+        Remove duplicated/dead code from cpp style checker unit tests.
+        https://bugs.webkit.org/show_bug.cgi?id=125226
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove the first definition of OrderOfIncludesTest class as it is
+        overwritten by the second. Remove a duplicated assert statement
+        from the second class.
+
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (OrderOfIncludesTest.setUp):
+        (OrderOfIncludesTest.test_try_drop_common_suffixes):
+          The last assert was duplicated.
+
 2013-12-05  László Langó  <[email protected]>
 
         Remove Scripts/generate-qt-inspector-resource.

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (160166 => 160167)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2013-12-05 11:07:11 UTC (rev 160166)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2013-12-05 12:00:50 UTC (rev 160167)
@@ -2533,30 +2533,6 @@
 
         # Cheat os.path.abspath called in FileInfo class.
         self.os_path_abspath_orig = os.path.abspath
-        os.path.abspath = lambda value: value
-
-    def tearDown(self):
-        os.path.abspath = self.os_path_abspath_orig
-
-    def test_try_drop_common_suffixes(self):
-        self.assertEqual('foo/foo', cpp_style._drop_common_suffixes('foo/foo-inl.h'))
-        self.assertEqual('foo/bar/foo',
-                         cpp_style._drop_common_suffixes('foo/bar/foo_inl.h'))
-        self.assertEqual('foo/foo', cpp_style._drop_common_suffixes('foo/foo.cpp'))
-        self.assertEqual('foo/foo_unusualinternal',
-                         cpp_style._drop_common_suffixes('foo/foo_unusualinternal.h'))
-        self.assertEqual('',
-                         cpp_style._drop_common_suffixes('_test.cpp'))
-        self.assertEqual('test',
-                         cpp_style._drop_common_suffixes('test.cpp'))
-
-
-class OrderOfIncludesTest(CppStyleTestBase):
-    def setUp(self):
-        self.include_state = cpp_style._IncludeState()
-
-        # Cheat os.path.abspath called in FileInfo class.
-        self.os_path_abspath_orig = os.path.abspath
         self.os_path_isfile_orig = os.path.isfile
         os.path.abspath = lambda value: value
 
@@ -2877,9 +2853,8 @@
                          cpp_style._drop_common_suffixes('_test.cpp'))
         self.assertEqual('test',
                          cpp_style._drop_common_suffixes('test.cpp'))
-        self.assertEqual('test',
-                         cpp_style._drop_common_suffixes('test.cpp'))
 
+
 class CheckForFunctionLengthsTest(CppStyleTestBase):
     def setUp(self):
         # Reducing these thresholds for the tests speeds up tests significantly.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to