summaryrefslogtreecommitdiffstats
path: root/test/mass_index.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/mass_index.c')
-rw-r--r--test/mass_index.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/mass_index.c b/test/mass_index.c
new file mode 100644
index 0000000..2075b59
--- /dev/null
+++ b/test/mass_index.c
@@ -0,0 +1,26 @@
+#include <math.h>
+#include <stddef.h>
+#include "ts.h"
+
+bool ts_test_mass_index( void )
+{
+ /* Use constant H-L so ratio converges to 1, sum = 26 */
+ fp_t o[30] = { 0 };
+ fp_t h[30];
+ fp_t l[30];
+ fp_t c[30] = { 0 };
+ fp_t v[30] = { 0 };
+
+ for ( uint_t i = 0; i < 30; ++i )
+ {
+ h[i] = 11;
+ l[i] = 9;
+ }
+
+ fp_t const * const x[] = { o, h, l, c, v };
+
+ fp_t const e[4] = { 26.0, 26.0, 26.0, 26.0 };
+ fp_t const * const exp[1] = { e };
+
+ return ts_test(ts_mass_index, ts_mass_index_offset, x, exp, 30, (ts_constant_t *)NULL, &ts_mass_index_p);
+}