default value of LIBA_CXX is set to 1
[liba.git] / test / trajbell.h
blobfcaf17bc304dff616c41be3f00c5ee0aea937ea0
1 #define MAIN(x) trajbell##x
2 #include "test.h"
3 #include "a/trajbell.h"
5 int main(int argc, char *argv[]) // NOLINT(misc-definitions-in-headers)
7 int start = 1;
8 if (argc > 1)
10 char *endptr = A_NULL;
11 (void)strtonum(argv[1], &endptr);
12 if (argv[1] == endptr)
14 main_init(argc, argv, 1);
15 ++start;
19 a_float arg[7] = {0};
20 for (int i = start; i < argc; ++i)
22 arg[i - start] = strtonum(argv[i], A_NULL);
24 a_trajbell ctx;
25 a_float t = a_trajbell_gen(&ctx, arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6]);
26 for (a_float x = 0, delta = t / 1000; x < t; x += delta) // NOLINT
28 debug(A_FLOAT_PRI("+", "f,") A_FLOAT_PRI("+", "f,") A_FLOAT_PRI("+", "f,") A_FLOAT_PRI("+", "f,") A_FLOAT_PRI("+", "f\n"),
29 x, a_trajbell_pos(&ctx, x), a_trajbell_vel(&ctx, x), a_trajbell_acc(&ctx, x), a_trajbell_jer(&ctx, x));
32 #if defined(__cplusplus) && (__cplusplus > 201100L)
33 A_ASSERT_BUILD(std::is_pod<a_trajbell>::value);
34 #endif /* __cplusplus */
36 return 0;