MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / test

Function test

code/mathematics/miller_rabin.test.cpp:3–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "../code/mathematics/is_prime.cpp"
2
3void test() {
4 for (int i = 0; i < 10000; i++) {
5 bool a = is_probable_prime(i, 10),
6 b = is_prime(i);
7
8 assert_equal(b, a);
9 }
10
11 for (int i = 0; i < 10000; i++) {
12 int x = rng() % 100000000;
13 bool a = is_probable_prime(x, 10),
14 b = is_prime(x);
15
16 assert_equal(b, a);
17 }
18}
19
20// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls 3

is_probable_primeFunction · 0.85
is_primeFunction · 0.85
assert_equalFunction · 0.50

Tested by

no test coverage detected