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

Side by Side Diff: ui/gfx/range/range_unittest.cc

Issue 1948283002: Fix gfx::Range::ToString() to use the correct format specifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add sstream header. Created 4 years, 7 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
« no previous file with comments | « ui/gfx/range/range.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <sstream>
6
5 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/gfx/range/range.h" 8 #include "ui/gfx/range/range.h"
7 #include "ui/gfx/range/range_f.h" 9 #include "ui/gfx/range/range_f.h"
8 10
9 namespace { 11 namespace {
10 12
11 template <typename T> 13 template <typename T>
12 class RangeTest : public testing::Test { 14 class RangeTest : public testing::Test {
13 }; 15 };
14 16
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 EXPECT_EQ(0U, range.end()); 247 EXPECT_EQ(0U, range.end());
246 248
247 range = range_f.Ceil(); 249 range = range_f.Ceil();
248 EXPECT_EQ(0U, range.start()); 250 EXPECT_EQ(0U, range.start());
249 EXPECT_EQ(0U, range.end()); 251 EXPECT_EQ(0U, range.end());
250 252
251 range = range_f.Round(); 253 range = range_f.Round();
252 EXPECT_EQ(0U, range.start()); 254 EXPECT_EQ(0U, range.start());
253 EXPECT_EQ(0U, range.end()); 255 EXPECT_EQ(0U, range.end());
254 } 256 }
257
258 TEST(RangeTest, ToString) {
259 gfx::Range range(4, 7);
260 EXPECT_EQ("{4,7}", range.ToString());
261
262 range = gfx::Range::InvalidRange();
263 std::ostringstream expected;
264 expected << "{" << range.start() << "," << range.end() << "}";
265 EXPECT_EQ(expected.str(), range.ToString());
266 }
OLDNEW
« no previous file with comments | « ui/gfx/range/range.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698