diff options
Diffstat (limited to 'test/string')
| -rw-r--r-- | test/string/ahoCorasick.cpp | 2 | ||||
| -rw-r--r-- | test/string/deBruijn.cpp | 2 | ||||
| -rw-r--r-- | test/string/duval.cpp | 4 | ||||
| -rw-r--r-- | test/string/kmp.cpp | 4 | ||||
| -rw-r--r-- | test/string/longestCommonSubsequence.cpp | 2 | ||||
| -rw-r--r-- | test/string/lyndon.cpp | 2 | ||||
| -rw-r--r-- | test/string/manacher.cpp | 2 | ||||
| -rw-r--r-- | test/string/rollingHash.cpp | 8 | ||||
| -rw-r--r-- | test/string/rollingHashCf.cpp | 8 | ||||
| -rw-r--r-- | test/string/suffixArray.cpp | 2 | ||||
| -rw-r--r-- | test/string/suffixAutomaton.cpp | 2 | ||||
| -rw-r--r-- | test/string/suffixTree.cpp | 2 | ||||
| -rw-r--r-- | test/string/trie.cpp | 5 | ||||
| -rw-r--r-- | test/string/z.cpp | 2 |
14 files changed, 24 insertions, 23 deletions
diff --git a/test/string/ahoCorasick.cpp b/test/string/ahoCorasick.cpp index c3361d6..3203855 100644 --- a/test/string/ahoCorasick.cpp +++ b/test/string/ahoCorasick.cpp @@ -72,5 +72,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/deBruijn.cpp b/test/string/deBruijn.cpp index eb82b59..6bbbad9 100644 --- a/test/string/deBruijn.cpp +++ b/test/string/deBruijn.cpp @@ -39,5 +39,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/duval.cpp b/test/string/duval.cpp index 5ebc96c..88e2fb7 100644 --- a/test/string/duval.cpp +++ b/test/string/duval.cpp @@ -79,7 +79,7 @@ void performance_test_minrotation() { int main() { stress_test_duval(); - performance_test_duval(); + if (!sanitize) performance_test_duval(); stress_test_minrotation(); - performance_test_minrotation(); + if (!sanitize) performance_test_minrotation(); } diff --git a/test/string/kmp.cpp b/test/string/kmp.cpp index 2364efd..8ebeb64 100644 --- a/test/string/kmp.cpp +++ b/test/string/kmp.cpp @@ -78,8 +78,8 @@ void performance_test_kmp() { int main() { cerr << "preprocessing:" << endl; stress_test_preprocessing(); - performance_test_preprocessing(); + if (!sanitize) performance_test_preprocessing(); cerr << "kmp:" << endl; stress_test_kmp(); - performance_test_kmp(); + if (!sanitize) performance_test_kmp(); } diff --git a/test/string/longestCommonSubsequence.cpp b/test/string/longestCommonSubsequence.cpp index 128c3c1..8c32d61 100644 --- a/test/string/longestCommonSubsequence.cpp +++ b/test/string/longestCommonSubsequence.cpp @@ -51,5 +51,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/lyndon.cpp b/test/string/lyndon.cpp index 6710973..154ba66 100644 --- a/test/string/lyndon.cpp +++ b/test/string/lyndon.cpp @@ -57,5 +57,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/manacher.cpp b/test/string/manacher.cpp index 803154b..ada0486 100644 --- a/test/string/manacher.cpp +++ b/test/string/manacher.cpp @@ -45,5 +45,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/rollingHash.cpp b/test/string/rollingHash.cpp index a9dace5..d19a153 100644 --- a/test/string/rollingHash.cpp +++ b/test/string/rollingHash.cpp @@ -37,13 +37,13 @@ void testTiny() { cerr << "tiny: ok" << endl; } -void testSmall() { +void testSmall(int depth) { set<decltype(getHash(""))> got; ll expected = 0; auto dfs = [&](auto&& self, string pref)->void { expected++; got.insert(getHash(pref)); - if(ssize(pref) >= 5) return; + if(ssize(pref) >= depth) return; for (char c = 'a'; c <= 'z'; c++) { self(self, pref + c); } @@ -86,7 +86,7 @@ void performance_test() { int main() { testThueMorse(); testTiny(); - testSmall(); + testSmall(sanitize ? 4 : 5); stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/rollingHashCf.cpp b/test/string/rollingHashCf.cpp index f7ce357..d0f90aa 100644 --- a/test/string/rollingHashCf.cpp +++ b/test/string/rollingHashCf.cpp @@ -39,13 +39,13 @@ void testTiny() { cerr << "tiny: ok" << endl; } -void testSmall() { +void testSmall(int depth) { set<decltype(getHash(""))> got; ll expected = 0; auto dfs = [&](auto&& self, string pref)->void { expected++; got.insert(getHash(pref)); - if(ssize(pref) >= 5) return; + if(ssize(pref) >= depth) return; for (char c = 'a'; c <= 'z'; c++) { self(self, pref + c); } @@ -88,7 +88,7 @@ void performance_test() { int main() { testThueMorse(); testTiny(); - testSmall(); + testSmall(sanitize ? 4 : 5); stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/suffixArray.cpp b/test/string/suffixArray.cpp index a1db190..37049f6 100644 --- a/test/string/suffixArray.cpp +++ b/test/string/suffixArray.cpp @@ -57,5 +57,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/suffixAutomaton.cpp b/test/string/suffixAutomaton.cpp index cab555e..dacbb83 100644 --- a/test/string/suffixAutomaton.cpp +++ b/test/string/suffixAutomaton.cpp @@ -58,5 +58,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/suffixTree.cpp b/test/string/suffixTree.cpp index 69c24fe..6f3d912 100644 --- a/test/string/suffixTree.cpp +++ b/test/string/suffixTree.cpp @@ -46,5 +46,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/trie.cpp b/test/string/trie.cpp index 45d89cf..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++) { { @@ -54,5 +55,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } diff --git a/test/string/z.cpp b/test/string/z.cpp index 3c76939..a11984a 100644 --- a/test/string/z.cpp +++ b/test/string/z.cpp @@ -37,5 +37,5 @@ void performance_test() { int main() { stress_test(); - performance_test(); + if (!sanitize) performance_test(); } |
