| 27 | namespace |
| 28 | { |
| 29 | void noiseTest(int trials) |
| 30 | { |
| 31 | Random::init(); |
| 32 | Noise::Generator m_noiseGen; |
| 33 | m_noiseGen.setSeed(Random::intInRange(0, 999999)); |
| 34 | m_noiseGen.setNoiseFunction({5, 500, 0.4, 5000}); |
| 35 | |
| 36 | float total = 0; |
| 37 | std::vector<double> test; |
| 38 | for (int i = 0 ; i < trials ; i++) |
| 39 | { |
| 40 | float h = m_noiseGen.getValue(i, i, i, i); |
| 41 | test.push_back(h); |
| 42 | total += h; |
| 43 | } |
| 44 | |
| 45 | std::cout << "MIN: " << *std::min_element(test.begin(), test.end()) << "\n"; |
| 46 | std::cout << "MAX: " << *std::max_element(test.begin(), test.end()) << "\n"; |
| 47 | std::cout << "AVG: " << total / trials << std::endl; |
| 48 | } |
| 49 | |
| 50 | void errorMessage(const std::string& message) |
| 51 | { |
nothing calls this directly
no test coverage detected