2 var liba = require("../liba");
3 function assert(expr, info) {
5 throw Error("assertion failed: " + info);
8 function do_leak_check() {
9 for (const arg of arguments) {
12 if (liba.do_leak_check) {
16 var ctx = new liba.trajtrap();
17 ctx.gen(2, 2, -2, 0, 4, 0, 0);
18 assert(ctx.t != undefined);
19 assert(ctx.p0 != undefined);
20 assert(ctx.p1 != undefined);
21 assert(ctx.v0 != undefined);
22 assert(ctx.v1 != undefined);
23 assert(ctx.vc != undefined);
24 assert(ctx.ta != undefined);
25 assert(ctx.td != undefined);
26 assert(ctx.pa != undefined);
27 assert(ctx.pd != undefined);
28 assert(ctx.ac != undefined);
29 assert(ctx.de != undefined);
30 for (var i = 0; i < ctx.t; i += ctx.t / 10) {
31 console.log(i, ctx.pos(i), ctx.vel(i), ctx.acc(i));