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

Side by Side Diff: third_party/libaddressinput/chromium/chrome_rule_test.cc

Issue 1548233002: Switch to standard integer types in third_party/libaddressinput/chromium/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "third_party/libaddressinput/src/cpp/src/rule.h" 5 #include "third_party/libaddressinput/src/cpp/src/rule.h"
6 6
7 #include <stddef.h>
8
7 #include <string> 9 #include <string>
8 10
9 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
11 13
12 TEST(RuleTest, CanonicalizeSubKeyTest) { 14 TEST(RuleTest, CanonicalizeSubKeyTest) {
13 i18n::addressinput::Rule rule; 15 i18n::addressinput::Rule rule;
14 ASSERT_TRUE(rule.ParseSerializedRule(base::WideToUTF8( 16 ASSERT_TRUE(rule.ParseSerializedRule(base::WideToUTF8(
15 L"{ \"sub_keys\": \"FOO~BAR~B\u00C4Z~\u0415\u0416\"," 17 L"{ \"sub_keys\": \"FOO~BAR~B\u00C4Z~\u0415\u0416\","
16 L" \"sub_names\": \"Foolandia~Bartopolis~B\u00E4zmonia~" 18 L" \"sub_names\": \"Foolandia~Bartopolis~B\u00E4zmonia~"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 for (size_t i = 0; i < num_cases; ++i) { 51 for (size_t i = 0; i < num_cases; ++i) {
50 const std::string input(base::WideToUTF8(expectations[i].input)); 52 const std::string input(base::WideToUTF8(expectations[i].input));
51 const std::string expected_output(base::WideToUTF8(expectations[i].output)); 53 const std::string expected_output(base::WideToUTF8(expectations[i].output));
52 std::string output; 54 std::string output;
53 EXPECT_EQ(!expected_output.empty(), 55 EXPECT_EQ(!expected_output.empty(),
54 rule.CanonicalizeSubKey(input, true, &output)) 56 rule.CanonicalizeSubKey(input, true, &output))
55 << "Failed for input " << input; 57 << "Failed for input " << input;
56 EXPECT_EQ(expected_output, output); 58 EXPECT_EQ(expected_output, output);
57 } 59 }
58 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698