RetainPtr API test should use CFArray instead of CFString for testing.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 07:38:53 +0000 (07:38 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 07:38:53 +0000 (07:38 +0000)
<rdar://problem/16384899>

Unreviewed bot fix.

* TestWebKitAPI/Tests/WTF/cf/RetainPtr.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166050 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/cf/RetainPtr.cpp
Tools/TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp

index 21f95ae..42d6787 100644 (file)
@@ -1,3 +1,15 @@
+2014-03-21  Andreas Kling  <akling@apple.com>
+
+        RetainPtr API test should use CFArray instead of CFString for testing.
+        <rdar://problem/16384899>
+
+        Unreviewed bot fix.
+
+        * TestWebKitAPI/Tests/WTF/cf/RetainPtr.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp:
+        (TestWebKitAPI::TEST):
+
 2014-03-20  Hyowon Kim  <hw1008.kim@samsung.com>
 
         Move to using std::unique_ptr for EFL objects.
index f176adc..0033f3b 100644 (file)
@@ -34,7 +34,7 @@ namespace TestWebKitAPI {
 
 TEST(RetainPtr, AdoptCF)
 {
-    RetainPtr<CFStringRef> foo = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+    RetainPtr<CFArrayRef> foo = adoptCF(CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr));
 
     EXPECT_EQ(1, CFGetRetainCount(foo.get()));
 }
index 6ac700d..ad9d893 100644 (file)
@@ -36,15 +36,15 @@ namespace TestWebKitAPI {
 
 TEST(RetainPtrHashing, HashSet)
 {
-    HashSet<RetainPtr<CFStringRef> > set;
+    HashSet<RetainPtr<CFArrayRef>> set;
 
-    RetainPtr<CFStringRef> foo = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+    RetainPtr<CFArrayRef> foo = adoptCF(CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr));
 
     EXPECT_FALSE(set.contains(foo));
     set.add(foo);
     EXPECT_TRUE(set.contains(foo));
 
-    RetainPtr<CFStringRef> foo2 = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+    RetainPtr<CFArrayRef> foo2 = adoptCF(CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr));
     EXPECT_FALSE(set.contains(foo2));
     set.add(foo2);
     EXPECT_TRUE(set.contains(foo2));
@@ -55,15 +55,15 @@ TEST(RetainPtrHashing, HashSet)
 
 TEST(RetainPtrHashing, HashMapKey)
 {
-    HashMap<RetainPtr<CFStringRef>, int> map;
+    HashMap<RetainPtr<CFArrayRef>, int> map;
 
-    RetainPtr<CFStringRef> foo = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+    RetainPtr<CFArrayRef> foo = adoptCF(CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr));
 
     EXPECT_FALSE(map.contains(foo));
     map.add(foo, 1);
     EXPECT_EQ(1, map.get(foo));
 
-    RetainPtr<CFStringRef> foo2 = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+    RetainPtr<CFArrayRef> foo2 = adoptCF(CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr));
     EXPECT_FALSE(map.contains(foo2));
     map.add(foo2, 2);
     EXPECT_EQ(2, map.get(foo2));
@@ -74,15 +74,15 @@ TEST(RetainPtrHashing, HashMapKey)
 
 TEST(RetainPtrHashing, HashMapValue)
 {
-    HashMap<int, RetainPtr<CFStringRef> > map;
+    HashMap<int, RetainPtr<CFArrayRef>> map;
 
-    RetainPtr<CFStringRef> foo = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+    RetainPtr<CFArrayRef> foo = adoptCF(CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr));
 
     EXPECT_FALSE(map.contains(1));
     map.add(1, foo);
     EXPECT_EQ(foo, map.get(1));
 
-    RetainPtr<CFStringRef> foo2 = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, "foo", kCFStringEncodingUTF8));
+    RetainPtr<CFArrayRef> foo2 = adoptCF(CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr));
     EXPECT_FALSE(map.contains(2));
     map.add(2, foo2);
     EXPECT_EQ(foo2, map.get(2));