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

Side by Side Diff: base/values_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh 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
« no previous file with comments | « base/test/trace_event_analyzer_unittest.cc ('k') | base/vlog_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits> 5 #include <limits>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 // Remove empty lists and dictionaries. 592 // Remove empty lists and dictionaries.
593 root->Set("empty_dict", new DictionaryValue); 593 root->Set("empty_dict", new DictionaryValue);
594 root->Set("empty_list", new ListValue); 594 root->Set("empty_list", new ListValue);
595 root->SetWithoutPathExpansion("a.b.c.d.e", new DictionaryValue); 595 root->SetWithoutPathExpansion("a.b.c.d.e", new DictionaryValue);
596 root.reset(root->DeepCopyWithoutEmptyChildren()); 596 root.reset(root->DeepCopyWithoutEmptyChildren());
597 EXPECT_TRUE(root->empty()); 597 EXPECT_TRUE(root->empty());
598 598
599 // Make sure we don't prune too much. 599 // Make sure we don't prune too much.
600 root->SetBoolean("bool", true); 600 root->SetBoolean("bool", true);
601 root->Set("empty_dict", new DictionaryValue); 601 root->Set("empty_dict", new DictionaryValue);
602 root->SetString("empty_string", ""); 602 root->SetString("empty_string", std::string());
603 root.reset(root->DeepCopyWithoutEmptyChildren()); 603 root.reset(root->DeepCopyWithoutEmptyChildren());
604 EXPECT_EQ(2U, root->size()); 604 EXPECT_EQ(2U, root->size());
605 605
606 // Should do nothing. 606 // Should do nothing.
607 root.reset(root->DeepCopyWithoutEmptyChildren()); 607 root.reset(root->DeepCopyWithoutEmptyChildren());
608 EXPECT_EQ(2U, root->size()); 608 EXPECT_EQ(2U, root->size());
609 609
610 // Nested test cases. These should all reduce back to the bool and string 610 // Nested test cases. These should all reduce back to the bool and string
611 // set above. 611 // set above.
612 { 612 {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 seen2 = true; 769 seen2 = true;
770 } else { 770 } else {
771 ADD_FAILURE(); 771 ADD_FAILURE();
772 } 772 }
773 } 773 }
774 EXPECT_TRUE(seen1); 774 EXPECT_TRUE(seen1);
775 EXPECT_TRUE(seen2); 775 EXPECT_TRUE(seen2);
776 } 776 }
777 777
778 } // namespace base 778 } // namespace base
OLDNEW
« no previous file with comments | « base/test/trace_event_analyzer_unittest.cc ('k') | base/vlog_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698