OLD | NEW |
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 "chromeos/system/name_value_pairs_parser.h" | 5 #include "chromeos/system/name_value_pairs_parser.h" |
6 | 6 |
7 #include "base/basictypes.h" | |
8 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
9 | 8 |
10 namespace chromeos { | 9 namespace chromeos { |
11 namespace system { | 10 namespace system { |
12 | 11 |
13 TEST(NameValuePairsParser, TestGetSingleValueFromTool) { | 12 TEST(NameValuePairsParser, TestGetSingleValueFromTool) { |
14 NameValuePairsParser::NameValueMap map; | 13 NameValuePairsParser::NameValueMap map; |
15 NameValuePairsParser parser(&map); | 14 NameValuePairsParser parser(&map); |
16 const char* command[] = { "/bin/echo", "Foo" }; | 15 const char* command[] = { "/bin/echo", "Foo" }; |
17 EXPECT_TRUE(parser.GetSingleValueFromTool(arraysize(command), command, | 16 EXPECT_TRUE(parser.GetSingleValueFromTool(arraysize(command), command, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 EXPECT_EQ("1", map["cros_debug"]); | 109 EXPECT_EQ("1", map["cros_debug"]); |
111 EXPECT_EQ("(error)", map["dbg_reset"]); | 110 EXPECT_EQ("(error)", map["dbg_reset"]); |
112 EXPECT_EQ("some value", map["key#with_comment"]); | 111 EXPECT_EQ("some value", map["key#with_comment"]); |
113 EXPECT_EQ("", map["key"]); | 112 EXPECT_EQ("", map["key"]); |
114 EXPECT_EQ("LFS=0,0 LF=1784220250,2971030570 LK=9064076660,9342689170", | 113 EXPECT_EQ("LFS=0,0 LF=1784220250,2971030570 LK=9064076660,9342689170", |
115 map["vdat_timers"]); | 114 map["vdat_timers"]); |
116 } | 115 } |
117 | 116 |
118 } // namespace system | 117 } // namespace system |
119 } // namespace chromeos | 118 } // namespace chromeos |
OLD | NEW |