Title: [234411] trunk
Revision
234411
Author
tpop...@redhat.com
Date
2018-07-31 02:20:57 -0700 (Tue, 31 Jul 2018)

Log Message

[WTF] String::formatWithArguments() is unused
https://bugs.webkit.org/show_bug.cgi?id=187955

Reviewed by Darin Adler.

Source/WTF:

This method is unused, remove it.

* wtf/text/WTFString.cpp:
(WTF::String::formatWithArguments): Deleted.
* wtf/text/WTFString.h:

Tools:

Remove tests for WTF::String::formatWithArguments() as it's unused and
we are removing it.

* TestWebKitAPI/Tests/WTF/WTFString.cpp:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (234410 => 234411)


--- trunk/Source/WTF/ChangeLog	2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Source/WTF/ChangeLog	2018-07-31 09:20:57 UTC (rev 234411)
@@ -1,3 +1,16 @@
+2018-07-31  Tomas Popela  <tpop...@redhat.com>
+
+        [WTF] String::formatWithArguments() is unused
+        https://bugs.webkit.org/show_bug.cgi?id=187955
+
+        Reviewed by Darin Adler.
+
+        This method is unused, remove it.
+
+        * wtf/text/WTFString.cpp:
+        (WTF::String::formatWithArguments): Deleted.
+        * wtf/text/WTFString.h:
+
 2018-07-28  Mark Lam  <mark....@apple.com>
 
         Gardening: build fix for internal builds.

Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (234410 => 234411)


--- trunk/Source/WTF/wtf/text/WTFString.cpp	2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp	2018-07-31 09:20:57 UTC (rev 234411)
@@ -499,11 +499,6 @@
     return StringImpl::create(reinterpret_cast<const LChar*>(buffer.data()), len);
 }
 
-String String::formatWithArguments(const char *format, va_list args)
-{
-    return createWithFormatAndArguments(format, args);
-}
-
 String String::format(const char *format, ...)
 {
     va_list args;

Modified: trunk/Source/WTF/wtf/text/WTFString.h (234410 => 234411)


--- trunk/Source/WTF/wtf/text/WTFString.h	2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2018-07-31 09:20:57 UTC (rev 234411)
@@ -263,7 +263,6 @@
     WTF_EXPORT_PRIVATE String foldCase() const;
 
     WTF_EXPORT_PRIVATE static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
-    WTF_EXPORT_PRIVATE static String formatWithArguments(const char *, va_list) WTF_ATTRIBUTE_PRINTF(1, 0);
 
     // Returns an uninitialized string. The characters needs to be written
     // into the buffer returned in data before the returned string is used.

Modified: trunk/Tools/ChangeLog (234410 => 234411)


--- trunk/Tools/ChangeLog	2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Tools/ChangeLog	2018-07-31 09:20:57 UTC (rev 234411)
@@ -1,3 +1,15 @@
+2018-07-31  Tomas Popela  <tpop...@redhat.com>
+
+        [WTF] String::formatWithArguments() is unused
+        https://bugs.webkit.org/show_bug.cgi?id=187955
+
+        Reviewed by Darin Adler.
+
+        Remove tests for WTF::String::formatWithArguments() as it's unused and
+        we are removing it.
+
+        * TestWebKitAPI/Tests/WTF/WTFString.cpp:
+
 2018-07-30  Aakash Jain  <aakash_j...@apple.com>
 
         [ews-build] Fix typo in builder name for Bindings-tests-EWS.

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp (234410 => 234411)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp	2018-07-31 07:23:41 UTC (rev 234410)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp	2018-07-31 09:20:57 UTC (rev 234411)
@@ -460,45 +460,6 @@
     EXPECT_EQ(reference.reverseFind('c', 4), notFound);
 }
 
-WTF_ATTRIBUTE_PRINTF(2, 3)
-static void testWithFormatAndArguments(const char* expected, const char* format, ...)
-{
-    va_list arguments;
-    va_start(arguments, format);
-
-#if COMPILER(GCC_OR_CLANG)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
-#endif
-    String result = String::formatWithArguments(format, arguments);
-#if COMPILER(GCC_OR_CLANG)
-#pragma GCC diagnostic pop
-#endif
-
-    va_end(arguments);
-
-    EXPECT_STREQ(expected, result.utf8().data());
-}
-
-TEST(WTF, StringFormatWithArguments)
-{
-    testWithFormatAndArguments("hello cruel world", "%s %s %s", "hello", "cruel" , "world");
-
-    testWithFormatAndArguments("hello 17890 world", "%s%u%s", "hello ", 17890u, " world");
-
-    testWithFormatAndArguments("hello 17890.000 world", "%s %.3f %s", "hello", 17890.0f, "world");
-    testWithFormatAndArguments("hello 17890.50 world", "%s %.2f %s", "hello", 17890.5f, "world");
-
-    testWithFormatAndArguments("hello -17890 world", "%s %.0f %s", "hello", -17890.0f, "world");
-    testWithFormatAndArguments("hello -17890.5 world", "%s %.1f %s", "hello", -17890.5f, "world");
-
-    testWithFormatAndArguments("hello 17890 world", "%s %.0f %s", "hello", 17890.0, "world");
-    testWithFormatAndArguments("hello 17890.5 world", "%s %.1f %s", "hello", 17890.5, "world");
-
-    testWithFormatAndArguments("hello -17890 world", "%s %.0f %s", "hello", -17890.0, "world");
-    testWithFormatAndArguments("hello -17890.5 world", "%s %.1f %s", "hello", -17890.5, "world");
-}
-
 TEST(WTF, StringSplitWithConsecutiveSeparators)
 {
     String string { " This     is  a       sentence. " };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to