Skip to content

Commit 9c5d0ea

Browse files
committed
Revert "Revert "Move more tests to globalMemCounter and reset.""
Test regressions not included this time :) This reverts commit 1ed671082ef4b13d44e2c0f42ddedf9d450258a7.
1 parent aca7167 commit 9c5d0ea

File tree

19 files changed

+19
-0
lines changed

19 files changed

+19
-0
lines changed

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct A
3636

3737
int main(int, char**)
3838
{
39+
new_handler_called = 0;
3940
std::set_new_handler(my_new_handler);
4041
#ifndef TEST_HAS_NO_EXCEPTIONS
4142
try

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct A
4545

4646
int main(int, char**)
4747
{
48+
new_called = 0;
4849
A *ap = new (std::nothrow) A[3];
4950
DoNotOptimize(ap);
5051
assert(ap);

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ struct A
4646

4747
int main(int, char**)
4848
{
49+
new_called = 0;
4950
A *ap = new A[3];
5051
DoNotOptimize(ap);
5152
assert(ap);

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct A
4545

4646
int main(int, char**)
4747
{
48+
new_called = 0;
4849
A *ap = new (std::nothrow) A;
4950
DoNotOptimize(ap);
5051
assert(ap);

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct A
4444

4545
int main(int, char**)
4646
{
47+
new_called = 0;
4748
A *ap = new A;
4849
DoNotOptimize(ap);
4950
assert(ap);

libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
int main(int, char**)
3030
{
31+
globalMemCounter.reset();
3132
assert(globalMemCounter.checkOutstandingNewEq(0));
3233
{
3334
typedef std::codecvt_utf16<wchar_t> C;

libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
int main(int, char**)
3030
{
31+
globalMemCounter.reset();
3132
assert(globalMemCounter.checkOutstandingNewEq(0));
3233
{
3334
typedef std::codecvt_utf8<wchar_t> C;

libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
int main(int, char**)
2525
{
26+
globalMemCounter.reset();
2627
typedef std::wbuffer_convert<std::codecvt_utf8<wchar_t> > B;
2728
#if TEST_STD_VER > 11
2829
static_assert(!std::is_convertible<std::streambuf*, B>::value, "");

libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ std::locale::id my_facet::id;
6666
int main(int, char**)
6767
{
6868
{
69+
globalMemCounter.reset();
6970
{
7071
std::locale loc;
7172
std::locale loc2(loc, new my_facet);

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ int h(int) {return 1;}
5959

6060
int main(int, char**)
6161
{
62+
globalMemCounter.reset();
6263
assert(globalMemCounter.checkOutstandingNewEq(0));
6364
{
6465
std::function<int(int)> f1 = A(1);

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ struct LValueCallable {
6262

6363
int main(int, char**)
6464
{
65+
globalMemCounter.reset();
6566
assert(globalMemCounter.checkOutstandingNewEq(0));
6667
{
6768
std::function<int(int)> f = A();

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct LValueCallable {
6565

6666
int main(int, char**)
6767
{
68+
globalMemCounter.reset();
6869
assert(globalMemCounter.checkOutstandingNewEq(0));
6970
{
7071
std::function<int(int)> f;

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ int g2(int, int) { return 2; }
4949
int g3(int, int, int) { return 3; }
5050

5151
int main(int, char**) {
52+
globalMemCounter.reset();
5253
assert(globalMemCounter.checkOutstandingNewEq(0));
5354
{
5455
std::function<int(int)> f = A();

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ int g(int) {return 0;}
5252

5353
int main(int, char**)
5454
{
55+
globalMemCounter.reset();
5556
assert(globalMemCounter.checkOutstandingNewEq(0));
5657
{
5758
std::function<int(int)> f = A();

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ int g(int) {return 0;}
5050

5151
int main(int, char**)
5252
{
53+
globalMemCounter.reset();
5354
assert(globalMemCounter.checkOutstandingNewEq(0));
5455
{
5556
std::function<int(int)> f = A();

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ int g2(int, int) { return 2; }
6060
int g3(int, int, int) { return 3; }
6161

6262
int main(int, char**) {
63+
globalMemCounter.reset();
6364
assert(globalMemCounter.checkOutstandingNewEq(0));
6465
{
6566
std::function<int(int)> f1 = A(1);

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ struct PrivateBase : private std::enable_shared_from_this<PrivateBase> {
5454

5555
int main(int, char**)
5656
{
57+
globalMemCounter.reset();
5758
{ // https://bugs.llvm.org/show_bug.cgi?id=18843
5859
std::shared_ptr<T const> t1(new T);
5960
std::shared_ptr<T const> t2(std::make_shared<T>());

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ int A::count = 0;
3737

3838
int main(int, char**)
3939
{
40+
globalMemCounter.reset();
4041
A* ptr = new A;
4142
globalMemCounter.throw_after = 0;
4243
try

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ int A::count = 0;
3737

3838
int main(int, char**)
3939
{
40+
globalMemCounter.reset();
4041
A* ptr = new A;
4142
assert(A::count == 1);
4243
globalMemCounter.throw_after = 0;

0 commit comments

Comments
 (0)