summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/math/linearCongruence.cpp4
-rw-r--r--test/string/suffixTree.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/test/math/linearCongruence.cpp b/test/math/linearCongruence.cpp
index fa01a06..042c842 100644
--- a/test/math/linearCongruence.cpp
+++ b/test/math/linearCongruence.cpp
@@ -14,7 +14,7 @@ void stress_test() {
ll work = 0;
ll positive = 0;
for (ll tries = 0; tries < 500'000; tries++) {
- ll m = Random::integer<ll>(0, 1'000);
+ ll m = Random::integer<ll>(1, 1'000);
ll a = Random::integer<ll>(0, m);
ll b = Random::integer<ll>(0, m);
@@ -33,7 +33,7 @@ void performance_test() {
timer t;
hash_t hash = 0;
for (int operations = 0; operations < N; operations++) {
- ll m = Random::integer<ll>(0, 1'0000'000'000);
+ ll m = Random::integer<ll>(1, 1'0000'000'000);
ll a = Random::integer<ll>(0, m);
ll b = Random::integer<ll>(0, m);
diff --git a/test/string/suffixTree.cpp b/test/string/suffixTree.cpp
index 6f3d912..fd2f5ea 100644
--- a/test/string/suffixTree.cpp
+++ b/test/string/suffixTree.cpp
@@ -19,7 +19,7 @@ void stress_test() {
auto dfs = [&](auto&& self, string pref, ll node) -> void {
auto& [l, r, _, next] = st.tree[node];
if (l >= 0) pref += s.substr(l, r - l);
- if (pref.back() == '#') got[n + 1 - ssize(pref)] = pref;
+ if (!pref.empty() && pref.back() == '#') got[n + 1 - ssize(pref)] = pref;
for (auto [__, j] : next) {
self(self, pref, j);
}