From e290322b1c04cbbc75c9c1f354a7081dd8dd57a3 Mon Sep 17 00:00:00 2001 From: Hleb Valoshka <375gnu@gmail.com> Date: Sat, 25 Aug 2018 19:15:04 +0300 Subject: [PATCH] Add some tests for ported cel/celx methods --- scripts/tests/goto.cel | 17 +++++++++++++++++ scripts/tests/gotoloc.cel | 23 +++++++++++++++++++++++ scripts/tests/move.cel | 8 ++++++++ scripts/tests/orbit.cel | 8 ++++++++ scripts/tests/setorientation.cel | 22 ++++++++++++++++++++++ 5 files changed, 78 insertions(+) create mode 100644 scripts/tests/goto.cel create mode 100644 scripts/tests/gotoloc.cel create mode 100644 scripts/tests/move.cel create mode 100644 scripts/tests/orbit.cel create mode 100644 scripts/tests/setorientation.cel diff --git a/scripts/tests/goto.cel b/scripts/tests/goto.cel new file mode 100644 index 000000000..0407a2e3a --- /dev/null +++ b/scripts/tests/goto.cel @@ -0,0 +1,17 @@ +{ + timerate { rate 0.0 } + time { jd 2451545 } + + select { object "Sol/Mars" } + goto {} + + wait { duration 5.0 } + + select { object "Sol/Mars" } + goto { up [ 0.5 0.5 0.5 ] } + + wait { duration 5.0 } + + select { object "Sol/Earth" } + gotolonglat { up [ 0.5 0.5 0.5 ] longitude 52.357715 latitude 30.983344 } +} diff --git a/scripts/tests/gotoloc.cel b/scripts/tests/gotoloc.cel new file mode 100644 index 000000000..af7651ed1 --- /dev/null +++ b/scripts/tests/gotoloc.cel @@ -0,0 +1,23 @@ +{ + timerate { rate 0.0 } + time { jd 2451545 } + + select { object "Sol/Mars" } + center { } + follow { } + gotoloc { time 2 + position [0 106378.1 0] + xrot 90 + yrot 0 + zrot 0 } + wait { duration 5 } + + gotoloc { time 2 + x "wJjebddBM3XLDA" + y "Z2/b0Q34Pw" + z "GShiyVOKuxUI" + ow 0.954531 + ox 0.112769 + oy -0.272262 + oz -0.045019 } +} diff --git a/scripts/tests/move.cel b/scripts/tests/move.cel new file mode 100644 index 000000000..663e94b53 --- /dev/null +++ b/scripts/tests/move.cel @@ -0,0 +1,8 @@ +{ + timerate { rate 0.0 } + time { jd 2451545 } + + select { object "Sol/Mars" } + + move { duration 5.0 velocity [543 -543 123] } +} diff --git a/scripts/tests/orbit.cel b/scripts/tests/orbit.cel new file mode 100644 index 000000000..316a85ed7 --- /dev/null +++ b/scripts/tests/orbit.cel @@ -0,0 +1,8 @@ +{ + timerate { rate 0.0 } + time { jd 2451545 } + + select { object "Sol/Mars" } + goto { } + orbit { axis [0.5 -0.5 0.5] rate 5 duration 10} +} diff --git a/scripts/tests/setorientation.cel b/scripts/tests/setorientation.cel new file mode 100644 index 000000000..68984e63a --- /dev/null +++ b/scripts/tests/setorientation.cel @@ -0,0 +1,22 @@ +{ + timerate { rate 0.0 } + time { jd 2451545 } + + select { object "Sol/Earth" } + + setorientation { + ow 0.090610 + ox -0.494683 + oy 0.860207 + oz -0.084397 + } + + wait { duration 5.0 } + +# this shows different result because the original code +# does not normalize axises + setorientation { + angle 10.0 + axis [0.5 -0.5 0.5] + } +}