Changeset 234411 in webkit


Ignore:
Timestamp:
Jul 31, 2018 2:20:57 AM (6 years ago)
Author:
tpopela@redhat.com
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:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r234344 r234411  
     12018-07-31  Tomas Popela  <tpopela@redhat.com>
     2
     3        [WTF] String::formatWithArguments() is unused
     4        https://bugs.webkit.org/show_bug.cgi?id=187955
     5
     6        Reviewed by Darin Adler.
     7
     8        This method is unused, remove it.
     9
     10        * wtf/text/WTFString.cpp:
     11        (WTF::String::formatWithArguments): Deleted.
     12        * wtf/text/WTFString.h:
     13
    1142018-07-28  Mark Lam  <mark.lam@apple.com>
    215
  • trunk/Source/WTF/wtf/text/WTFString.cpp

    r234278 r234411  
    500500}
    501501
    502 String String::formatWithArguments(const char *format, va_list args)
    503 {
    504     return createWithFormatAndArguments(format, args);
    505 }
    506 
    507502String String::format(const char *format, ...)
    508503{
  • trunk/Source/WTF/wtf/text/WTFString.h

    r234278 r234411  
    264264
    265265    WTF_EXPORT_PRIVATE static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
    266     WTF_EXPORT_PRIVATE static String formatWithArguments(const char *, va_list) WTF_ATTRIBUTE_PRINTF(1, 0);
    267266
    268267    // Returns an uninitialized string. The characters needs to be written
  • trunk/Tools/ChangeLog

    r234398 r234411  
     12018-07-31  Tomas Popela  <tpopela@redhat.com>
     2
     3        [WTF] String::formatWithArguments() is unused
     4        https://bugs.webkit.org/show_bug.cgi?id=187955
     5
     6        Reviewed by Darin Adler.
     7
     8        Remove tests for WTF::String::formatWithArguments() as it's unused and
     9        we are removing it.
     10
     11        * TestWebKitAPI/Tests/WTF/WTFString.cpp:
     12
    1132018-07-30  Aakash Jain  <aakash_jain@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp

    r234278 r234411  
    461461}
    462462
    463 WTF_ATTRIBUTE_PRINTF(2, 3)
    464 static void testWithFormatAndArguments(const char* expected, const char* format, ...)
    465 {
    466     va_list arguments;
    467     va_start(arguments, format);
    468 
    469 #if COMPILER(GCC_OR_CLANG)
    470 #pragma GCC diagnostic push
    471 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
    472 #endif
    473     String result = String::formatWithArguments(format, arguments);
    474 #if COMPILER(GCC_OR_CLANG)
    475 #pragma GCC diagnostic pop
    476 #endif
    477 
    478     va_end(arguments);
    479 
    480     EXPECT_STREQ(expected, result.utf8().data());
    481 }
    482 
    483 TEST(WTF, StringFormatWithArguments)
    484 {
    485     testWithFormatAndArguments("hello cruel world", "%s %s %s", "hello", "cruel" , "world");
    486 
    487     testWithFormatAndArguments("hello 17890 world", "%s%u%s", "hello ", 17890u, " world");
    488 
    489     testWithFormatAndArguments("hello 17890.000 world", "%s %.3f %s", "hello", 17890.0f, "world");
    490     testWithFormatAndArguments("hello 17890.50 world", "%s %.2f %s", "hello", 17890.5f, "world");
    491 
    492     testWithFormatAndArguments("hello -17890 world", "%s %.0f %s", "hello", -17890.0f, "world");
    493     testWithFormatAndArguments("hello -17890.5 world", "%s %.1f %s", "hello", -17890.5f, "world");
    494 
    495     testWithFormatAndArguments("hello 17890 world", "%s %.0f %s", "hello", 17890.0, "world");
    496     testWithFormatAndArguments("hello 17890.5 world", "%s %.1f %s", "hello", 17890.5, "world");
    497 
    498     testWithFormatAndArguments("hello -17890 world", "%s %.0f %s", "hello", -17890.0, "world");
    499     testWithFormatAndArguments("hello -17890.5 world", "%s %.1f %s", "hello", -17890.5, "world");
    500 }
    501 
    502463TEST(WTF, StringSplitWithConsecutiveSeparators)
    503464{
Note: See TracChangeset for help on using the changeset viewer.