diff options
| author | Ethan Werner <mail@ethanwerner.com> | 2026-08-09 15:02:21 +0400 |
|---|---|---|
| committer | Ethan Werner <mail@ethanwerner.com> | 2026-08-09 15:02:21 +0400 |
| commit | 3d92926a902017e7cf1f5738e99ff62da596ce12 (patch) | |
| tree | 2b55422c26a48759d56fa91f06df24449e9dfa88 /test/hurst_exponent.c | |
| parent | 07e18043145f3d91c8ea7ec3ad41b3c905585277 (diff) | |
Diffstat (limited to 'test/hurst_exponent.c')
| -rw-r--r-- | test/hurst_exponent.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/hurst_exponent.c b/test/hurst_exponent.c index ccf54c8..a200de9 100644 --- a/test/hurst_exponent.c +++ b/test/hurst_exponent.c @@ -1,3 +1,4 @@ +#include <math.h> #include <stddef.h> #include "ts.h" @@ -6,6 +7,17 @@ bool ts_test_hurst_exponent( void ) uint_t const c[] = { 5 }; fp_t const x0[] = { 1,2,3,4,5,6,7,8,9,10 }; fp_t e0[10]; - ts_hurst_exponent((fp_t*[]){e0}, 1, (fp_t const *[]){x0}, 1, 10, (ts_constant_t *)&c); + int ret = ts_hurst_exponent((fp_t*[]){e0}, 1, (fp_t const *[]){x0}, 1, 10, (ts_constant_t *)&c); + if ( ret != 0 ) + return false; + + /* Verify output is finite (no NaN/Inf for valid input) */ + for ( uint_t i = 0; i < 10; ++i ) + { + fp_t v = e0[i]; + if ( v != v ) return false; + if ( v == (fp_t)INFINITY || v == (fp_t)-INFINITY ) return false; + } + return true; } |