Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: Source/wtf/text/StringOperatorsTest.cpp

Issue 1184043002: Fix unit test style in Source/wtf/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: apply review comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/wtf/text/StringImplTest.cpp ('k') | Source/wtf/text/WTFStringTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 14 matching lines...) Expand all
25 25
26 #include "config.h" 26 #include "config.h"
27 27
28 #define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() (++wtfStringCopyCount) 28 #define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() (++wtfStringCopyCount)
29 29
30 static int wtfStringCopyCount; 30 static int wtfStringCopyCount;
31 31
32 #include "wtf/text/WTFString.h" 32 #include "wtf/text/WTFString.h"
33 #include <gtest/gtest.h> 33 #include <gtest/gtest.h>
34 34
35 namespace { 35 namespace WTF {
36 36
37 #define EXPECT_N_WTF_STRING_COPIES(count, expr) \ 37 #define EXPECT_N_WTF_STRING_COPIES(count, expr) \
38 do { \ 38 do { \
39 wtfStringCopyCount = 0; \ 39 wtfStringCopyCount = 0; \
40 String __testString = expr; \ 40 String __testString = expr; \
41 (void)__testString; \ 41 (void)__testString; \
42 EXPECT_EQ(count, wtfStringCopyCount) << #expr; \ 42 EXPECT_EQ(count, wtfStringCopyCount) << #expr; \
43 } while (false) 43 } while (false)
44 44
45 TEST(WTF, DISABLED_StringOperators) 45 TEST(StringOperatorsTest, DISABLED_StringOperators)
46 { 46 {
47 String string("String"); 47 String string("String");
48 AtomicString atomicString("AtomicString"); 48 AtomicString atomicString("AtomicString");
49 const char* literal = "ASCIILiteral"; 49 const char* literal = "ASCIILiteral";
50 50
51 EXPECT_EQ(0, wtfStringCopyCount); 51 EXPECT_EQ(0, wtfStringCopyCount);
52 52
53 EXPECT_N_WTF_STRING_COPIES(2, string + string); 53 EXPECT_N_WTF_STRING_COPIES(2, string + string);
54 EXPECT_N_WTF_STRING_COPIES(2, string + atomicString); 54 EXPECT_N_WTF_STRING_COPIES(2, string + atomicString);
55 EXPECT_N_WTF_STRING_COPIES(2, atomicString + string); 55 EXPECT_N_WTF_STRING_COPIES(2, atomicString + string);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + atomicString + L"wide string" + string); 179 EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + atomicString + L"wide string" + string);
180 EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + (atomicString + L"wide string " + string)); 180 EXPECT_N_WTF_STRING_COPIES(2, L"wide string" + (atomicString + L"wide string " + string));
181 EXPECT_N_WTF_STRING_COPIES(2, (L"wide string" + atomicString) + (L"wide stri ng" + string)); 181 EXPECT_N_WTF_STRING_COPIES(2, (L"wide string" + atomicString) + (L"wide stri ng" + string));
182 EXPECT_N_WTF_STRING_COPIES(2, atomicString + L"wide string" + string + L"wid e string"); 182 EXPECT_N_WTF_STRING_COPIES(2, atomicString + L"wide string" + string + L"wid e string");
183 EXPECT_N_WTF_STRING_COPIES(2, atomicString + (L"wide string" + string + L"wi de string")); 183 EXPECT_N_WTF_STRING_COPIES(2, atomicString + (L"wide string" + string + L"wi de string"));
184 EXPECT_N_WTF_STRING_COPIES(2, (atomicString + L"wide string") + (string + L" wide string")); 184 EXPECT_N_WTF_STRING_COPIES(2, (atomicString + L"wide string") + (string + L" wide string"));
185 #endif 185 #endif
186 } 186 }
187 187
188 } // namespace 188 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/text/StringImplTest.cpp ('k') | Source/wtf/text/WTFStringTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698