MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / unittest

Function unittest

libraries/Prandom/test/unit_test_001.cpp:51–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51unittest(test_constructor)
52{
53 Prandom R;
54
55 // three seed() calls are possible
56 R.seed();
57 R.seed(42);
58 R.seed(355, 113);
59
60 assertLessOrEqual(100, R.randrange(100, 200));
61 assertMoreOrEqual(200, R.randrange(100, 200));
62
63 for (int bits = 0; bits < 32; bits++)
64 {
65 fprintf(stderr, "%d\t", bits);
66 assertMoreOrEqual(pow(2, bits), R.getrandbits(bits));
67 }
68
69}
70
71
72unittest_main()

Callers

nothing calls this directly

Calls 3

randrangeMethod · 0.80
getrandbitsMethod · 0.80
seedMethod · 0.45

Tested by

no test coverage detected