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

Side by Side Diff: tools/clang/rewrite_scoped_ptr_ctor_null/tests/test-original.cc

Issue 448693003: Fix bitrot in Chrome clang tool infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/memory/scoped_ptr.h"
6
7 void TestDeclarations() {
8 scoped_ptr<int> a(NULL), b(new int), c(NULL);
9 scoped_ptr_malloc<int> d(NULL);
10 }
11
12 void TestNew() {
13 scoped_ptr<int>* a = new scoped_ptr<int>(NULL),
14 *b = new scoped_ptr<int>(new int),
15 *c = new scoped_ptr<int>(NULL);
16 }
17
18 class TestInitializers {
19 public:
20 TestInitializers() : a(NULL) {}
21 TestInitializers(bool) : a(NULL), b(NULL), e(NULL) {}
22 TestInitializers(double)
23 : a(NULL), b(new int), c(), f(static_cast<int*>(malloc(sizeof(int)))) {}
24
25 private:
26 scoped_ptr<int> a;
27 scoped_ptr<int> b;
28 scoped_ptr<int> c;
29 scoped_ptr_malloc<int> d;
30 scoped_ptr_malloc<int> e;
31 scoped_ptr_malloc<int> f;
32 };
33
34 scoped_ptr<int> TestTemporaries(scoped_ptr<int> a, scoped_ptr<int> b) {
35 scoped_ptr<int> c =
36 TestTemporaries(scoped_ptr<int>(NULL), scoped_ptr<int>(new int));
37 return scoped_ptr<int>(NULL);
38 }
39
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698