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

Side by Side Diff: tools/clang/empty_string/tests/test-original.cc

Issue 12746010: Implement clang tool that converts std::string("") to std::string(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove debugging print and add comment. Created 7 years, 8 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
OLDNEW
(Empty)
1 // Test file for the empty string clang tool.
2
3 #include <string>
4
5 // Tests for std::string declarations.
6 void TestDeclarations() { std::string a(""), b("abc"), c(""); }
7
8 // Tests for std::string allocated with new.
9 void TestNew() {
10 std::string* a = new std::string(""),
11 *b = new std::string("abc"),
12 *c = new std::string(""),
13 *d = new std::string();
14 }
15
16 // Tests for std::string construction in initializer lists.
17 class TestInitializers {
18 public:
19 TestInitializers() : a("") {}
20 TestInitializers(bool) : a(""), b("") {}
21 TestInitializers(double) : a(""), b("cat"), c() {}
22
23 private:
24 std::string a;
25 std::string b;
26 std::string c;
27 };
28
29 // Tests for temporary std::strings.
30 void TestTemporaries(const std::string& reference_argument,
31 const std::string value_argument) {
32 TestTemporaries("", "");
33 TestTemporaries(std::string(""), std::string(""));
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698