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

Unified Diff: components/ntp_snippets/inner_iterator_unittest.cc

Issue 1958163002: [NTP Snippets] Refactor home-grown container API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoided auto as suggested. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ntp_snippets/inner_iterator.h ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/inner_iterator_unittest.cc
diff --git a/components/ntp_snippets/inner_iterator_unittest.cc b/components/ntp_snippets/inner_iterator_unittest.cc
deleted file mode 100644
index 6c5eb0771a26225398fde947dc1f42a6042ccaa9..0000000000000000000000000000000000000000
--- a/components/ntp_snippets/inner_iterator_unittest.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <memory>
-#include <vector>
-
-#include "components/ntp_snippets/inner_iterator.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-int ii[] = {0, 1, 2, 3, 4};
-
-class InnerIteratorTest : public testing::Test {
- protected:
- using ListType = std::vector<int*>;
-
- void SetUp() override {
- ints_.push_back(&ii[0]);
- ints_.push_back(&ii[1]);
- ints_.push_back(&ii[2]);
- ints_.push_back(&ii[3]);
- ints_.push_back(&ii[4]);
- }
-
- ListType ints_;
-};
-
-TEST_F(InnerIteratorTest, Create) {
- ntp_snippets::InnerIterator<ListType::iterator, int> x(ints_.begin());
- EXPECT_EQ(0, *x);
-}
-TEST_F(InnerIteratorTest, PreIncrement) {
- ntp_snippets::InnerIterator<ListType::iterator, int> x(ints_.begin());
- EXPECT_EQ(1, *(++x));
- EXPECT_EQ(1, *x);
-}
-TEST_F(InnerIteratorTest, PostIncrement) {
- ntp_snippets::InnerIterator<ListType::iterator, int> x(ints_.begin());
- EXPECT_EQ(0, *(x++));
- EXPECT_EQ(1, *x);
-}
-TEST_F(InnerIteratorTest, Add) {
- ntp_snippets::InnerIterator<ListType::iterator, int> x(ints_.begin());
- EXPECT_EQ(2, *(x + 2));
- EXPECT_EQ(0, *x);
-}
-TEST_F(InnerIteratorTest, Sub) {
- ntp_snippets::InnerIterator<ListType::iterator, int> x(ints_.end());
- EXPECT_EQ(2, *(x - 3));
- EXPECT_EQ(4, *(--x));
-}
-TEST_F(InnerIteratorTest, PreDecrement) {
- ntp_snippets::InnerIterator<ListType::iterator, int> x(ints_.end());
- EXPECT_EQ(4, *(--x));
- EXPECT_EQ(4, *x);
-}
-TEST_F(InnerIteratorTest, PostDecrement) {
- ntp_snippets::InnerIterator<ListType::iterator, int> x(ints_.end());
- EXPECT_EQ(4, *(--x));
- EXPECT_EQ(4, *(x--));
- EXPECT_EQ(3, *x);
-}
-TEST_F(InnerIteratorTest, Equality) {
- ntp_snippets::InnerIterator<ListType::iterator, int> x(ints_.begin());
- ntp_snippets::InnerIterator<ListType::iterator, int> y(ints_.end());
- x += 2;
- y -= 3;
- EXPECT_EQ(x, y);
-}
-
-} // namespace
« no previous file with comments | « components/ntp_snippets/inner_iterator.h ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698