summaryrefslogtreecommitdiff
path: root/test/graph/floydWarshall.cpp
diff options
context:
space:
mode:
authormzuenni <michi.zuendorf@gmail.com>2025-07-10 17:40:18 +0200
committermzuenni <michi.zuendorf@gmail.com>2025-07-10 17:40:18 +0200
commit630a5bdf06d59b8340fb4bfc0e692cbcf094026a (patch)
treeadee732c8d2cdcb46e5f400611c370b4c2ec1947 /test/graph/floydWarshall.cpp
parent609d5a3bf490cfa151b40e60cb62c8ff751bbe56 (diff)
run with sanitizer
Diffstat (limited to 'test/graph/floydWarshall.cpp')
-rw-r--r--test/graph/floydWarshall.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/graph/floydWarshall.cpp b/test/graph/floydWarshall.cpp
index a93a9ea..5926449 100644
--- a/test/graph/floydWarshall.cpp
+++ b/test/graph/floydWarshall.cpp
@@ -9,9 +9,9 @@ namespace floydWarshall {
#include <graph/floydWarshall.cpp>
}
-void stress_test() {
+void stress_test(int LIM) {
ll queries = 0;
- for (int tries = 0; tries < 100'000; tries++) {
+ for (int tries = 0; tries < LIM; tries++) {
int n = Random::integer<int>(2, 30);
int m = Random::integer<int>(n-1, max<int>(n, min<int>(500, n*(n-1) / 2 + 1)));
vector<ll> potential = Random::integers<ll>(n, 0, 1'000'000'000'000ll);
@@ -85,6 +85,7 @@ void performance_test() {
}
int main() {
- stress_test();
- performance_test();
+ stress_test(10'000);
+ if (!sanitize) stress_test(100'000);
+ if (!sanitize) performance_test();
}