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

Side by Side Diff: rlz/lib/string_utils_unittest.cc

Issue 1547683004: Switch to standard integer types in rlz/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « rlz/lib/rlz_value_store.h ('k') | rlz/mac/lib/machine_id_mac.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 // Unit test for string manipulation functions used in the RLZ library. 5 // Unit test for string manipulation functions used in the RLZ library.
6 6
7 #include "rlz/lib/string_utils.h" 7 #include "rlz/lib/string_utils.h"
8 8
9 #include "base/basictypes.h" 9 #include <stddef.h>
10
10 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/macros.h"
11 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
12 #include "rlz/lib/assert.h" 14 #include "rlz/lib/assert.h"
13 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
15 17
16 TEST(StringUtilsUnittest, IsAscii) { 18 TEST(StringUtilsUnittest, IsAscii) {
17 rlz_lib::SetExpectedAssertion(""); 19 rlz_lib::SetExpectedAssertion("");
18 20
19 char bad_letters[] = {'\x80', '\xA0', '\xFF'}; 21 char bad_letters[] = {'\x80', '\xA0', '\xFF'};
20 for (size_t i = 0; i < arraysize(bad_letters); ++i) 22 for (size_t i = 0; i < arraysize(bad_letters); ++i)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 62
61 EXPECT_FALSE(rlz_lib::BytesToString(NULL, 5, &result)); 63 EXPECT_FALSE(rlz_lib::BytesToString(NULL, 5, &result));
62 EXPECT_FALSE(rlz_lib::BytesToString(data, 5, NULL)); 64 EXPECT_FALSE(rlz_lib::BytesToString(data, 5, NULL));
63 EXPECT_FALSE(rlz_lib::BytesToString(NULL, 5, NULL)); 65 EXPECT_FALSE(rlz_lib::BytesToString(NULL, 5, NULL));
64 66
65 EXPECT_TRUE(rlz_lib::BytesToString(data, 5, &result)); 67 EXPECT_TRUE(rlz_lib::BytesToString(data, 5, &result));
66 EXPECT_EQ(std::string("1E002167FF"), result); 68 EXPECT_EQ(std::string("1E002167FF"), result);
67 EXPECT_TRUE(rlz_lib::BytesToString(data, 4, &result)); 69 EXPECT_TRUE(rlz_lib::BytesToString(data, 4, &result));
68 EXPECT_EQ(std::string("1E002167"), result); 70 EXPECT_EQ(std::string("1E002167"), result);
69 } 71 }
OLDNEW
« no previous file with comments | « rlz/lib/rlz_value_store.h ('k') | rlz/mac/lib/machine_id_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698