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/math/longestIncreasingSubsequence.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/math/longestIncreasingSubsequence.cpp') diff --git a/test/math/longestIncreasingSubsequence.cpp b/test/math/longestIncreasingSubsequence.cpp index 407dafe..0ed0f91 100644 --- a/test/math/longestIncreasingSubsequence.cpp +++ b/test/math/longestIncreasingSubsequence.cpp @@ -72,5 +72,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } -- cgit v1.2.3 From d4fbbdd85e2133361c72035a131940705a768d30 Mon Sep 17 00:00:00 2001 From: mzuenni Date: Thu, 10 Jul 2025 18:07:20 +0200 Subject: try to fix tests --- test/math/longestIncreasingSubsequence.cpp | 9 +++++---- test/string/trie.cpp | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'test/math/longestIncreasingSubsequence.cpp') diff --git a/test/math/longestIncreasingSubsequence.cpp b/test/math/longestIncreasingSubsequence.cpp index 0ed0f91..d08cf57 100644 --- a/test/math/longestIncreasingSubsequence.cpp +++ b/test/math/longestIncreasingSubsequence.cpp @@ -30,9 +30,9 @@ vector naive(const vector& a) { return res; } -void stress_test() { +void stress_test(ll LIM) { ll queries = 0; - for (ll i = 0; i < 10'000; i++) { + for (ll i = 0; i < LIM; i++) { int n = Random::integer(1, 12); auto a = Random::integers(n, -10, 10); auto expected = naive(a); @@ -40,7 +40,7 @@ void stress_test() { if (got != expected) cerr << "error: strict" << FAIL; queries += n; } - for (ll i = 0; i < 10'000; i++) { + for (ll i = 0; i < LIM; i++) { int n = Random::integer(1, 12); auto a = Random::integers(n, -10, 10); auto expected = naive(a); @@ -71,6 +71,7 @@ void performance_test() { } int main() { - stress_test(); + stress_test(1'000); + if (!sanitize) stress_test(10'000); if (!sanitize) performance_test(); } diff --git a/test/string/trie.cpp b/test/string/trie.cpp index 1ea5b1a..ea4a774 100644 --- a/test/string/trie.cpp +++ b/test/string/trie.cpp @@ -30,7 +30,8 @@ void stress_test() { constexpr int N = 10'000; void performance_test() { timer t; - trie = {node()}; + trie.clear(); + trie.emplace_back(); hash_t hash = 0; for (int tries = 0; tries < N; tries++) { { -- cgit v1.2.3