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

Side by Side Diff: dbus/string_util_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 | « dbus/message_unittest.cc ('k') | dbus/values_util.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 "dbus/string_util.h" 5 #include "dbus/string_util.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 TEST(StringUtilTest, IsValidObjectPath) { 8 TEST(StringUtilTest, IsValidObjectPath) {
9 EXPECT_TRUE(dbus::IsValidObjectPath("/")); 9 EXPECT_TRUE(dbus::IsValidObjectPath("/"));
10 EXPECT_TRUE(dbus::IsValidObjectPath("/foo/bar")); 10 EXPECT_TRUE(dbus::IsValidObjectPath("/foo/bar"));
11 EXPECT_TRUE(dbus::IsValidObjectPath("/hoge_fuga/piyo123")); 11 EXPECT_TRUE(dbus::IsValidObjectPath("/hoge_fuga/piyo123"));
12 // Empty string. 12 // Empty string.
13 EXPECT_FALSE(dbus::IsValidObjectPath("")); 13 EXPECT_FALSE(dbus::IsValidObjectPath(std::string()));
14 // Emptyr elemnt. 14 // Emptyr elemnt.
15 EXPECT_FALSE(dbus::IsValidObjectPath("//")); 15 EXPECT_FALSE(dbus::IsValidObjectPath("//"));
16 EXPECT_FALSE(dbus::IsValidObjectPath("/foo//bar")); 16 EXPECT_FALSE(dbus::IsValidObjectPath("/foo//bar"));
17 EXPECT_FALSE(dbus::IsValidObjectPath("/foo///bar")); 17 EXPECT_FALSE(dbus::IsValidObjectPath("/foo///bar"));
18 // Trailing '/'. 18 // Trailing '/'.
19 EXPECT_FALSE(dbus::IsValidObjectPath("/foo/")); 19 EXPECT_FALSE(dbus::IsValidObjectPath("/foo/"));
20 EXPECT_FALSE(dbus::IsValidObjectPath("/foo/bar/")); 20 EXPECT_FALSE(dbus::IsValidObjectPath("/foo/bar/"));
21 // Not beginning with '/'. 21 // Not beginning with '/'.
22 EXPECT_FALSE(dbus::IsValidObjectPath("foo/bar")); 22 EXPECT_FALSE(dbus::IsValidObjectPath("foo/bar"));
23 // Invalid characters. 23 // Invalid characters.
24 EXPECT_FALSE(dbus::IsValidObjectPath("/foo.bar")); 24 EXPECT_FALSE(dbus::IsValidObjectPath("/foo.bar"));
25 EXPECT_FALSE(dbus::IsValidObjectPath("/foo/*")); 25 EXPECT_FALSE(dbus::IsValidObjectPath("/foo/*"));
26 EXPECT_FALSE(dbus::IsValidObjectPath("/foo/bar(1)")); 26 EXPECT_FALSE(dbus::IsValidObjectPath("/foo/bar(1)"));
27 } 27 }
OLDNEW
« no previous file with comments | « dbus/message_unittest.cc ('k') | dbus/values_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698