From 3d92926a902017e7cf1f5738e99ff62da596ce12 Mon Sep 17 00:00:00 2001 From: Ethan Werner Date: Sun, 9 Aug 2026 15:02:21 +0400 Subject: refactor --- test/hurst_exponent.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test/hurst_exponent.c') 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 #include #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; } -- cgit v1.3.1