From 630a5bdf06d59b8340fb4bfc0e692cbcf094026a Mon Sep 17 00:00:00 2001 From: mzuenni Date: Thu, 10 Jul 2025 17:40:18 +0200 Subject: run with sanitizer --- test/other/bitOps.cpp | 4 ++-- test/other/divideAndConquer.cpp | 2 +- test/other/fastSubsetSum.cpp | 2 +- test/other/josephus2.cpp | 2 +- test/other/josephusK.cpp | 2 +- test/other/knuth.cpp | 2 +- test/other/pbs.cpp | 4 ++-- test/other/sos.cpp | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) (limited to 'test/other') diff --git a/test/other/bitOps.cpp b/test/other/bitOps.cpp index 44f6297..707c3f0 100644 --- a/test/other/bitOps.cpp +++ b/test/other/bitOps.cpp @@ -27,7 +27,7 @@ void test_subsets() { ll naive(ll x) { vector bits; - for (ll i = 0; i < 64; i++) { + for (ll i = 0; i < 63; i++) { bits.push_back(x & 1); x >>= 1; } @@ -35,7 +35,7 @@ ll naive(ll x) { next_permutation(all(bits)); reverse(all(bits)); x = 0; - for (ll i = 0, j = 1; i < 64; i++, j <<= 1) { + for (ll i = 0, j = 1; i < 63; i++, j <<= 1) { if (bits[i] != 0) x |= j; } return x; diff --git a/test/other/divideAndConquer.cpp b/test/other/divideAndConquer.cpp index 6d1b444..3878758 100644 --- a/test/other/divideAndConquer.cpp +++ b/test/other/divideAndConquer.cpp @@ -98,6 +98,6 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/other/fastSubsetSum.cpp b/test/other/fastSubsetSum.cpp index c61b1ea..ea40184 100644 --- a/test/other/fastSubsetSum.cpp +++ b/test/other/fastSubsetSum.cpp @@ -44,6 +44,6 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/other/josephus2.cpp b/test/other/josephus2.cpp index 85a9d28..21154a1 100644 --- a/test/other/josephus2.cpp +++ b/test/other/josephus2.cpp @@ -37,6 +37,6 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/other/josephusK.cpp b/test/other/josephusK.cpp index e837640..b6680b8 100644 --- a/test/other/josephusK.cpp +++ b/test/other/josephusK.cpp @@ -38,6 +38,6 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/other/knuth.cpp b/test/other/knuth.cpp index aaf5059..3d6cb9b 100644 --- a/test/other/knuth.cpp +++ b/test/other/knuth.cpp @@ -98,6 +98,6 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/other/pbs.cpp b/test/other/pbs.cpp index ba3b9d0..4fa4470 100644 --- a/test/other/pbs.cpp +++ b/test/other/pbs.cpp @@ -93,11 +93,11 @@ void performance_test() { t.stop(); ll hash = accumulate(all(ans), 0LL); - if (t.time > 700) cerr << "too slow: " << t.time << FAIL; + if (t.time > 900) cerr << "too slow: " << t.time << FAIL; cerr << "tested performance: " << t.time << "ms (hash: " << hash << ")" << endl; } int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/other/sos.cpp b/test/other/sos.cpp index f3a6109..52b55ed 100644 --- a/test/other/sos.cpp +++ b/test/other/sos.cpp @@ -45,6 +45,6 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } -- cgit v1.2.3