summaryrefslogtreecommitdiffstats
path: root/test/qstick.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/qstick.c')
-rw-r--r--test/qstick.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/qstick.c b/test/qstick.c
new file mode 100644
index 0000000..daa13d2
--- /dev/null
+++ b/test/qstick.c
@@ -0,0 +1,24 @@
+#include <math.h>
+#include <stddef.h>
+#include "ts.h"
+
+bool ts_test_qstick( void )
+{
+ fp_t const x0[] = { 10, 10, 10, 20, 20, 30 };
+ fp_t const x1[] = { 12, 13, 12, 22, 23, 33 };
+ fp_t const x2[] = { 9, 9, 10, 19, 20, 29 };
+ fp_t const x3[] = { 11, 12, 11, 21, 22, 31 };
+
+ fp_t const * const x[] = { x0, x1, x2, x3 };
+
+ uint_t k = 3;
+ fp_t e[4];
+ e[0] = ((11 - 10) + (12 - 10) + (11 - 10)) / 3.0;
+ e[1] = e[0] + ((21 - 20) - (11 - 10)) / 3.0;
+ e[2] = e[1] + ((22 - 20) - (12 - 10)) / 3.0;
+ e[3] = e[2] + ((31 - 30) - (11 - 10)) / 3.0;
+
+ fp_t const * const exp[1] = { e };
+
+ return ts_test(ts_qstick, ts_qstick_offset, x, exp, sizeof( x0 ) / sizeof( *x0 ), (ts_constant_t *)&k, &ts_qstick_p);
+}