summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/math/longestIncreasingSubsequence.cpp9
-rw-r--r--test/string/trie.cpp3
2 files changed, 7 insertions, 5 deletions
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<int> naive(const vector<ll>& 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<int>(1, 12);
auto a = Random::integers<ll>(n, -10, 10);
auto expected = naive<true>(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<int>(1, 12);
auto a = Random::integers<ll>(n, -10, 10);
auto expected = naive<false>(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++) {
{