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

Side by Side Diff: base/memory/scoped_ptr_unittest.cc

Issue 1559603002: Remove Pass() on Android. (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
« no previous file with comments | « no previous file | base/move.h » ('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 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 // Test moving with assignment; 396 // Test moving with assignment;
397 scoped_ptr<ConDecLogger> scoper3; 397 scoped_ptr<ConDecLogger> scoper3;
398 scoper3 = std::move(scoper2); 398 scoper3 = std::move(scoper2);
399 EXPECT_EQ(1, constructed); 399 EXPECT_EQ(1, constructed);
400 EXPECT_FALSE(scoper.get()); 400 EXPECT_FALSE(scoper.get());
401 EXPECT_FALSE(scoper2.get()); 401 EXPECT_FALSE(scoper2.get());
402 EXPECT_TRUE(scoper3.get()); 402 EXPECT_TRUE(scoper3.get());
403 } 403 }
404 404
405 #if !(defined(OS_LINUX) && !defined(OS_CHROMEOS)) 405 #if !(defined(OS_ANDROID) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)))
dcheng 2015/12/30 22:10:47 I'll simplify this conditional once I get CrOS con
406 // Test uncaught Pass() does not have side effects, because Pass() 406 // Test uncaught Pass() does not have side effects, because Pass()
407 // is implemented by std::move(). 407 // is implemented by std::move().
408 // TODO(danakj): Remove this test case when we remove Pass(). 408 // TODO(danakj): Remove this test case when we remove Pass().
409 { 409 {
410 ConDecLogger* logger = new ConDecLogger(&constructed); 410 ConDecLogger* logger = new ConDecLogger(&constructed);
411 scoped_ptr<ConDecLogger> scoper(logger); 411 scoped_ptr<ConDecLogger> scoper(logger);
412 EXPECT_EQ(1, constructed); 412 EXPECT_EQ(1, constructed);
413 413
414 // Should auto-destruct logger by end of scope. 414 // Should auto-destruct logger by end of scope.
415 scoped_ptr<ConDecLogger>&& rvalue = scoper.Pass(); 415 scoped_ptr<ConDecLogger>&& rvalue = scoper.Pass();
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 EXPECT_FALSE(p < nullptr); 833 EXPECT_FALSE(p < nullptr);
834 EXPECT_TRUE(nullptr < p); 834 EXPECT_TRUE(nullptr < p);
835 EXPECT_FALSE(pnull < nullptr); 835 EXPECT_FALSE(pnull < nullptr);
836 EXPECT_FALSE(nullptr < pnull); 836 EXPECT_FALSE(nullptr < pnull);
837 837
838 EXPECT_FALSE(p <= nullptr); 838 EXPECT_FALSE(p <= nullptr);
839 EXPECT_TRUE(nullptr <= p); 839 EXPECT_TRUE(nullptr <= p);
840 EXPECT_TRUE(pnull <= nullptr); 840 EXPECT_TRUE(pnull <= nullptr);
841 EXPECT_TRUE(nullptr <= pnull); 841 EXPECT_TRUE(nullptr <= pnull);
842 } 842 }
OLDNEW
« no previous file with comments | « no previous file | base/move.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698