MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / require_close

Function require_close

tests/unittests/test_diffusion_math.cpp:11–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace {
10
11void require_close(float actual, float expected, float tolerance, const char * label) {
12 if (std::fabs(actual - expected) > tolerance) {
13 throw std::runtime_error(
14 std::string(label) + " mismatch: expected " + std::to_string(expected) +
15 ", got " + std::to_string(actual));
16 }
17}
18
19void require_vector_close(
20 const std::vector<float> & actual,

Callers 1

require_vector_closeFunction · 0.70

Calls 2

stringFunction · 0.50
to_stringFunction · 0.50

Tested by

no test coverage detected