Chromium Code Reviews| Index: tools/clang/rewrite_scoped_ptr_ctor_null/tests/test-expected.cc |
| diff --git a/tools/clang/rewrite_scoped_ptr_ctor_null/tests/test-expected.cc b/tools/clang/rewrite_scoped_ptr_ctor_null/tests/test-expected.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..16f31166a938e88242751347b6898a3139d7848a |
| --- /dev/null |
| +++ b/tools/clang/rewrite_scoped_ptr_ctor_null/tests/test-expected.cc |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2013 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 "base/memory/scoped_ptr.h" |
|
Nico
2013/06/11 19:58:13
Hm. One day, someone will move scoped_ptr to names
dcheng
2013/06/11 20:07:41
Originally, that's what I did--I just had a minima
|
| + |
| +void TestDeclarations() { |
| + scoped_ptr<int> a, b(new int), c; |
| + scoped_ptr_malloc<int> d; |
| +} |
| + |
| +void TestNew() { |
| + scoped_ptr<int>* a = new scoped_ptr<int>, *b = new scoped_ptr<int>(new int), |
| + *c = new scoped_ptr<int>; |
| +} |
| + |
| +class TestInitializers { |
| + public: |
| + TestInitializers() {} |
| + TestInitializers(bool) {} |
| + TestInitializers(double) : b(new int), c() {} |
| + |
| + private: |
| + scoped_ptr<int> a; |
| + scoped_ptr<int> b; |
| + scoped_ptr<int> c; |
| +}; |
| + |
| +scoped_ptr<int> TestTemporaries(scoped_ptr<int> a, scoped_ptr<int> b) { |
| + scoped_ptr<int> c = |
| + TestTemporaries(scoped_ptr<int>(), scoped_ptr<int>(new int)); |
| + return scoped_ptr<int>(); |
| +} |