From 92bccd38e7d2ef8388e92cd66d61176b4cebdc0b Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 26 Mar 2018 17:42:13 -0300 Subject: [PATCH 001/169] tests: Add test-Media-start-over-anchors --- .gitignore | 1 + tests/Makefile.am | 3 + tests/test-Media-start-over-anchors.cpp | 447 ++++++++++++++++++++++++ 3 files changed, 451 insertions(+) create mode 100644 tests/test-Media-start-over-anchors.cpp diff --git a/.gitignore b/.gitignore index f00d25e37..ce5b1fc97 100644 --- a/.gitignore +++ b/.gitignore @@ -151,6 +151,7 @@ /tests/test-Media-focusIndex /tests/test-Media-explicitDur /tests/test-Media-nested-explicitDur +/tests/test-Media-start-over-anchors /tests/test-MediaSettings-instances /tests/test-MediaSettings-new /tests/test-Object-addAlias diff --git a/tests/Makefile.am b/tests/Makefile.am index 328ef5533..42549d0f5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -290,6 +290,9 @@ test_Media_focusIndex_SOURCES= test-Media-focusIndex.cpp progs+= test-Media-mime test_Media_mime_SOURCES= test-Media-mime.cpp +progs+= test-Media-start-over-anchors +test_Media_start_over_anchors_SOURCES= test-Media-start-over-anchors.cpp + # lib/MediaSettings.h ------------------------------------------------------ progs+= test-MediaSettings-instances test_MediaSettings_instances_SOURCES= test-MediaSettings-instances.cpp diff --git a/tests/test-Media-start-over-anchors.cpp b/tests/test-Media-start-over-anchors.cpp new file mode 100644 index 000000000..fb9006e33 --- /dev/null +++ b/tests/test-Media-start-over-anchors.cpp @@ -0,0 +1,447 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // start in anchor with begin nonzero and link waiting for this anchor end + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + + // start in anchor with begin nonzero and link waiting another anchor with + // begin after the begin of the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + + + // start in anchor with begin nonzero and link waiting another anchor begin + // with time before the begin of the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // start in anchor with non-zero end and link waiting + // an anchor end with time after the end of the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (25 * GINGA_SECOND, 25 * GINGA_SECOND, 0); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // start in anchor with non-zero end and link waiting an anchor with end + // time the end before to the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + + // start an anchor and start another anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc,xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} From 9dea3adfe1363197f29d5fd796033b8aa2047368 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 10:37:01 -0300 Subject: [PATCH 002/169] tests-ncl: Create tests-ncl for start over video anchors similar those present in Media-start-over-anchors.cpp --- tests-ncl/test-video-time-anchor-1.ncl | 32 ++++++++++++++++++++++++++ tests-ncl/test-video-time-anchor-2.ncl | 32 ++++++++++++++++++++++++++ tests-ncl/test-video-time-anchor-3.ncl | 32 ++++++++++++++++++++++++++ tests-ncl/test-video-time-anchor-4.ncl | 31 +++++++++++++++++++++++++ tests-ncl/test-video-time-anchor-5.ncl | 31 +++++++++++++++++++++++++ tests-ncl/test-video-time-anchor-6.ncl | 31 +++++++++++++++++++++++++ 6 files changed, 189 insertions(+) create mode 100644 tests-ncl/test-video-time-anchor-1.ncl create mode 100644 tests-ncl/test-video-time-anchor-2.ncl create mode 100644 tests-ncl/test-video-time-anchor-3.ncl create mode 100644 tests-ncl/test-video-time-anchor-4.ncl create mode 100644 tests-ncl/test-video-time-anchor-5.ncl create mode 100644 tests-ncl/test-video-time-anchor-6.ncl diff --git a/tests-ncl/test-video-time-anchor-1.ncl b/tests-ncl/test-video-time-anchor-1.ncl new file mode 100644 index 000000000..8619e17e4 --- /dev/null +++ b/tests-ncl/test-video-time-anchor-1.ncl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-video-time-anchor-2.ncl b/tests-ncl/test-video-time-anchor-2.ncl new file mode 100644 index 000000000..78d3a96ea --- /dev/null +++ b/tests-ncl/test-video-time-anchor-2.ncl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-video-time-anchor-3.ncl b/tests-ncl/test-video-time-anchor-3.ncl new file mode 100644 index 000000000..06d9ddb14 --- /dev/null +++ b/tests-ncl/test-video-time-anchor-3.ncl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-video-time-anchor-4.ncl b/tests-ncl/test-video-time-anchor-4.ncl new file mode 100644 index 000000000..455792710 --- /dev/null +++ b/tests-ncl/test-video-time-anchor-4.ncl @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-video-time-anchor-5.ncl b/tests-ncl/test-video-time-anchor-5.ncl new file mode 100644 index 000000000..c70287abc --- /dev/null +++ b/tests-ncl/test-video-time-anchor-5.ncl @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-video-time-anchor-6.ncl b/tests-ncl/test-video-time-anchor-6.ncl new file mode 100644 index 000000000..ab1b42341 --- /dev/null +++ b/tests-ncl/test-video-time-anchor-6.ncl @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 7e440b45c01b39a4039b26986d119847ae094a15 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 10:38:41 -0300 Subject: [PATCH 003/169] tests-ncl: Remove old video over anchors tests --- tests-ncl/old/test-video-start-anchor.ncl | 51 -------------- tests-ncl/old/test-video-time-anchor-1.ncl | 56 --------------- tests-ncl/old/test-video-time-anchor-2.ncl | 79 ---------------------- 3 files changed, 186 deletions(-) delete mode 100644 tests-ncl/old/test-video-start-anchor.ncl delete mode 100644 tests-ncl/old/test-video-time-anchor-1.ncl delete mode 100644 tests-ncl/old/test-video-time-anchor-2.ncl diff --git a/tests-ncl/old/test-video-start-anchor.ncl b/tests-ncl/old/test-video-start-anchor.ncl deleted file mode 100644 index 7220ee675..000000000 --- a/tests-ncl/old/test-video-start-anchor.ncl +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests-ncl/old/test-video-time-anchor-1.ncl b/tests-ncl/old/test-video-time-anchor-1.ncl deleted file mode 100644 index ca30cdd38..000000000 --- a/tests-ncl/old/test-video-time-anchor-1.ncl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests-ncl/old/test-video-time-anchor-2.ncl b/tests-ncl/old/test-video-time-anchor-2.ncl deleted file mode 100644 index bc6dff92b..000000000 --- a/tests-ncl/old/test-video-time-anchor-2.ncl +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From cf3f23df2b5110e1042d86abaa333e1fd95aa89a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 10:46:41 -0300 Subject: [PATCH 004/169] tests-ncl: Move tests-ncl/old/test-video-* to tests-ncl/ --- tests-ncl/{old => }/test-video-abort-press-red.ncl | 0 tests-ncl/{old => }/test-video-abort.ncl | 0 tests-ncl/{old => }/test-video-explicit-dur.ncl | 0 tests-ncl/{old => }/test-video-leak.ncl | 0 tests-ncl/{old => }/test-video-natural-end.ncl | 0 tests-ncl/{old => }/test-video-onbegin-onend.ncl | 0 tests-ncl/{old => }/test-video-pause.ncl | 0 tests-ncl/{old => }/test-video-press-red-green.ncl | 0 tests-ncl/{old => }/test-video-set-balanceLevel.ncl | 0 tests-ncl/{old => }/test-video-set-bassLevel-trebleLevel.ncl | 0 tests-ncl/{old => }/test-video-set-freeze.ncl | 0 tests-ncl/{old => }/test-video-set-rate.ncl | 0 tests-ncl/{old => }/test-video-set-seek.ncl | 0 tests-ncl/{old => }/test-video-set-volume.ncl | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename tests-ncl/{old => }/test-video-abort-press-red.ncl (100%) rename tests-ncl/{old => }/test-video-abort.ncl (100%) rename tests-ncl/{old => }/test-video-explicit-dur.ncl (100%) rename tests-ncl/{old => }/test-video-leak.ncl (100%) rename tests-ncl/{old => }/test-video-natural-end.ncl (100%) rename tests-ncl/{old => }/test-video-onbegin-onend.ncl (100%) rename tests-ncl/{old => }/test-video-pause.ncl (100%) rename tests-ncl/{old => }/test-video-press-red-green.ncl (100%) rename tests-ncl/{old => }/test-video-set-balanceLevel.ncl (100%) rename tests-ncl/{old => }/test-video-set-bassLevel-trebleLevel.ncl (100%) rename tests-ncl/{old => }/test-video-set-freeze.ncl (100%) rename tests-ncl/{old => }/test-video-set-rate.ncl (100%) rename tests-ncl/{old => }/test-video-set-seek.ncl (100%) rename tests-ncl/{old => }/test-video-set-volume.ncl (100%) diff --git a/tests-ncl/old/test-video-abort-press-red.ncl b/tests-ncl/test-video-abort-press-red.ncl similarity index 100% rename from tests-ncl/old/test-video-abort-press-red.ncl rename to tests-ncl/test-video-abort-press-red.ncl diff --git a/tests-ncl/old/test-video-abort.ncl b/tests-ncl/test-video-abort.ncl similarity index 100% rename from tests-ncl/old/test-video-abort.ncl rename to tests-ncl/test-video-abort.ncl diff --git a/tests-ncl/old/test-video-explicit-dur.ncl b/tests-ncl/test-video-explicit-dur.ncl similarity index 100% rename from tests-ncl/old/test-video-explicit-dur.ncl rename to tests-ncl/test-video-explicit-dur.ncl diff --git a/tests-ncl/old/test-video-leak.ncl b/tests-ncl/test-video-leak.ncl similarity index 100% rename from tests-ncl/old/test-video-leak.ncl rename to tests-ncl/test-video-leak.ncl diff --git a/tests-ncl/old/test-video-natural-end.ncl b/tests-ncl/test-video-natural-end.ncl similarity index 100% rename from tests-ncl/old/test-video-natural-end.ncl rename to tests-ncl/test-video-natural-end.ncl diff --git a/tests-ncl/old/test-video-onbegin-onend.ncl b/tests-ncl/test-video-onbegin-onend.ncl similarity index 100% rename from tests-ncl/old/test-video-onbegin-onend.ncl rename to tests-ncl/test-video-onbegin-onend.ncl diff --git a/tests-ncl/old/test-video-pause.ncl b/tests-ncl/test-video-pause.ncl similarity index 100% rename from tests-ncl/old/test-video-pause.ncl rename to tests-ncl/test-video-pause.ncl diff --git a/tests-ncl/old/test-video-press-red-green.ncl b/tests-ncl/test-video-press-red-green.ncl similarity index 100% rename from tests-ncl/old/test-video-press-red-green.ncl rename to tests-ncl/test-video-press-red-green.ncl diff --git a/tests-ncl/old/test-video-set-balanceLevel.ncl b/tests-ncl/test-video-set-balanceLevel.ncl similarity index 100% rename from tests-ncl/old/test-video-set-balanceLevel.ncl rename to tests-ncl/test-video-set-balanceLevel.ncl diff --git a/tests-ncl/old/test-video-set-bassLevel-trebleLevel.ncl b/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl similarity index 100% rename from tests-ncl/old/test-video-set-bassLevel-trebleLevel.ncl rename to tests-ncl/test-video-set-bassLevel-trebleLevel.ncl diff --git a/tests-ncl/old/test-video-set-freeze.ncl b/tests-ncl/test-video-set-freeze.ncl similarity index 100% rename from tests-ncl/old/test-video-set-freeze.ncl rename to tests-ncl/test-video-set-freeze.ncl diff --git a/tests-ncl/old/test-video-set-rate.ncl b/tests-ncl/test-video-set-rate.ncl similarity index 100% rename from tests-ncl/old/test-video-set-rate.ncl rename to tests-ncl/test-video-set-rate.ncl diff --git a/tests-ncl/old/test-video-set-seek.ncl b/tests-ncl/test-video-set-seek.ncl similarity index 100% rename from tests-ncl/old/test-video-set-seek.ncl rename to tests-ncl/test-video-set-seek.ncl diff --git a/tests-ncl/old/test-video-set-volume.ncl b/tests-ncl/test-video-set-volume.ncl similarity index 100% rename from tests-ncl/old/test-video-set-volume.ncl rename to tests-ncl/test-video-set-volume.ncl From dc92c8e4bee8f250b98f935bc157e4b88e2545d0 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 11:04:15 -0300 Subject: [PATCH 005/169] tests-ncl: Move generated ncl tests to tests-ncl/generated/ --- .gitignore | 38 +++++++++---------- Makefile.am | 2 +- configure.ac | 2 +- tests-ncl/{ => generated}/Makefile.am | 0 .../{ => generated}/test-media-4grid.ncl.in | 0 .../test-media-anim-background.ncl.in | 0 .../test-media-anim-dimensions.ncl.in | 0 .../test-media-anim-transparency.ncl.in | 0 .../test-media-dimensions.ncl.in | 0 .../{ => generated}/test-media-empty.ncl.in | 0 .../test-media-explicitDur.ncl.in | 0 .../test-media-focusIndex.ncl.in | 0 .../{ => generated}/test-media-loop.ncl.in | 0 .../test-media-nested-region.ncl.in | 0 .../{ => generated}/test-media-no-desc.ncl.in | 0 .../test-media-no-region.ncl.in | 0 .../test-media-stop-self.ncl.in | 0 .../test-media-transparency.ncl.in | 0 .../{ => generated}/test-media-visible.ncl.in | 0 .../{ => generated}/test-media-zIndex.ncl.in | 0 tests-ncl/{ => generated}/test-mime.ncl.in | 0 21 files changed, 21 insertions(+), 21 deletions(-) rename tests-ncl/{ => generated}/Makefile.am (100%) rename tests-ncl/{ => generated}/test-media-4grid.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-anim-background.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-anim-dimensions.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-anim-transparency.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-dimensions.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-empty.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-explicitDur.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-focusIndex.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-loop.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-nested-region.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-no-desc.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-no-region.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-stop-self.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-transparency.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-visible.ncl.in (100%) rename tests-ncl/{ => generated}/test-media-zIndex.ncl.in (100%) rename tests-ncl/{ => generated}/test-mime.ncl.in (100%) diff --git a/.gitignore b/.gitignore index ce5b1fc97..0fb3a4b2e 100644 --- a/.gitignore +++ b/.gitignore @@ -79,25 +79,25 @@ /src/Makefile.in /src/ginga /src/ginga-gl -/tests-ncl/Makefile -/tests-ncl/Makefile.in -/tests-ncl/test-media-*-4grid.ncl -/tests-ncl/test-media-*-anim-background.ncl -/tests-ncl/test-media-*-anim-dimensions.ncl -/tests-ncl/test-media-*-anim-transparency.ncl -/tests-ncl/test-media-*-dimensions.ncl -/tests-ncl/test-media-*-empty.ncl -/tests-ncl/test-media-*-explicitDur.ncl -/tests-ncl/test-media-*-focusIndex.ncl -/tests-ncl/test-media-*-loop.ncl -/tests-ncl/test-media-*-nested-region.ncl -/tests-ncl/test-media-*-no-desc.ncl -/tests-ncl/test-media-*-no-region.ncl -/tests-ncl/test-media-*-stop-self.ncl -/tests-ncl/test-media-*-transparency.ncl -/tests-ncl/test-media-*-visible.ncl -/tests-ncl/test-media-*-zIndex.ncl -/tests-ncl/test-mime-*.ncl +/tests-ncl/generated/Makefile +/tests-ncl/generated/Makefile.in +/tests-ncl/generated/test-media-*-4grid.ncl +/tests-ncl/generated/test-media-*-anim-background.ncl +/tests-ncl/generated/test-media-*-anim-dimensions.ncl +/tests-ncl/generated/test-media-*-anim-transparency.ncl +/tests-ncl/generated/test-media-*-dimensions.ncl +/tests-ncl/generated/test-media-*-empty.ncl +/tests-ncl/generated/test-media-*-explicitDur.ncl +/tests-ncl/generated/test-media-*-focusIndex.ncl +/tests-ncl/generated/test-media-*-loop.ncl +/tests-ncl/generated/test-media-*-nested-region.ncl +/tests-ncl/generated/test-media-*-no-desc.ncl +/tests-ncl/generated/test-media-*-no-region.ncl +/tests-ncl/generated/test-media-*-stop-self.ncl +/tests-ncl/generated/test-media-*-transparency.ncl +/tests-ncl/generated/test-media-*-visible.ncl +/tests-ncl/generated/test-media-*-zIndex.ncl +/tests-ncl/generated/test-mime-*.ncl /tests/Makefile /tests/Makefile.in /tests/env.csh diff --git a/Makefile.am b/Makefile.am index 6db2dee8f..3aac0864e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,7 @@ include $(top_srcdir)/build-aux/Makefile.am.common ACLOCAL_AMFLAGS= -I build-aux ${ACLOCAL_FLAGS} -SUBDIRS= lib src src-gui tests-ncl tests +SUBDIRS= lib src src-gui tests-ncl/generated tests # Setup code coverage. include $(top_srcdir)/build-aux/Makefile.am.coverage diff --git a/configure.ac b/configure.ac index 6ac25e394..7ef040289 100644 --- a/configure.ac +++ b/configure.ac @@ -318,7 +318,7 @@ src/Makefile src-gui/Makefile src-gui/icons/Makefile src-gui/style/Makefile -tests-ncl/Makefile +tests-ncl/generated/Makefile tests/Makefile ]) diff --git a/tests-ncl/Makefile.am b/tests-ncl/generated/Makefile.am similarity index 100% rename from tests-ncl/Makefile.am rename to tests-ncl/generated/Makefile.am diff --git a/tests-ncl/test-media-4grid.ncl.in b/tests-ncl/generated/test-media-4grid.ncl.in similarity index 100% rename from tests-ncl/test-media-4grid.ncl.in rename to tests-ncl/generated/test-media-4grid.ncl.in diff --git a/tests-ncl/test-media-anim-background.ncl.in b/tests-ncl/generated/test-media-anim-background.ncl.in similarity index 100% rename from tests-ncl/test-media-anim-background.ncl.in rename to tests-ncl/generated/test-media-anim-background.ncl.in diff --git a/tests-ncl/test-media-anim-dimensions.ncl.in b/tests-ncl/generated/test-media-anim-dimensions.ncl.in similarity index 100% rename from tests-ncl/test-media-anim-dimensions.ncl.in rename to tests-ncl/generated/test-media-anim-dimensions.ncl.in diff --git a/tests-ncl/test-media-anim-transparency.ncl.in b/tests-ncl/generated/test-media-anim-transparency.ncl.in similarity index 100% rename from tests-ncl/test-media-anim-transparency.ncl.in rename to tests-ncl/generated/test-media-anim-transparency.ncl.in diff --git a/tests-ncl/test-media-dimensions.ncl.in b/tests-ncl/generated/test-media-dimensions.ncl.in similarity index 100% rename from tests-ncl/test-media-dimensions.ncl.in rename to tests-ncl/generated/test-media-dimensions.ncl.in diff --git a/tests-ncl/test-media-empty.ncl.in b/tests-ncl/generated/test-media-empty.ncl.in similarity index 100% rename from tests-ncl/test-media-empty.ncl.in rename to tests-ncl/generated/test-media-empty.ncl.in diff --git a/tests-ncl/test-media-explicitDur.ncl.in b/tests-ncl/generated/test-media-explicitDur.ncl.in similarity index 100% rename from tests-ncl/test-media-explicitDur.ncl.in rename to tests-ncl/generated/test-media-explicitDur.ncl.in diff --git a/tests-ncl/test-media-focusIndex.ncl.in b/tests-ncl/generated/test-media-focusIndex.ncl.in similarity index 100% rename from tests-ncl/test-media-focusIndex.ncl.in rename to tests-ncl/generated/test-media-focusIndex.ncl.in diff --git a/tests-ncl/test-media-loop.ncl.in b/tests-ncl/generated/test-media-loop.ncl.in similarity index 100% rename from tests-ncl/test-media-loop.ncl.in rename to tests-ncl/generated/test-media-loop.ncl.in diff --git a/tests-ncl/test-media-nested-region.ncl.in b/tests-ncl/generated/test-media-nested-region.ncl.in similarity index 100% rename from tests-ncl/test-media-nested-region.ncl.in rename to tests-ncl/generated/test-media-nested-region.ncl.in diff --git a/tests-ncl/test-media-no-desc.ncl.in b/tests-ncl/generated/test-media-no-desc.ncl.in similarity index 100% rename from tests-ncl/test-media-no-desc.ncl.in rename to tests-ncl/generated/test-media-no-desc.ncl.in diff --git a/tests-ncl/test-media-no-region.ncl.in b/tests-ncl/generated/test-media-no-region.ncl.in similarity index 100% rename from tests-ncl/test-media-no-region.ncl.in rename to tests-ncl/generated/test-media-no-region.ncl.in diff --git a/tests-ncl/test-media-stop-self.ncl.in b/tests-ncl/generated/test-media-stop-self.ncl.in similarity index 100% rename from tests-ncl/test-media-stop-self.ncl.in rename to tests-ncl/generated/test-media-stop-self.ncl.in diff --git a/tests-ncl/test-media-transparency.ncl.in b/tests-ncl/generated/test-media-transparency.ncl.in similarity index 100% rename from tests-ncl/test-media-transparency.ncl.in rename to tests-ncl/generated/test-media-transparency.ncl.in diff --git a/tests-ncl/test-media-visible.ncl.in b/tests-ncl/generated/test-media-visible.ncl.in similarity index 100% rename from tests-ncl/test-media-visible.ncl.in rename to tests-ncl/generated/test-media-visible.ncl.in diff --git a/tests-ncl/test-media-zIndex.ncl.in b/tests-ncl/generated/test-media-zIndex.ncl.in similarity index 100% rename from tests-ncl/test-media-zIndex.ncl.in rename to tests-ncl/generated/test-media-zIndex.ncl.in diff --git a/tests-ncl/test-mime.ncl.in b/tests-ncl/generated/test-mime.ncl.in similarity index 100% rename from tests-ncl/test-mime.ncl.in rename to tests-ncl/generated/test-mime.ncl.in From 2217b9ec6783189a262521899b31544473586278 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 11:22:16 -0300 Subject: [PATCH 006/169] Make test-import-region.ncl not use generated ncl --- tests-ncl/test-import-region.ncl | 2 +- tests-ncl/test-misc-empty-body.ncl | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests-ncl/test-misc-empty-body.ncl diff --git a/tests-ncl/test-import-region.ncl b/tests-ncl/test-import-region.ncl index bc58bfda4..a94f2b684 100644 --- a/tests-ncl/test-import-region.ncl +++ b/tests-ncl/test-import-region.ncl @@ -1,7 +1,7 @@ - + diff --git a/tests-ncl/test-misc-empty-body.ncl b/tests-ncl/test-misc-empty-body.ncl new file mode 100644 index 000000000..d82217906 --- /dev/null +++ b/tests-ncl/test-misc-empty-body.ncl @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file From dfba7ba3bc825c4dec90bf0fbf39a4b7a20e6697 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 11:35:55 -0300 Subject: [PATCH 007/169] tests: Make test-Parser-parseFile cover ncls from tests-ncl/generated and examples --- tests/test-Parser-parseFile.cpp | 61 ++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/tests/test-Parser-parseFile.cpp b/tests/test-Parser-parseFile.cpp index 972acfa3d..5a65da31c 100644 --- a/tests/test-Parser-parseFile.cpp +++ b/tests/test-Parser-parseFile.cpp @@ -30,34 +30,49 @@ main (void) g_assert_null (Parser::parseFile ("nonexistent", 100, 100, nullptr)); // Sanity checks. - path = xpathbuildabs (ABS_TOP_SRCDIR, "tests-ncl"); - dir = g_dir_open (path.c_str (), 0, nullptr); - g_assert_nonnull (dir); + vector nclFolders; + nclFolders.push_back (xpathbuildabs (ABS_TOP_SRCDIR, "tests-ncl")); + nclFolders.push_back ( + xpathbuildabs (ABS_TOP_SRCDIR, "tests-ncl/generated")); + nclFolders.push_back ( + xpathbuildabs (ABS_TOP_SRCDIR, "examples/hrace/")); + nclFolders.push_back ( + xpathbuildabs (ABS_TOP_SRCDIR, "examples/luarocks/")); + nclFolders.push_back ( + xpathbuildabs (ABS_TOP_SRCDIR, "examples/pacman/")); + nclFolders.push_back ( + xpathbuildabs (ABS_TOP_SRCDIR, "examples/primeiro-joao/")); - while ((entry = g_dir_read_name (dir)) != nullptr) + for (int i = 0; i < nclFolders.size (); i++) { - string entry_path; - Document *doc; - string errmsg; + dir = g_dir_open (nclFolders[i].c_str (), 0, nullptr); + g_assert_nonnull (dir); - entry_path = xpathbuildabs (path, string (entry)); - if (!xstrhassuffix (entry_path, ".ncl")) - continue; - - errmsg = ""; - doc = Parser::parseFile (entry_path, 100, 100, &errmsg); - if (doc == nullptr) - { - g_printerr ("%s: %s\n", entry, errmsg.c_str ()); - g_assert_not_reached (); - } - else + while ((entry = g_dir_read_name (dir)) != nullptr) { - g_assert (errmsg == ""); + string entry_path; + Document *doc; + string errmsg; + + entry_path = xpathbuildabs (nclFolders[i], string (entry)); + if (!xstrhassuffix (entry_path, ".ncl")) + continue; + + errmsg = ""; + doc = Parser::parseFile (entry_path, 100, 100, &errmsg); + if (doc == nullptr) + { + g_printerr ("%s: %s\n", entry, errmsg.c_str ()); + g_assert_not_reached (); + } + else + { + g_assert (errmsg == ""); + } + delete doc; } - delete doc; - } - g_dir_close (dir); + g_dir_close (dir); + } exit (EXIT_SUCCESS); } From 553539c336f3818547ccd74545d0e4d64c4b3a0f Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 11:43:15 -0300 Subject: [PATCH 008/169] tests-ncl: Rename some ncl tests and remove one already coverad --- ...c-stop-body.ncl => test-ctx-stop-self.ncl} | 0 ...k-pause.ncl => test-link-onBeginPause.ncl} | 0 ...-link-set.ncl => test-link-onBeginSet.ncl} | 0 ...st-video-leak.ncl => test-video-4grid.ncl} | 0 tests-ncl/test-video-abort-press-red.ncl | 49 ------------------- ...ss-red-green.ncl => test-video-resume.ncl} | 0 6 files changed, 49 deletions(-) rename tests-ncl/{test-misc-stop-body.ncl => test-ctx-stop-self.ncl} (100%) rename tests-ncl/{test-link-pause.ncl => test-link-onBeginPause.ncl} (100%) rename tests-ncl/{test-link-set.ncl => test-link-onBeginSet.ncl} (100%) rename tests-ncl/{test-video-leak.ncl => test-video-4grid.ncl} (100%) delete mode 100644 tests-ncl/test-video-abort-press-red.ncl rename tests-ncl/{test-video-press-red-green.ncl => test-video-resume.ncl} (100%) diff --git a/tests-ncl/test-misc-stop-body.ncl b/tests-ncl/test-ctx-stop-self.ncl similarity index 100% rename from tests-ncl/test-misc-stop-body.ncl rename to tests-ncl/test-ctx-stop-self.ncl diff --git a/tests-ncl/test-link-pause.ncl b/tests-ncl/test-link-onBeginPause.ncl similarity index 100% rename from tests-ncl/test-link-pause.ncl rename to tests-ncl/test-link-onBeginPause.ncl diff --git a/tests-ncl/test-link-set.ncl b/tests-ncl/test-link-onBeginSet.ncl similarity index 100% rename from tests-ncl/test-link-set.ncl rename to tests-ncl/test-link-onBeginSet.ncl diff --git a/tests-ncl/test-video-leak.ncl b/tests-ncl/test-video-4grid.ncl similarity index 100% rename from tests-ncl/test-video-leak.ncl rename to tests-ncl/test-video-4grid.ncl diff --git a/tests-ncl/test-video-abort-press-red.ncl b/tests-ncl/test-video-abort-press-red.ncl deleted file mode 100644 index 5cc6195a4..000000000 --- a/tests-ncl/test-video-abort-press-red.ncl +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests-ncl/test-video-press-red-green.ncl b/tests-ncl/test-video-resume.ncl similarity index 100% rename from tests-ncl/test-video-press-red-green.ncl rename to tests-ncl/test-video-resume.ncl From 4d794ff4426fcf50b18db1df9d427581ee034f2e Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 12:03:53 -0300 Subject: [PATCH 009/169] tests-ncl: XML code format, and remove , id from and 'Gerated by NCL eclipse' comentaries --- ...st-ctx-nested-started-without-siblings.ncl | 24 +-- .../broken-test-link-onBeginStopStart.ncl | 2 +- tests-ncl/test-area-1.ncl | 2 +- tests-ncl/test-area-2.ncl | 2 +- tests-ncl/test-area-3.ncl | 2 +- tests-ncl/test-area-4.ncl | 2 +- tests-ncl/test-area-5.ncl | 2 +- tests-ncl/test-area-label-1.ncl | 2 +- tests-ncl/test-area-label-2.ncl | 2 +- tests-ncl/test-ctx-naturalend-1.ncl | 2 +- tests-ncl/test-ctx-nested-pause.ncl | 2 +- tests-ncl/test-ctx-nested.ncl | 2 +- tests-ncl/test-ctx-simple.ncl | 2 +- tests-ncl/test-ctx-stop-self.ncl | 2 +- tests-ncl/test-focusIndex-no-settings.ncl | 3 +- tests-ncl/test-import-region.ncl | 2 +- tests-ncl/test-link-action-with-delay-get.ncl | 2 +- .../test-link-action-with-delay-param.ncl | 2 +- tests-ncl/test-link-action-with-delay.ncl | 2 +- tests-ncl/test-link-assessStmt.ncl | 2 +- tests-ncl/test-link-compStmtAnd.ncl | 2 +- tests-ncl/test-link-get-set.ncl | 2 +- tests-ncl/test-link-onAbort-body.ncl | 2 +- tests-ncl/test-link-onAbort-ctx.ncl | 18 +- tests-ncl/test-link-onAbort.ncl | 2 +- tests-ncl/test-link-onBeginAreaStart.ncl | 2 +- tests-ncl/test-link-onBeginAreaStartTwice.ncl | 2 +- tests-ncl/test-link-onBeginAtt-after-anim.ncl | 2 +- tests-ncl/test-link-onBeginAtt.ncl | 2 +- tests-ncl/test-link-onBeginLambdaStart.ncl | 2 +- .../test-link-onBeginLambdaStartTwice.ncl | 2 +- tests-ncl/test-link-onBeginPause.ncl | 2 +- tests-ncl/test-link-onBeginSet.ncl | 2 +- tests-ncl/test-link-onBeginStop-ctx.ncl | 37 ++-- tests-ncl/test-link-onEndAreaStart.ncl | 2 +- tests-ncl/test-link-onEndAtt-after-anim.ncl | 2 +- tests-ncl/test-link-onEndAtt-body.ncl | 2 +- tests-ncl/test-link-onEndAtt-ctx.ncl | 2 +- tests-ncl/test-link-onEndAtt.ncl | 2 +- tests-ncl/test-link-onEndAttOrOnBegin.ncl | 2 +- tests-ncl/test-link-onKeySel.ncl | 2 +- tests-ncl/test-link-onPause-body.ncl | 2 +- tests-ncl/test-link-onPause-ctx.ncl | 2 +- tests-ncl/test-link-onPause.ncl | 2 +- tests-ncl/test-link-onResume-body.ncl | 2 +- tests-ncl/test-link-onResume-ctx.ncl | 2 +- tests-ncl/test-link-onResume.ncl | 14 +- tests-ncl/test-link-onSel.ncl | 2 +- tests-ncl/test-misc-empty-doc.ncl | 4 +- tests-ncl/test-player-lua-random-property.ncl | 40 ++--- .../test-player-siggen-bit-10freq-150hz.ncl | 126 ++++++-------- .../test-player-siggen-bit-10freq-200hz.ncl | 126 ++++++-------- .../test-player-siggen-bit-13freq-100hz.ncl | 159 ++++++++---------- .../test-player-siggen-bit-13freq-150hz.ncl | 159 ++++++++---------- .../test-player-siggen-bit-4freq-200hz.ncl | 60 +++---- .../test-player-siggen-bit-8freq-150hz.ncl | 104 +++++------- .../test-player-siggen-bit-8freq-200hz.ncl | 104 +++++------- .../test-player-siggen-bit-9freq-200hz.ncl | 115 ++++++------- tests-ncl/test-player-siggen-bit.ncl | 58 +++---- tests-ncl/test-player-siggen-freq.ncl | 20 +-- tests-ncl/test-player-siggen-start.ncl | 16 +- tests-ncl/test-player-siggen-volume.ncl | 19 +-- tests-ncl/test-player-siggen-wave.ncl | 4 +- .../test-player-txt-font-properties-2.ncl | 2 +- tests-ncl/test-player-video-volume.ncl | 2 +- tests-ncl/test-refer-1.ncl | 2 +- tests-ncl/test-refer-2.ncl | 2 +- tests-ncl/test-refer-3.ncl | 2 +- tests-ncl/test-switch-dynamic-keys.ncl | 2 +- tests-ncl/test-switch-simple.ncl | 2 +- tests-ncl/test-switch-switchPort.ncl | 3 +- tests-ncl/test-transition-barwipe.ncl | 3 +- tests-ncl/test-transition-diagonalwipe.ncl | 3 +- tests-ncl/test-transition-img-fade.ncl | 3 +- tests-ncl/test-transition-vid-fade.ncl | 3 +- tests-ncl/test-video-4grid.ncl | 59 ++++--- tests-ncl/test-video-abort.ncl | 8 +- tests-ncl/test-video-explicit-dur.ncl | 2 +- tests-ncl/test-video-natural-end.ncl | 9 +- tests-ncl/test-video-onbegin-onend.ncl | 19 +-- tests-ncl/test-video-pause.ncl | 10 +- tests-ncl/test-video-resume.ncl | 24 +-- tests-ncl/test-video-set-balanceLevel.ncl | 89 +++------- .../test-video-set-bassLevel-trebleLevel.ncl | 69 ++------ tests-ncl/test-video-set-freeze.ncl | 8 +- tests-ncl/test-video-set-rate.ncl | 67 ++------ tests-ncl/test-video-set-seek.ncl | 67 ++------ tests-ncl/test-video-set-volume.ncl | 84 +++------ 88 files changed, 748 insertions(+), 1092 deletions(-) diff --git a/tests-ncl/broken-test-ctx-nested-started-without-siblings.ncl b/tests-ncl/broken-test-ctx-nested-started-without-siblings.ncl index 0201fe054..1f8ec6aa3 100644 --- a/tests-ncl/broken-test-ctx-nested-started-without-siblings.ncl +++ b/tests-ncl/broken-test-ctx-nested-started-without-siblings.ncl @@ -1,15 +1,15 @@ - - - - - - - - - - + + + + + + + + + + + - - + \ No newline at end of file diff --git a/tests-ncl/broken-test-link-onBeginStopStart.ncl b/tests-ncl/broken-test-link-onBeginStopStart.ncl index 6b6c794c1..726402a7a 100644 --- a/tests-ncl/broken-test-link-onBeginStopStart.ncl +++ b/tests-ncl/broken-test-link-onBeginStopStart.ncl @@ -21,4 +21,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-area-1.ncl b/tests-ncl/test-area-1.ncl index aebdda150..bbcc7e81d 100644 --- a/tests-ncl/test-area-1.ncl +++ b/tests-ncl/test-area-1.ncl @@ -45,4 +45,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-area-2.ncl b/tests-ncl/test-area-2.ncl index 2e2f1279a..7c3b29273 100644 --- a/tests-ncl/test-area-2.ncl +++ b/tests-ncl/test-area-2.ncl @@ -46,4 +46,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-area-3.ncl b/tests-ncl/test-area-3.ncl index 26944a590..495cf1913 100644 --- a/tests-ncl/test-area-3.ncl +++ b/tests-ncl/test-area-3.ncl @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-area-4.ncl b/tests-ncl/test-area-4.ncl index 3e3585a48..d97407f8e 100644 --- a/tests-ncl/test-area-4.ncl +++ b/tests-ncl/test-area-4.ncl @@ -87,4 +87,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-area-5.ncl b/tests-ncl/test-area-5.ncl index e588a1b70..9584a7433 100644 --- a/tests-ncl/test-area-5.ncl +++ b/tests-ncl/test-area-5.ncl @@ -44,4 +44,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-area-label-1.ncl b/tests-ncl/test-area-label-1.ncl index 92d1e674d..f66636a7b 100644 --- a/tests-ncl/test-area-label-1.ncl +++ b/tests-ncl/test-area-label-1.ncl @@ -54,4 +54,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-area-label-2.ncl b/tests-ncl/test-area-label-2.ncl index ccb658d53..e9322bb4b 100644 --- a/tests-ncl/test-area-label-2.ncl +++ b/tests-ncl/test-area-label-2.ncl @@ -45,4 +45,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-ctx-naturalend-1.ncl b/tests-ncl/test-ctx-naturalend-1.ncl index e9b7fbd16..91c080793 100644 --- a/tests-ncl/test-ctx-naturalend-1.ncl +++ b/tests-ncl/test-ctx-naturalend-1.ncl @@ -17,4 +17,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-ctx-nested-pause.ncl b/tests-ncl/test-ctx-nested-pause.ncl index 616e7dd84..6dc811e3c 100644 --- a/tests-ncl/test-ctx-nested-pause.ncl +++ b/tests-ncl/test-ctx-nested-pause.ncl @@ -38,4 +38,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-ctx-nested.ncl b/tests-ncl/test-ctx-nested.ncl index 872ef8de9..27bca482e 100644 --- a/tests-ncl/test-ctx-nested.ncl +++ b/tests-ncl/test-ctx-nested.ncl @@ -65,4 +65,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-ctx-simple.ncl b/tests-ncl/test-ctx-simple.ncl index ec6287ce5..2466260b4 100644 --- a/tests-ncl/test-ctx-simple.ncl +++ b/tests-ncl/test-ctx-simple.ncl @@ -9,4 +9,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-ctx-stop-self.ncl b/tests-ncl/test-ctx-stop-self.ncl index 05171bfab..025db304d 100644 --- a/tests-ncl/test-ctx-stop-self.ncl +++ b/tests-ncl/test-ctx-stop-self.ncl @@ -19,4 +19,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-focusIndex-no-settings.ncl b/tests-ncl/test-focusIndex-no-settings.ncl index f8d7a6103..61a420547 100644 --- a/tests-ncl/test-focusIndex-no-settings.ncl +++ b/tests-ncl/test-focusIndex-no-settings.ncl @@ -1,6 +1,5 @@ - - + diff --git a/tests-ncl/test-import-region.ncl b/tests-ncl/test-import-region.ncl index a94f2b684..2a53878db 100644 --- a/tests-ncl/test-import-region.ncl +++ b/tests-ncl/test-import-region.ncl @@ -20,4 +20,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-action-with-delay-get.ncl b/tests-ncl/test-link-action-with-delay-get.ncl index f39635ed9..5f26b2475 100644 --- a/tests-ncl/test-link-action-with-delay-get.ncl +++ b/tests-ncl/test-link-action-with-delay-get.ncl @@ -54,4 +54,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-action-with-delay-param.ncl b/tests-ncl/test-link-action-with-delay-param.ncl index a8f006940..29b48b4a4 100644 --- a/tests-ncl/test-link-action-with-delay-param.ncl +++ b/tests-ncl/test-link-action-with-delay-param.ncl @@ -48,4 +48,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-action-with-delay.ncl b/tests-ncl/test-link-action-with-delay.ncl index 8e8f7b0d3..74cc883a6 100644 --- a/tests-ncl/test-link-action-with-delay.ncl +++ b/tests-ncl/test-link-action-with-delay.ncl @@ -39,4 +39,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-assessStmt.ncl b/tests-ncl/test-link-assessStmt.ncl index efe797f89..0a6ac701d 100644 --- a/tests-ncl/test-link-assessStmt.ncl +++ b/tests-ncl/test-link-assessStmt.ncl @@ -40,4 +40,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-compStmtAnd.ncl b/tests-ncl/test-link-compStmtAnd.ncl index 230b06d2e..62bc4bc24 100644 --- a/tests-ncl/test-link-compStmtAnd.ncl +++ b/tests-ncl/test-link-compStmtAnd.ncl @@ -52,4 +52,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-get-set.ncl b/tests-ncl/test-link-get-set.ncl index 58b5c1a2c..1411c74f6 100644 --- a/tests-ncl/test-link-get-set.ncl +++ b/tests-ncl/test-link-get-set.ncl @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onAbort-body.ncl b/tests-ncl/test-link-onAbort-body.ncl index 233962477..6fe9debc3 100644 --- a/tests-ncl/test-link-onAbort-body.ncl +++ b/tests-ncl/test-link-onAbort-body.ncl @@ -34,4 +34,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onAbort-ctx.ncl b/tests-ncl/test-link-onAbort-ctx.ncl index eb234fd20..fa18ff682 100644 --- a/tests-ncl/test-link-onAbort-ctx.ncl +++ b/tests-ncl/test-link-onAbort-ctx.ncl @@ -20,14 +20,14 @@ - - - - - - - - + + + + + + + + @@ -39,4 +39,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onAbort.ncl b/tests-ncl/test-link-onAbort.ncl index 3e85922dc..763d37e85 100644 --- a/tests-ncl/test-link-onAbort.ncl +++ b/tests-ncl/test-link-onAbort.ncl @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginAreaStart.ncl b/tests-ncl/test-link-onBeginAreaStart.ncl index 7713f1097..6e8c906d9 100644 --- a/tests-ncl/test-link-onBeginAreaStart.ncl +++ b/tests-ncl/test-link-onBeginAreaStart.ncl @@ -20,4 +20,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginAreaStartTwice.ncl b/tests-ncl/test-link-onBeginAreaStartTwice.ncl index e0e0c3385..bf818baab 100644 --- a/tests-ncl/test-link-onBeginAreaStartTwice.ncl +++ b/tests-ncl/test-link-onBeginAreaStartTwice.ncl @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginAtt-after-anim.ncl b/tests-ncl/test-link-onBeginAtt-after-anim.ncl index a414502ef..9493f5e65 100644 --- a/tests-ncl/test-link-onBeginAtt-after-anim.ncl +++ b/tests-ncl/test-link-onBeginAtt-after-anim.ncl @@ -35,4 +35,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginAtt.ncl b/tests-ncl/test-link-onBeginAtt.ncl index d7e47ec65..d6f32af88 100644 --- a/tests-ncl/test-link-onBeginAtt.ncl +++ b/tests-ncl/test-link-onBeginAtt.ncl @@ -33,4 +33,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginLambdaStart.ncl b/tests-ncl/test-link-onBeginLambdaStart.ncl index 022a9d054..53d154b45 100644 --- a/tests-ncl/test-link-onBeginLambdaStart.ncl +++ b/tests-ncl/test-link-onBeginLambdaStart.ncl @@ -18,4 +18,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginLambdaStartTwice.ncl b/tests-ncl/test-link-onBeginLambdaStartTwice.ncl index ae959b2dd..7401ed484 100644 --- a/tests-ncl/test-link-onBeginLambdaStartTwice.ncl +++ b/tests-ncl/test-link-onBeginLambdaStartTwice.ncl @@ -21,4 +21,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginPause.ncl b/tests-ncl/test-link-onBeginPause.ncl index 8c83d5065..6cc51cb50 100644 --- a/tests-ncl/test-link-onBeginPause.ncl +++ b/tests-ncl/test-link-onBeginPause.ncl @@ -39,4 +39,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginSet.ncl b/tests-ncl/test-link-onBeginSet.ncl index 5c36563c9..6a203ff6e 100644 --- a/tests-ncl/test-link-onBeginSet.ncl +++ b/tests-ncl/test-link-onBeginSet.ncl @@ -23,4 +23,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onBeginStop-ctx.ncl b/tests-ncl/test-link-onBeginStop-ctx.ncl index f620fe8ca..9e9a9b2e8 100644 --- a/tests-ncl/test-link-onBeginStop-ctx.ncl +++ b/tests-ncl/test-link-onBeginStop-ctx.ncl @@ -1,5 +1,4 @@ - - + @@ -7,20 +6,20 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-link-onEndAreaStart.ncl b/tests-ncl/test-link-onEndAreaStart.ncl index e03660dd5..e65d5811b 100644 --- a/tests-ncl/test-link-onEndAreaStart.ncl +++ b/tests-ncl/test-link-onEndAreaStart.ncl @@ -20,4 +20,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onEndAtt-after-anim.ncl b/tests-ncl/test-link-onEndAtt-after-anim.ncl index 165450246..398f5ed2b 100644 --- a/tests-ncl/test-link-onEndAtt-after-anim.ncl +++ b/tests-ncl/test-link-onEndAtt-after-anim.ncl @@ -35,4 +35,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onEndAtt-body.ncl b/tests-ncl/test-link-onEndAtt-body.ncl index 29e7f473c..1057305e0 100644 --- a/tests-ncl/test-link-onEndAtt-body.ncl +++ b/tests-ncl/test-link-onEndAtt-body.ncl @@ -35,4 +35,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onEndAtt-ctx.ncl b/tests-ncl/test-link-onEndAtt-ctx.ncl index 1a5f20813..20d781554 100644 --- a/tests-ncl/test-link-onEndAtt-ctx.ncl +++ b/tests-ncl/test-link-onEndAtt-ctx.ncl @@ -40,4 +40,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onEndAtt.ncl b/tests-ncl/test-link-onEndAtt.ncl index fca0513f1..24008b009 100644 --- a/tests-ncl/test-link-onEndAtt.ncl +++ b/tests-ncl/test-link-onEndAtt.ncl @@ -34,4 +34,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onEndAttOrOnBegin.ncl b/tests-ncl/test-link-onEndAttOrOnBegin.ncl index 8b11ded64..2cbd27ba9 100644 --- a/tests-ncl/test-link-onEndAttOrOnBegin.ncl +++ b/tests-ncl/test-link-onEndAttOrOnBegin.ncl @@ -46,4 +46,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onKeySel.ncl b/tests-ncl/test-link-onKeySel.ncl index ade1a22f0..878a22783 100644 --- a/tests-ncl/test-link-onKeySel.ncl +++ b/tests-ncl/test-link-onKeySel.ncl @@ -48,4 +48,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onPause-body.ncl b/tests-ncl/test-link-onPause-body.ncl index 5d4b25d4c..579acbef0 100644 --- a/tests-ncl/test-link-onPause-body.ncl +++ b/tests-ncl/test-link-onPause-body.ncl @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onPause-ctx.ncl b/tests-ncl/test-link-onPause-ctx.ncl index 279c014c8..ddf8c62e5 100644 --- a/tests-ncl/test-link-onPause-ctx.ncl +++ b/tests-ncl/test-link-onPause-ctx.ncl @@ -36,4 +36,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onPause.ncl b/tests-ncl/test-link-onPause.ncl index 935ce90b2..f093b12a9 100644 --- a/tests-ncl/test-link-onPause.ncl +++ b/tests-ncl/test-link-onPause.ncl @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onResume-body.ncl b/tests-ncl/test-link-onResume-body.ncl index 1ed128722..9ac6884bd 100644 --- a/tests-ncl/test-link-onResume-body.ncl +++ b/tests-ncl/test-link-onResume-body.ncl @@ -43,4 +43,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onResume-ctx.ncl b/tests-ncl/test-link-onResume-ctx.ncl index 8fb92d7ed..902a93666 100644 --- a/tests-ncl/test-link-onResume-ctx.ncl +++ b/tests-ncl/test-link-onResume-ctx.ncl @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-link-onResume.ncl b/tests-ncl/test-link-onResume.ncl index e76856cdb..39bb76b64 100644 --- a/tests-ncl/test-link-onResume.ncl +++ b/tests-ncl/test-link-onResume.ncl @@ -6,7 +6,7 @@ - + @@ -33,15 +33,15 @@ - - + - + \ No newline at end of file diff --git a/tests-ncl/test-link-onSel.ncl b/tests-ncl/test-link-onSel.ncl index 1c509d824..083e76d1a 100644 --- a/tests-ncl/test-link-onSel.ncl +++ b/tests-ncl/test-link-onSel.ncl @@ -43,4 +43,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-misc-empty-doc.ncl b/tests-ncl/test-misc-empty-doc.ncl index e3a7b3f07..b961cfd6b 100644 --- a/tests-ncl/test-misc-empty-doc.ncl +++ b/tests-ncl/test-misc-empty-doc.ncl @@ -1 +1,3 @@ - + + + \ No newline at end of file diff --git a/tests-ncl/test-player-lua-random-property.ncl b/tests-ncl/test-player-lua-random-property.ncl index 7c82c59fc..b83188bec 100644 --- a/tests-ncl/test-player-lua-random-property.ncl +++ b/tests-ncl/test-player-lua-random-property.ncl @@ -1,24 +1,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl b/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl index 2da9ca9f6..2374a78dc 100644 --- a/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl +++ b/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl @@ -1,71 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl b/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl index 6590cf6b1..143a5cd4a 100644 --- a/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl +++ b/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl @@ -1,71 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl b/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl index d1f516106..14db4fbaf 100644 --- a/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl +++ b/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl @@ -1,89 +1,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl b/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl index a2dc336cd..1f419d7dd 100644 --- a/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl +++ b/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl @@ -1,89 +1,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl b/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl index a22bf73f5..c1f49d98d 100644 --- a/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl +++ b/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl @@ -1,35 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl b/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl index 23511cc5a..eed8b2491 100644 --- a/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl +++ b/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl @@ -1,59 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl b/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl index 939211cf4..22553e928 100644 --- a/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl +++ b/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl @@ -1,59 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl b/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl index 43beb47c6..764c66cf2 100644 --- a/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl +++ b/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl @@ -1,65 +1,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-bit.ncl b/tests-ncl/test-player-siggen-bit.ncl index 5b7b50263..3bf2914bb 100644 --- a/tests-ncl/test-player-siggen-bit.ncl +++ b/tests-ncl/test-player-siggen-bit.ncl @@ -1,35 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-freq.ncl b/tests-ncl/test-player-siggen-freq.ncl index b7ba27fd9..a15c7663f 100644 --- a/tests-ncl/test-player-siggen-freq.ncl +++ b/tests-ncl/test-player-siggen-freq.ncl @@ -1,13 +1,9 @@ - - - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-start.ncl b/tests-ncl/test-player-siggen-start.ncl index b516d774d..8f9c15eab 100644 --- a/tests-ncl/test-player-siggen-start.ncl +++ b/tests-ncl/test-player-siggen-start.ncl @@ -1,11 +1,7 @@ - - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-volume.ncl b/tests-ncl/test-player-siggen-volume.ncl index 0072fff43..3ee74052e 100644 --- a/tests-ncl/test-player-siggen-volume.ncl +++ b/tests-ncl/test-player-siggen-volume.ncl @@ -1,12 +1,9 @@ - - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-player-siggen-wave.ncl b/tests-ncl/test-player-siggen-wave.ncl index b9be76954..7a9c58ef6 100644 --- a/tests-ncl/test-player-siggen-wave.ncl +++ b/tests-ncl/test-player-siggen-wave.ncl @@ -1,5 +1,5 @@ - - + + diff --git a/tests-ncl/test-player-txt-font-properties-2.ncl b/tests-ncl/test-player-txt-font-properties-2.ncl index d8ef7e5ce..8d4136f9a 100644 --- a/tests-ncl/test-player-txt-font-properties-2.ncl +++ b/tests-ncl/test-player-txt-font-properties-2.ncl @@ -102,4 +102,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-player-video-volume.ncl b/tests-ncl/test-player-video-volume.ncl index 3792b2e10..aa03da980 100644 --- a/tests-ncl/test-player-video-volume.ncl +++ b/tests-ncl/test-player-video-volume.ncl @@ -72,4 +72,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-refer-1.ncl b/tests-ncl/test-refer-1.ncl index 3773b5888..a396788d7 100644 --- a/tests-ncl/test-refer-1.ncl +++ b/tests-ncl/test-refer-1.ncl @@ -9,4 +9,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-refer-2.ncl b/tests-ncl/test-refer-2.ncl index 38f9518a5..8f41756e4 100644 --- a/tests-ncl/test-refer-2.ncl +++ b/tests-ncl/test-refer-2.ncl @@ -9,4 +9,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-refer-3.ncl b/tests-ncl/test-refer-3.ncl index 7724647bb..36523e53b 100644 --- a/tests-ncl/test-refer-3.ncl +++ b/tests-ncl/test-refer-3.ncl @@ -9,4 +9,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-switch-dynamic-keys.ncl b/tests-ncl/test-switch-dynamic-keys.ncl index 9da26c3cf..9fa2303b8 100644 --- a/tests-ncl/test-switch-dynamic-keys.ncl +++ b/tests-ncl/test-switch-dynamic-keys.ncl @@ -85,4 +85,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-switch-simple.ncl b/tests-ncl/test-switch-simple.ncl index 92ed06731..094d09570 100644 --- a/tests-ncl/test-switch-simple.ncl +++ b/tests-ncl/test-switch-simple.ncl @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-switch-switchPort.ncl b/tests-ncl/test-switch-switchPort.ncl index 0cfc367a8..276083a07 100644 --- a/tests-ncl/test-switch-switchPort.ncl +++ b/tests-ncl/test-switch-switchPort.ncl @@ -64,6 +64,5 @@ - - + \ No newline at end of file diff --git a/tests-ncl/test-transition-barwipe.ncl b/tests-ncl/test-transition-barwipe.ncl index 1a9f915a5..bb4e2d49b 100644 --- a/tests-ncl/test-transition-barwipe.ncl +++ b/tests-ncl/test-transition-barwipe.ncl @@ -24,10 +24,9 @@ - - + \ No newline at end of file diff --git a/tests-ncl/test-transition-diagonalwipe.ncl b/tests-ncl/test-transition-diagonalwipe.ncl index ebe734a7a..bcdf7eb99 100644 --- a/tests-ncl/test-transition-diagonalwipe.ncl +++ b/tests-ncl/test-transition-diagonalwipe.ncl @@ -24,10 +24,9 @@ - - + \ No newline at end of file diff --git a/tests-ncl/test-transition-img-fade.ncl b/tests-ncl/test-transition-img-fade.ncl index 85f40dbee..74d1530ba 100644 --- a/tests-ncl/test-transition-img-fade.ncl +++ b/tests-ncl/test-transition-img-fade.ncl @@ -24,10 +24,9 @@ - - + \ No newline at end of file diff --git a/tests-ncl/test-transition-vid-fade.ncl b/tests-ncl/test-transition-vid-fade.ncl index a44cab6e8..1bb283691 100644 --- a/tests-ncl/test-transition-vid-fade.ncl +++ b/tests-ncl/test-transition-vid-fade.ncl @@ -24,10 +24,9 @@ - - + \ No newline at end of file diff --git a/tests-ncl/test-video-4grid.ncl b/tests-ncl/test-video-4grid.ncl index 2d38d8463..a21e36893 100644 --- a/tests-ncl/test-video-4grid.ncl +++ b/tests-ncl/test-video-4grid.ncl @@ -1,30 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/test-video-abort.ncl b/tests-ncl/test-video-abort.ncl index e666bdbde..c39ac4351 100644 --- a/tests-ncl/test-video-abort.ncl +++ b/tests-ncl/test-video-abort.ncl @@ -1,5 +1,4 @@ - - + @@ -16,13 +15,12 @@ - - + - + \ No newline at end of file diff --git a/tests-ncl/test-video-explicit-dur.ncl b/tests-ncl/test-video-explicit-dur.ncl index 67a481372..d833900af 100644 --- a/tests-ncl/test-video-explicit-dur.ncl +++ b/tests-ncl/test-video-explicit-dur.ncl @@ -11,4 +11,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-video-natural-end.ncl b/tests-ncl/test-video-natural-end.ncl index f6c13b4f6..4be6e2913 100644 --- a/tests-ncl/test-video-natural-end.ncl +++ b/tests-ncl/test-video-natural-end.ncl @@ -1,5 +1,4 @@ - - + @@ -13,12 +12,12 @@ - + - + @@ -32,4 +31,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-video-onbegin-onend.ncl b/tests-ncl/test-video-onbegin-onend.ncl index 73f0ffe7d..594cf065d 100644 --- a/tests-ncl/test-video-onbegin-onend.ncl +++ b/tests-ncl/test-video-onbegin-onend.ncl @@ -28,20 +28,17 @@ - - - + + - - + + - - - - - + + + - + \ No newline at end of file diff --git a/tests-ncl/test-video-pause.ncl b/tests-ncl/test-video-pause.ncl index 36d3b3dc6..7294f9a36 100644 --- a/tests-ncl/test-video-pause.ncl +++ b/tests-ncl/test-video-pause.ncl @@ -1,5 +1,4 @@ - - + @@ -12,23 +11,20 @@ - - - - + - + \ No newline at end of file diff --git a/tests-ncl/test-video-resume.ncl b/tests-ncl/test-video-resume.ncl index a2dcd9e0a..0b67d6161 100644 --- a/tests-ncl/test-video-resume.ncl +++ b/tests-ncl/test-video-resume.ncl @@ -1,5 +1,4 @@ - - + @@ -36,28 +35,17 @@ - + - + - - - - - + + @@ -65,4 +53,4 @@ - + \ No newline at end of file diff --git a/tests-ncl/test-video-set-balanceLevel.ncl b/tests-ncl/test-video-set-balanceLevel.ncl index b847bb5ef..fe5447afb 100644 --- a/tests-ncl/test-video-set-balanceLevel.ncl +++ b/tests-ncl/test-video-set-balanceLevel.ncl @@ -1,9 +1,8 @@ - - + - + @@ -45,7 +44,6 @@ - @@ -66,7 +64,6 @@ - @@ -87,28 +84,7 @@ - - - + @@ -144,7 +120,6 @@ - @@ -153,102 +128,94 @@ - - + - - - - - + + - - + + - - - + + + + - - - + - - + - - + - - - - - + + + + - - - - + + + + - - - + + - - + \ No newline at end of file diff --git a/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl b/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl index b0967e6ca..f4caaf6b5 100644 --- a/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl +++ b/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl @@ -1,9 +1,8 @@ - - + - + @@ -45,7 +44,6 @@ - @@ -66,7 +64,6 @@ - @@ -87,28 +84,7 @@ - - - + @@ -144,7 +120,6 @@ - @@ -153,88 +128,76 @@ - - + - - - - + + - - - - - - - + - - + - - + - - + - - + - - + - - + \ No newline at end of file diff --git a/tests-ncl/test-video-set-freeze.ncl b/tests-ncl/test-video-set-freeze.ncl index 7ef4fe6b7..dc2393135 100644 --- a/tests-ncl/test-video-set-freeze.ncl +++ b/tests-ncl/test-video-set-freeze.ncl @@ -1,5 +1,5 @@ - - + + @@ -22,13 +22,13 @@ - + - + diff --git a/tests-ncl/test-video-set-rate.ncl b/tests-ncl/test-video-set-rate.ncl index 44d33447a..2258d4f7b 100644 --- a/tests-ncl/test-video-set-rate.ncl +++ b/tests-ncl/test-video-set-rate.ncl @@ -1,9 +1,8 @@ - - + - + @@ -45,7 +44,6 @@ - @@ -66,7 +64,6 @@ - @@ -87,28 +84,7 @@ - - - + @@ -144,7 +120,6 @@ - @@ -153,79 +128,73 @@ - - + - - - - + + - - + + - - - + + + + - - - + - - + - - + - - + - + \ No newline at end of file diff --git a/tests-ncl/test-video-set-seek.ncl b/tests-ncl/test-video-set-seek.ncl index 527a5988d..33a3d88f7 100644 --- a/tests-ncl/test-video-set-seek.ncl +++ b/tests-ncl/test-video-set-seek.ncl @@ -1,9 +1,8 @@ - - + - + @@ -45,7 +44,6 @@ - @@ -66,7 +64,6 @@ - @@ -87,28 +84,7 @@ - - - + @@ -144,7 +120,6 @@ - @@ -153,64 +128,58 @@ - - + - - - - + + - + - - + + - - - + + + + - - - + - - - + - - + \ No newline at end of file diff --git a/tests-ncl/test-video-set-volume.ncl b/tests-ncl/test-video-set-volume.ncl index c85cf2f4c..601e9081d 100644 --- a/tests-ncl/test-video-set-volume.ncl +++ b/tests-ncl/test-video-set-volume.ncl @@ -1,9 +1,8 @@ - - + - + @@ -45,7 +44,6 @@ - @@ -66,7 +64,6 @@ - @@ -87,28 +84,7 @@ - - - + @@ -144,7 +120,6 @@ - @@ -153,93 +128,86 @@ - - + - - - - - + + - - + + - - - + + + + - - - + - - + - - + - - - - - + + + + - - - - + + + + - - + \ No newline at end of file From 4ef2731b4f7b41029b45317663615b5070c404a2 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 12:07:29 -0300 Subject: [PATCH 010/169] tests-ncl: Fix src in ncl from old folder --- tests-ncl/test-video-4grid.ncl | 8 ++++---- tests-ncl/test-video-abort.ncl | 2 +- tests-ncl/test-video-natural-end.ncl | 2 +- tests-ncl/test-video-onbegin-onend.ncl | 6 +++--- tests-ncl/test-video-pause.ncl | 2 +- tests-ncl/test-video-resume.ncl | 4 ++-- tests-ncl/test-video-set-balanceLevel.ncl | 10 +++++----- tests-ncl/test-video-set-bassLevel-trebleLevel.ncl | 6 +++--- tests-ncl/test-video-set-freeze.ncl | 4 ++-- tests-ncl/test-video-set-rate.ncl | 8 ++++---- tests-ncl/test-video-set-seek.ncl | 8 ++++---- tests-ncl/test-video-set-volume.ncl | 10 +++++----- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/tests-ncl/test-video-4grid.ncl b/tests-ncl/test-video-4grid.ncl index a21e36893..675b4e03c 100644 --- a/tests-ncl/test-video-4grid.ncl +++ b/tests-ncl/test-video-4grid.ncl @@ -16,14 +16,14 @@ - - + + - - + + \ No newline at end of file diff --git a/tests-ncl/test-video-abort.ncl b/tests-ncl/test-video-abort.ncl index c39ac4351..3420216b7 100644 --- a/tests-ncl/test-video-abort.ncl +++ b/tests-ncl/test-video-abort.ncl @@ -15,7 +15,7 @@ - + diff --git a/tests-ncl/test-video-natural-end.ncl b/tests-ncl/test-video-natural-end.ncl index 4be6e2913..f3c5deafb 100644 --- a/tests-ncl/test-video-natural-end.ncl +++ b/tests-ncl/test-video-natural-end.ncl @@ -27,7 +27,7 @@ - + diff --git a/tests-ncl/test-video-onbegin-onend.ncl b/tests-ncl/test-video-onbegin-onend.ncl index 594cf065d..5a0c51717 100644 --- a/tests-ncl/test-video-onbegin-onend.ncl +++ b/tests-ncl/test-video-onbegin-onend.ncl @@ -25,9 +25,9 @@ - - - + + + diff --git a/tests-ncl/test-video-pause.ncl b/tests-ncl/test-video-pause.ncl index 7294f9a36..e5ec4bec7 100644 --- a/tests-ncl/test-video-pause.ncl +++ b/tests-ncl/test-video-pause.ncl @@ -19,7 +19,7 @@ - + diff --git a/tests-ncl/test-video-resume.ncl b/tests-ncl/test-video-resume.ncl index 0b67d6161..2bc6419fa 100644 --- a/tests-ncl/test-video-resume.ncl +++ b/tests-ncl/test-video-resume.ncl @@ -32,10 +32,10 @@ - + - + diff --git a/tests-ncl/test-video-set-balanceLevel.ncl b/tests-ncl/test-video-set-balanceLevel.ncl index fe5447afb..312feda48 100644 --- a/tests-ncl/test-video-set-balanceLevel.ncl +++ b/tests-ncl/test-video-set-balanceLevel.ncl @@ -135,22 +135,22 @@ - + - + - + - + - + diff --git a/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl b/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl index f4caaf6b5..a3122f738 100644 --- a/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl +++ b/tests-ncl/test-video-set-bassLevel-trebleLevel.ncl @@ -134,12 +134,12 @@ - + - - + + diff --git a/tests-ncl/test-video-set-freeze.ncl b/tests-ncl/test-video-set-freeze.ncl index dc2393135..ba8d6f3eb 100644 --- a/tests-ncl/test-video-set-freeze.ncl +++ b/tests-ncl/test-video-set-freeze.ncl @@ -24,10 +24,10 @@ - + - + diff --git a/tests-ncl/test-video-set-rate.ncl b/tests-ncl/test-video-set-rate.ncl index 2258d4f7b..68013a121 100644 --- a/tests-ncl/test-video-set-rate.ncl +++ b/tests-ncl/test-video-set-rate.ncl @@ -135,20 +135,20 @@ - + - + - + - + diff --git a/tests-ncl/test-video-set-seek.ncl b/tests-ncl/test-video-set-seek.ncl index 33a3d88f7..686167c41 100644 --- a/tests-ncl/test-video-set-seek.ncl +++ b/tests-ncl/test-video-set-seek.ncl @@ -135,19 +135,19 @@ - + - + - + - + diff --git a/tests-ncl/test-video-set-volume.ncl b/tests-ncl/test-video-set-volume.ncl index 601e9081d..c6035fa17 100644 --- a/tests-ncl/test-video-set-volume.ncl +++ b/tests-ncl/test-video-set-volume.ncl @@ -135,22 +135,22 @@ - + - + - + - + - + From 8c2a52587766a038f09c2d70be1bb5c90c338d7c Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 17:17:33 -0300 Subject: [PATCH 011/169] examples: Update fetch.sh to download patchs from github.com/andrelbd1/ginga_aplications --- examples/fetch.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/fetch.sh b/examples/fetch.sh index eb59df819..b1319df07 100755 --- a/examples/fetch.sh +++ b/examples/fetch.sh @@ -29,10 +29,18 @@ APPS="$APPS velha" APPS="$APPS vivamais-peso" URI=http://www.telemidia.puc-rio.br/~gflima/misc/nclapps +URI_PATCHS=https://raw.githubusercontent.com/andrelbd1/ginga_aplications/master/ +# declare -A PATCHS +PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl formula1/formula1.ncl hackerteen/hackerteen.lua hackerteen/hackerteen.ncl matrix/matrix.ncl matrixEstresse30.conn orchestra/orchestra.ncl pixelation/pixelation.ncl proderj/proderj.ncl roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-dlso-dia/regionBase.ncl velha/connbase.ncl velha/main.ncl vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-peso/peso.deps vivamais-peso/peso.lua" + for app in $APPS; do - wget --show-progress -q -r -N -np -nH --cut-dirs 3\ - -R "index.html*" "$URI/$app/" + wget --show-progress -q -r -N -np -nH --cut-dirs 3 \ + -R "index.html*" "$URI/$app/" done git clone https://github.com/robertogerson/nclua-tutorial.git +for patch in $PATCHS; do + rm $patch + wget $URI_PATCHS/$patch -P $(dirname $patch)/ +done From 61e77e3c1dec65ca9f558cd9a0d0f9a3e6f4b13c Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 17:24:37 -0300 Subject: [PATCH 012/169] examples: Update .gitignore --- examples/.gitignore | 3 ++- examples/fetch.sh | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/.gitignore b/examples/.gitignore index 5d039114a..88834d70f 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -60,4 +60,5 @@ /velha-peta5 /velhamd /vivamais-alim -/vivamais-peso \ No newline at end of file +/vivamais-peso +/nclua-tutorial \ No newline at end of file diff --git a/examples/fetch.sh b/examples/fetch.sh index b1319df07..c8058cd6f 100755 --- a/examples/fetch.sh +++ b/examples/fetch.sh @@ -30,7 +30,6 @@ APPS="$APPS vivamais-peso" URI=http://www.telemidia.puc-rio.br/~gflima/misc/nclapps URI_PATCHS=https://raw.githubusercontent.com/andrelbd1/ginga_aplications/master/ -# declare -A PATCHS PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl formula1/formula1.ncl hackerteen/hackerteen.lua hackerteen/hackerteen.ncl matrix/matrix.ncl matrixEstresse30.conn orchestra/orchestra.ncl pixelation/pixelation.ncl proderj/proderj.ncl roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-dlso-dia/regionBase.ncl velha/connbase.ncl velha/main.ncl vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-peso/peso.deps vivamais-peso/peso.lua" for app in $APPS; do From 9b1bf0bb64e8705b8e9cc2c75b3aa8fbb251341f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Tue, 27 Mar 2018 18:04:55 -0300 Subject: [PATCH 013/169] NCL Apps to demo. * src-gui/ncl-apps.xml --- src-gui/ncl-apps.xml | 82 +++++++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 31 deletions(-) diff --git a/src-gui/ncl-apps.xml b/src-gui/ncl-apps.xml index 53c4018c6..770fb3705 100644 --- a/src-gui/ncl-apps.xml +++ b/src-gui/ncl-apps.xml @@ -1,33 +1,53 @@ - - - - - - - + + + + + + + + + + + \ No newline at end of file From 5bae2f1fc1004dbdcf08ee72a59863c8ece7945f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Tue, 27 Mar 2018 18:39:17 -0300 Subject: [PATCH 014/169] Adding download of thumbnails in fetch. * examples/fetch.sh * src-gui/ncl-apps.xml --- examples/fetch.sh | 3 +-- src-gui/ncl-apps.xml | 60 ++++++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/examples/fetch.sh b/examples/fetch.sh index c8058cd6f..fcb98f771 100755 --- a/examples/fetch.sh +++ b/examples/fetch.sh @@ -20,7 +20,6 @@ APPS="$APPS africa2010" APPS="$APPS comerciais-proview" APPS="$APPS formula1" APPS="$APPS hackerteen" -APPS="$APPS matrix" APPS="$APPS orchestra" APPS="$APPS pixelation" APPS="$APPS proderj" @@ -30,7 +29,7 @@ APPS="$APPS vivamais-peso" URI=http://www.telemidia.puc-rio.br/~gflima/misc/nclapps URI_PATCHS=https://raw.githubusercontent.com/andrelbd1/ginga_aplications/master/ -PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl formula1/formula1.ncl hackerteen/hackerteen.lua hackerteen/hackerteen.ncl matrix/matrix.ncl matrixEstresse30.conn orchestra/orchestra.ncl pixelation/pixelation.ncl proderj/proderj.ncl roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-dlso-dia/regionBase.ncl velha/connbase.ncl velha/main.ncl vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-peso/peso.deps vivamais-peso/peso.lua" +PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl comerciais-proview/app_cover.png comerciais-proview/app_thumbnail.png formula1/formula1.ncl formula1/app_cover.png formula1/app_thumbnail.png hackerteen/hackerteen.lua hackerteen/hackerteen.ncl hackerteen/app_cover.png hackerteen/app_thumbnail.png orchestra/orchestra.ncl orchestra/app_cover.png orchestra/app_thumbnail.png pixelation/pixelation.ncl pixelation/app_cover.png pixelation/app_thumbnail.png proderj/proderj.ncl proderj/app_cover.png proderj/app_thumbnail.png roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-dlso-dia/regionBase.ncl roteiro-do-dia/app_cover.png roteiro-do-dia/app_thumbnail.png velha/connbase.ncl velha/main.ncl velha/app_cover.png velha/app_thumbnail.png vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-alim/app_cover.png vivamais-alim/app_thumbnail.png vivamais-peso/peso.deps vivamais-peso/peso.lua vivamais-peso/app_cover.png vivamais-peso/app_thumbnail.png" for app in $APPS; do wget --show-progress -q -r -N -np -nH --cut-dirs 3 \ diff --git a/src-gui/ncl-apps.xml b/src-gui/ncl-apps.xml index 770fb3705..65649800c 100644 --- a/src-gui/ncl-apps.xml +++ b/src-gui/ncl-apps.xml @@ -1,53 +1,53 @@ - - - - - - - - - - \ No newline at end of file From ace06dd6db497cb718c67410a2879f95faf4753a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 27 Mar 2018 17:34:33 -0300 Subject: [PATCH 015/169] lib: Remove goto from Document::evalAction --- lib/Document.cpp | 141 +++++++++++++++++++++++++---------------------- lib/Document.h | 1 + 2 files changed, 77 insertions(+), 65 deletions(-) diff --git a/lib/Document.cpp b/lib/Document.cpp index 60432d5b5..d0196ecf3 100644 --- a/lib/Document.cpp +++ b/lib/Document.cpp @@ -208,6 +208,67 @@ Document::evalAction (Event *event, Event::Transition transition, return this->evalAction (act); } +/** + * @brief Evaluates action over Context. + */ +list +Document::evalActionInContext (Action act, Context *ctx) +{ + list stack; + Event *evt; + + evt = act.event; + g_assert_nonnull (evt); + + if (!ctx->getLinksStatus ()) + return stack; + for (auto link : *ctx->getLinks ()) + { + for (auto cond : link.first) + { + Predicate *pred; + + if (cond.event != evt || cond.transition != act.transition) + continue; + + pred = cond.predicate; + if (pred != nullptr && !this->evalPredicate (pred)) + continue; + + // Success. + auto acts = link.second; + for (auto ri = acts.rbegin (); ri != acts.rend (); ++ri) + { + Action next_act = *(ri); + string s; + Time delay; + + if (!this->evalPropertyRef (next_act.delay, &s)) + { + s = next_act.delay; + } + + delay = ginga::parse_time (s); + + if (delay == 0 || delay == GINGA_TIME_NONE) + { + stack.push_back (*ri); + } + else + { + Event *next_evt = next_act.event; + g_assert_nonnull (next_evt); + Object *next_obj = next_evt->getObject (); + g_assert_nonnull (next_obj); + + ctx->addDelayedAction (next_evt, next_act.transition, + next_act.value, delay); + } + } + } + } +} + /** * @brief Evaluates action over document. */ @@ -227,7 +288,6 @@ Document::evalAction (Action init) Object *obj; Composition *comp; Context *ctx; - bool done; act = stack.back (); stack.pop_back (); @@ -243,84 +303,35 @@ Document::evalAction (Action init) continue; n++; - done = false; obj = evt->getObject (); g_assert_nonnull (obj); - - // Trigger links in parent context and ancestors comp = obj->getParent (); + + // If parent composition is a context if (comp != nullptr && instanceof (Context *, comp) && comp->isOccurring ()) { ctx = cast (Context *, comp); g_assert_nonnull (ctx); - trigger: - // Trigger links in current context. - if (ctx->getLinksStatus ()) - { - for (auto link : *ctx->getLinks ()) - { - for (auto cond : link.first) - { - Predicate *pred; - - if (cond.event != evt - || cond.transition != act.transition) - continue; - - pred = cond.predicate; - if (pred != nullptr && !this->evalPredicate (pred)) - continue; - - // Success. - auto acts = link.second; - for (auto ri = acts.rbegin (); ri != acts.rend (); - ++ri) - { - Action next_act = *(ri); - string s; - Time delay; - - if (!this->evalPropertyRef (next_act.delay, &s)) - { - s = next_act.delay; - } - - delay = ginga::parse_time (s); - - if (delay == 0 || delay == GINGA_TIME_NONE) - { - stack.push_back (*ri); - } - else - { - Event *next_evt = next_act.event; - g_assert_nonnull (next_evt); - Object *next_obj = next_evt->getObject (); - g_assert_nonnull (next_obj); - - comp->addDelayedAction ( - next_evt, next_act.transition, - next_act.value, delay); - } - } - } - } - } + // Trigger links in the parent context + list ret = evalActionInContext (act, ctx); + stack.insert (stack.end (), ret.begin (), ret.end ()); - // Trigger links in the parent context, if the event object is - // pointed by a port in the parent context. + // If the event object is pointed by a port in the parent context, + // trigger links in the parent context ( and ancestors) for (auto port : *ctx->getPorts ()) { if (port->getObject () == evt->getObject () && ctx->getParent () != nullptr) { ctx = cast (Context *, ctx->getParent ()); - goto trigger; + list ret = evalActionInContext (act, ctx); + stack.insert (stack.end (), ret.begin (), ret.end ()); } } } + // If parent composition is a switch else if (comp != nullptr && instanceof (Switch *, comp)) { // Trigger the switchPort labelled action mapped to the switch's @@ -333,8 +344,8 @@ Document::evalAction (Action init) if (mapped_evt->getObject () == evt->getObject () && swtch->getParent () != nullptr) { - Event *label_evt = swtch->getEvent (Event::PRESENTATION, - swtchPort.first); + Event *label_evt = swtch->getEvent ( + Event::PRESENTATION, swtchPort.first); g_assert_nonnull (label_evt); // Do the same action in the "equivalent" switchPort @@ -347,12 +358,12 @@ Document::evalAction (Action init) } // If event object is a context, trigger the context itself - if (!done && instanceof (Context *, obj)) + if (instanceof (Context *, obj)) { ctx = cast (Context *, obj); g_assert_nonnull (ctx); - done = true; - goto trigger; + list ret = evalActionInContext (act, ctx); + stack.insert (stack.end (), ret.begin (), ret.end ()); } } return n; diff --git a/lib/Document.h b/lib/Document.h index 00140d9ae..1d6789369 100644 --- a/lib/Document.h +++ b/lib/Document.h @@ -57,6 +57,7 @@ class Document bool setData (const string &, void *, UserDataCleanFunc fn = nullptr); private: + list evalActionInContext (Action, Context *); set _objects; ///< Objects. map _objectsById; ///< Objects indexed by id. Context *_root; ///< Root context (body). From 5d0867db78be8e131499d28f473e02997a7a88c4 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 09:55:39 -0300 Subject: [PATCH 016/169] tests: Rename test-Media-start-over-anchors.cpp --- .gitignore | 2 +- tests/Makefile.am | 4 ++-- ...-anchors.cpp => test-Media-anchors-started-from-ports.cpp} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename tests/{test-Media-start-over-anchors.cpp => test-Media-anchors-started-from-ports.cpp} (100%) diff --git a/.gitignore b/.gitignore index 0fb3a4b2e..8cb80ca45 100644 --- a/.gitignore +++ b/.gitignore @@ -151,7 +151,7 @@ /tests/test-Media-focusIndex /tests/test-Media-explicitDur /tests/test-Media-nested-explicitDur -/tests/test-Media-start-over-anchors +/tests/test-Media-anchors-started-from-ports /tests/test-MediaSettings-instances /tests/test-MediaSettings-new /tests/test-Object-addAlias diff --git a/tests/Makefile.am b/tests/Makefile.am index 42549d0f5..112eb39d3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -290,8 +290,8 @@ test_Media_focusIndex_SOURCES= test-Media-focusIndex.cpp progs+= test-Media-mime test_Media_mime_SOURCES= test-Media-mime.cpp -progs+= test-Media-start-over-anchors -test_Media_start_over_anchors_SOURCES= test-Media-start-over-anchors.cpp +progs+= test-Media-anchors-started-from-ports +test_Media_anchors_started_from_ports_SOURCES= test-Media-anchors-started-from-ports.cpp # lib/MediaSettings.h ------------------------------------------------------ progs+= test-MediaSettings-instances diff --git a/tests/test-Media-start-over-anchors.cpp b/tests/test-Media-anchors-started-from-ports.cpp similarity index 100% rename from tests/test-Media-start-over-anchors.cpp rename to tests/test-Media-anchors-started-from-ports.cpp From e4768021cad33d290689b0a0537cd4bccf4fa49d Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 09:57:51 -0300 Subject: [PATCH 017/169] tests: Add test-Media-anchors-started-from-links --- .gitignore | 1 + tests/Makefile.am | 3 + .../test-Media-anchors-started-from-links.cpp | 440 ++++++++++++++++++ 3 files changed, 444 insertions(+) create mode 100644 tests/test-Media-anchors-started-from-links.cpp diff --git a/.gitignore b/.gitignore index 8cb80ca45..bae51f06e 100644 --- a/.gitignore +++ b/.gitignore @@ -152,6 +152,7 @@ /tests/test-Media-explicitDur /tests/test-Media-nested-explicitDur /tests/test-Media-anchors-started-from-ports +/tests/test-Media-anchors-started-from-links /tests/test-MediaSettings-instances /tests/test-MediaSettings-new /tests/test-Object-addAlias diff --git a/tests/Makefile.am b/tests/Makefile.am index 112eb39d3..3cdb96555 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -293,6 +293,9 @@ test_Media_mime_SOURCES= test-Media-mime.cpp progs+= test-Media-anchors-started-from-ports test_Media_anchors_started_from_ports_SOURCES= test-Media-anchors-started-from-ports.cpp +progs+= test-Media-anchors-started-from-links +test_Media_anchors_started_from_links_SOURCES= test-Media-anchors-started-from-links.cpp + # lib/MediaSettings.h ------------------------------------------------------ progs+= test-MediaSettings-instances test_MediaSettings_instances_SOURCES= test-MediaSettings-instances.cpp diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp new file mode 100644 index 000000000..20afa0cf9 --- /dev/null +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -0,0 +1,440 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // start in anchor with begin nonzero and link waiting for this anchor end + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + + // start in anchor with begin nonzero and link waiting another anchor with + // begin after the begin of the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + + + // start in anchor with begin nonzero and link waiting another anchor begin + // with time before the begin of the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // start in anchor with non-zero end and link waiting + // an anchor end with time after the end of the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (25 * GINGA_SECOND, 25 * GINGA_SECOND, 0); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // start in anchor with non-zero end and link waiting an anchor with end + // time the end before to the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + + // start an anchor and start another anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc,xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} From 24518f806023070e0dd3d98f2e40e3472e482057 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 10:27:03 -0300 Subject: [PATCH 018/169] tests: Add test-Context-ports-started-from-ports.cpp --- .gitignore | 1 + tests/Makefile.am | 4 + .../test-Context-ports-started-from-ports.cpp | 242 ++++++++++++++++++ tests/test-Context-ports.cpp | 123 ++------- 4 files changed, 268 insertions(+), 102 deletions(-) create mode 100644 tests/test-Context-ports-started-from-ports.cpp diff --git a/.gitignore b/.gitignore index bae51f06e..4c73e94fe 100644 --- a/.gitignore +++ b/.gitignore @@ -108,6 +108,7 @@ /tests/test-Context-naturalend /tests/test-Context-nested-naturalend /tests/test-Context-ports +/tests/test-Context-ports-started-from-ports /tests/test-Document-evalPredicate /tests/test-Document-evalPredicate-from-link /tests/test-Document-evalPredicate-from-rule diff --git a/tests/Makefile.am b/tests/Makefile.am index 3cdb96555..dd18d8a8b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -232,6 +232,10 @@ progs+= test-Context-ports test_Context_ports_SOURCES=\ test-Context-ports.cpp +progs+= test-Context-ports-started-from-ports +test_Context_ports_started_from_ports_SOURCES=\ + test-Context-ports-started-from-ports.cpp + progs+= test-Event-transition-Media-stop test_Event_transition_Media_stop_SOURCES=\ test-Event-transition-Media-stop.cpp diff --git a/tests/test-Context-ports-started-from-ports.cpp b/tests/test-Context-ports-started-from-ports.cpp new file mode 100644 index 000000000..a110a673d --- /dev/null +++ b/tests/test-Context-ports-started-from-ports.cpp @@ -0,0 +1,242 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // Port to another port, which is a media object + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, doc->getObjectById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + Media *m3 = cast (Media *, doc->getObjectById ("m3")); + g_assert_nonnull (m3); + Event *m3_lambda = m3->getLambda (); + g_assert_nonnull (m3_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // Port to another port, which is context + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, doc->getObjectById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Context *c2 = cast (Context *, doc->getObjectById ("c2")); + g_assert_nonnull (c2); + Event *c2_lambda = c2->getLambda (); + g_assert_nonnull (c2_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + Media *m3 = cast (Media *, doc->getObjectById ("m3")); + g_assert_nonnull (m3); + Event *m3_lambda = m3->getLambda (); + g_assert_nonnull (m3_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c2_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c2_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c2_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // Port to a port, which is a switch + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, doc->getObjectById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + Media *m3 = cast (Media *, doc->getObjectById ("m3")); + g_assert_nonnull (m3); + Event *m3_lambda = m3->getLambda (); + g_assert_nonnull (m3_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Context-ports.cpp b/tests/test-Context-ports.cpp index af44c7265..1b1cbe5c3 100644 --- a/tests/test-Context-ports.cpp +++ b/tests/test-Context-ports.cpp @@ -20,7 +20,7 @@ along with Ginga. If not, see . */ int main (void) { - // Port to media object. + // Port to media object { Formatter *fmt; Document *doc; @@ -29,6 +29,7 @@ main (void) \n\ \n\ \n\ + \n\ \n\ "); @@ -42,83 +43,27 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); - // -------------------------------- - // check start document - - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - - delete fmt; - } - - // Port to a nested media object. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, doc->getObjectById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Media *m1 = cast (Media *, doc->getObjectById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); g_assert_nonnull (m2_lambda); - Media *m3 = cast (Media *, doc->getObjectById ("m3")); - g_assert_nonnull (m3); - Event *m3_lambda = m3->getLambda (); - g_assert_nonnull (m3_lambda); - // -------------------------------- // check start document g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (m3_lambda->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::OCCURRING); - g_assert (m3_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); delete fmt; } - // Port to a context. + // Port to a context { Formatter *fmt; Document *doc; @@ -188,26 +133,29 @@ main (void) delete fmt; } - // Port over a nested context. + // Port to a switch { Formatter *fmt; Document *doc; tests_parse_and_start (&fmt, &doc, "\ \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ "); @@ -216,16 +164,6 @@ main (void) Event *body_lambda = body->getLambda (); g_assert_nonnull (body_lambda); - Context *c1 = cast (Context *, doc->getObjectById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Context *c2 = cast (Context *, doc->getObjectById ("c2")); - g_assert_nonnull (c2); - Event *c2_lambda = c2->getLambda (); - g_assert_nonnull (c2_lambda); - Media *m1 = cast (Media *, doc->getObjectById ("m1")); g_assert_nonnull (m1); Event *m1_lambda = m1->getLambda (); @@ -236,37 +174,18 @@ main (void) Event *m2_lambda = m2->getLambda (); g_assert_nonnull (m2_lambda); - Media *m3 = cast (Media *, doc->getObjectById ("m3")); - g_assert_nonnull (m3); - Event *m3_lambda = m3->getLambda (); - g_assert_nonnull (m3_lambda); - // -------------------------------- // check start document g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c2_lambda->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (m3_lambda->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c2_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (m3_lambda->getState () == Event::SLEEPING); - - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c2_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::OCCURRING); - g_assert (m3_lambda->getState () == Event::SLEEPING); delete fmt; } From 80d560d0f66a7690f6bfa664234c70d2e12f6444 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 11:50:22 -0300 Subject: [PATCH 019/169] tests: Add test-Context-ports-started-from-links --- .gitignore | 1 + tests/Makefile.am | 4 + .../test-Context-ports-started-from-links.cpp | 266 ++++++++++++++++++ 3 files changed, 271 insertions(+) create mode 100644 tests/test-Context-ports-started-from-links.cpp diff --git a/.gitignore b/.gitignore index 4c73e94fe..b493eb414 100644 --- a/.gitignore +++ b/.gitignore @@ -109,6 +109,7 @@ /tests/test-Context-nested-naturalend /tests/test-Context-ports /tests/test-Context-ports-started-from-ports +/tests/test-Context-ports-started-from-links /tests/test-Document-evalPredicate /tests/test-Document-evalPredicate-from-link /tests/test-Document-evalPredicate-from-rule diff --git a/tests/Makefile.am b/tests/Makefile.am index dd18d8a8b..202c5c325 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -236,6 +236,10 @@ progs+= test-Context-ports-started-from-ports test_Context_ports_started_from_ports_SOURCES=\ test-Context-ports-started-from-ports.cpp +progs+= test-Context-ports-started-from-links +test_Context_ports_started_from_links_SOURCES=\ + test-Context-ports-started-from-links.cpp + progs+= test-Event-transition-Media-stop test_Event_transition_Media_stop_SOURCES=\ test-Event-transition-Media-stop.cpp diff --git a/tests/test-Context-ports-started-from-links.cpp b/tests/test-Context-ports-started-from-links.cpp new file mode 100644 index 000000000..2f731916d --- /dev/null +++ b/tests/test-Context-ports-started-from-links.cpp @@ -0,0 +1,266 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // trigger a port, which is a media object + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, doc->getObjectById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + Media *m3 = cast (Media *, doc->getObjectById ("m3")); + g_assert_nonnull (m3); + Event *m3_lambda = m3->getLambda (); + g_assert_nonnull (m3_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // trigger a port, which is context + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, doc->getObjectById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Context *c2 = cast (Context *, doc->getObjectById ("c2")); + g_assert_nonnull (c2); + Event *c2_lambda = c2->getLambda (); + g_assert_nonnull (c2_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + Media *m3 = cast (Media *, doc->getObjectById ("m3")); + g_assert_nonnull (m3); + Event *m3_lambda = m3->getLambda (); + g_assert_nonnull (m3_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c2_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c2_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // trigger a port, which is a switch + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, doc->getObjectById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + Media *m3 = cast (Media *, doc->getObjectById ("m3")); + g_assert_nonnull (m3); + Event *m3_lambda = m3->getLambda (); + g_assert_nonnull (m3_lambda); + + // -------------------------------- + // check start document + + // TODO: In an midia inside an Switch, fix start the switch and its parent + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + // g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + + // g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + // g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} From cef2590ea455ea87663c0fd71e7af3bad33da8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Wed, 28 Mar 2018 15:18:43 -0300 Subject: [PATCH 020/169] example: Adding packman. * examples/fetch.sh * src-gui/ncl-apps.xml --- examples/fetch.sh | 2 +- src-gui/ncl-apps.xml | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/fetch.sh b/examples/fetch.sh index fcb98f771..ac9c66b93 100755 --- a/examples/fetch.sh +++ b/examples/fetch.sh @@ -29,7 +29,7 @@ APPS="$APPS vivamais-peso" URI=http://www.telemidia.puc-rio.br/~gflima/misc/nclapps URI_PATCHS=https://raw.githubusercontent.com/andrelbd1/ginga_aplications/master/ -PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl comerciais-proview/app_cover.png comerciais-proview/app_thumbnail.png formula1/formula1.ncl formula1/app_cover.png formula1/app_thumbnail.png hackerteen/hackerteen.lua hackerteen/hackerteen.ncl hackerteen/app_cover.png hackerteen/app_thumbnail.png orchestra/orchestra.ncl orchestra/app_cover.png orchestra/app_thumbnail.png pixelation/pixelation.ncl pixelation/app_cover.png pixelation/app_thumbnail.png proderj/proderj.ncl proderj/app_cover.png proderj/app_thumbnail.png roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-dlso-dia/regionBase.ncl roteiro-do-dia/app_cover.png roteiro-do-dia/app_thumbnail.png velha/connbase.ncl velha/main.ncl velha/app_cover.png velha/app_thumbnail.png vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-alim/app_cover.png vivamais-alim/app_thumbnail.png vivamais-peso/peso.deps vivamais-peso/peso.lua vivamais-peso/app_cover.png vivamais-peso/app_thumbnail.png" +PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl comerciais-proview/app_cover.png comerciais-proview/app_thumbnail.png formula1/formula1.ncl formula1/app_cover.png formula1/app_thumbnail.png hackerteen/hackerteen.lua hackerteen/hackerteen.ncl hackerteen/app_cover.png hackerteen/app_thumbnail.png orchestra/orchestra.ncl orchestra/app_cover.png orchestra/app_thumbnail.png pixelation/pixelation.ncl pixelation/app_cover.png pixelation/app_thumbnail.png proderj/proderj.ncl proderj/app_cover.png proderj/app_thumbnail.png roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-dlso-dia/regionBase.ncl roteiro-do-dia/app_cover.png roteiro-do-dia/app_thumbnail.png velha/connbase.ncl velha/main.ncl velha/app_cover.png velha/app_thumbnail.png vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-alim/app_cover.png vivamais-alim/app_thumbnail.png vivamais-peso/peso.deps vivamais-peso/peso.lua vivamais-peso/app_cover.png vivamais-peso/app_thumbnail.png pacman/app_cover.png pacman/app_thumbnail.png" for app in $APPS; do wget --show-progress -q -r -N -np -nH --cut-dirs 3 \ diff --git a/src-gui/ncl-apps.xml b/src-gui/ncl-apps.xml index 65649800c..edf29d91f 100644 --- a/src-gui/ncl-apps.xml +++ b/src-gui/ncl-apps.xml @@ -20,6 +20,11 @@ cover="../ginga/examples/orchestra/app_cover.png" title="Orquestra" description="" /> + - \ No newline at end of file + From f1cce6f28c2fae4dcb596c56a61c9240d40d1a8e Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 15:26:44 -0300 Subject: [PATCH 021/169] maint: make -f maint.mk indent --- lib/Parser.cpp | 43 ++--- lib/ParserLua.cpp | 101 ++++++------ lib/Switch.cpp | 27 +-- lib/Switch.h | 8 +- .../test-Context-ports-started-from-links.cpp | 5 +- .../test-Context-ports-started-from-ports.cpp | 2 +- tests/test-Event-transition-Switch-start.cpp | 7 +- .../test-Media-anchors-started-from-links.cpp | 43 ++--- .../test-Media-anchors-started-from-ports.cpp | 43 ++--- tests/test-Media-explicitDur.cpp | 7 +- tests/test-Media-focusIndex.cpp | 7 +- tests/test-Media-mime.cpp | 3 +- tests/test-Media-nested-explicitDur.cpp | 7 +- tests/test-Parser-parseBuffer.cpp | 12 +- tests/test-Parser-parseFile.cpp | 6 +- tests/test-ParserLua-parseBuffer.cpp | 12 +- tests/test-SigGen-transmission.cpp | 155 +++++++++++------- 17 files changed, 268 insertions(+), 220 deletions(-) diff --git a/lib/Parser.cpp b/lib/Parser.cpp index ff591cba9..fcfb05d9f 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -738,14 +738,12 @@ static map parser_syntax_table = { { "switch" }, { { "id", ATTR_ID } } }, }, - { - "mapping", - { ParserState::pushMapping, - nullptr, - ELT_CACHE, - { "switchPort" }, - { { "component", ATTR_IDREF }, { "interface", ATTR_OPT_IDREF } } } - }, + { "mapping", + { ParserState::pushMapping, + nullptr, + ELT_CACHE, + { "switchPort" }, + { { "component", ATTR_IDREF }, { "interface", ATTR_OPT_IDREF } } } }, { "bindRule", { ParserState::pushBindRule, @@ -1683,7 +1681,8 @@ ParserState::resolveComponent (Composition *scope, ParserElt *elt, * @return \c true if successful, or \c false otherwise. */ bool -ParserState::resolveInterface (Composition *ctx, ParserElt *elt, Event **evt) +ParserState::resolveInterface (Composition *ctx, ParserElt *elt, + Event **evt) { string comp; string iface; @@ -1756,8 +1755,9 @@ ParserState::resolveInterface (Composition *ctx, ParserElt *elt, Event **evt) } else if (instanceof (Switch *, obj)) { - result = obj->getPresentationEvent (iface); // A switchPort is resolved - // as a PresentationEvent. + result + = obj->getPresentationEvent (iface); // A switchPort is resolved + // as a PresentationEvent. if (unlikely (result == nullptr)) goto fail; } @@ -2762,7 +2762,8 @@ borderColor='%s'}", for (auto bind : tests_buf) { for (auto &p : bind->params) - tests_map.insert (std::make_pair(p.first, p.second)); + tests_map.insert ( + std::make_pair (p.first, p.second)); } switch (type) { @@ -3654,7 +3655,6 @@ ParserState::pushSwitch (ParserState *st, ParserElt *elt) return true; } - /// Cleans up the mapping list cache attached to a switchPort #ParserElt. static void mappingsCleanup (void *ptr) @@ -3665,7 +3665,8 @@ mappingsCleanup (void *ptr) /** * @brief Starts the processing of \. * - * This function parsers \p elt and pushes it as a \ on the object + * This function parsers \p elt and pushes it as a \ on the + * object * stack. * * @fn ParserState::pushSwitchPort @@ -3683,7 +3684,8 @@ ParserState::pushSwitchPort (ParserState *st, ParserElt *elt) g_assert (elt->getAttribute ("id", &id)); g_assert (st->eltCacheIndexParent (elt->getNode (), &parent_elt)); UDATA_GET (parent_elt, "switchPorts", &switchPorts); - UDATA_SET (elt, "mappings", new list (), mappingsCleanup); + UDATA_SET (elt, "mappings", new list (), + mappingsCleanup); switchPorts->push_back (id); return true; @@ -3692,7 +3694,8 @@ ParserState::pushSwitchPort (ParserState *st, ParserElt *elt) /** * @brief Starts the processing of \. * - * This function parsers \p elt and pushes it component/interface attributes in + * This function parsers \p elt and pushes it component/interface attributes + * in * the mappings list cache in the \. * * @fn ParserState::pushSwitchPort @@ -3703,7 +3706,7 @@ ParserState::pushSwitchPort (ParserState *st, ParserElt *elt) bool ParserState::pushMapping (ParserState *st, ParserElt *elt) { - list *mappings; + list *mappings; string component, interface; ParserElt *parent_elt; @@ -3760,13 +3763,13 @@ ParserState::popSwitch (ParserState *st, unused (ParserElt *elt)) for (auto switchPort_id : *switchPorts) { ParserElt *switchPort_elt; - list *mappings; + list *mappings; g_assert (st->eltCacheIndexById (switchPort_id, &switchPort_elt, { "switchPort" })); UDATA_GET (switchPort_elt, "mappings", &mappings); - list mapping_evts; + list mapping_evts; for (auto &mapping_elt : *mappings) { Event *evt; @@ -3852,7 +3855,7 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) } if (type == "application/x-ginga-settings") { - refer = st->_doc->getSettings ()->getId(); + refer = st->_doc->getSettings ()->getId (); media = cast (Media *, st->_doc->getObjectByIdOrAlias (refer)); if (media != nullptr) goto almost_done; diff --git a/lib/ParserLua.cpp b/lib/ParserLua.cpp index bdf88c9f3..60410837e 100644 --- a/lib/ParserLua.cpp +++ b/lib/ParserLua.cpp @@ -44,7 +44,6 @@ static int l_parse_media (lua_State *L); static int l_parse_link (lua_State *L); static int l_parse_predicate (lua_State *L); - // Helper function Event * getEventStringAsEvent (string str, Context *parent) @@ -54,7 +53,7 @@ getEventStringAsEvent (string str, Context *parent) size_t at = str.find ('@'); - if (at != str.npos) // presentation + if (at != str.npos) // presentation { id = str.substr (0, at); evt = str.substr (at + 1, str.npos); @@ -74,18 +73,17 @@ getEventStringAsEvent (string str, Context *parent) obj = parent->getChildById (id); return obj->getEvent (Event::ATTRIBUTION, evt); } - else // selection + else // selection { at = str.find ('<'); id = str.substr (0, at); evt = str.substr (at + 1, str.npos); - evt.pop_back(); + evt.pop_back (); obj = parent->getChildById (id); return obj->getEvent (Event::SELECTION, evt); } } - // Parsing functions. // parse_context (doc, [parent], tab, path) @@ -300,7 +298,7 @@ l_parse_switch (lua_State *L) { lua_rawgeti (L, 10, 1); const string id_media = string (luaL_checkstring (L, -1)); - Object* obj = swtch->getChildById (id_media); + Object *obj = swtch->getChildById (id_media); lua_rawgeti (L, 10, 2); luaL_checktype (L, -1, LUA_TTABLE); @@ -311,7 +309,7 @@ l_parse_switch (lua_State *L) lua_pushvalue (L, -3); lua_call (L, 2, 0); - Predicate *pred = predicate->getChildren()->front(); + Predicate *pred = predicate->getChildren ()->front (); swtch->addRule (obj, pred); lua_pop (L, 3); @@ -382,7 +380,6 @@ l_parse_media (lua_State *L) lua_error (L); } - lua_rawgeti (L, 3, 3); if (lua_isnil (L, -1) == 0) // have property list { @@ -493,7 +490,7 @@ l_parse_media (lua_State *L) str += "borderColor='" + aux + "',"; str += "}"; - value = str.c_str(); + value = str.c_str (); lua_pop (L, 11); } @@ -573,26 +570,26 @@ l_parse_link (lua_State *L) luaL_checktype (L, 3, LUA_TTABLE); - lua_rawgeti (L, 3, 1); // condition list + lua_rawgeti (L, 3, 1); // condition list luaL_checktype (L, 4, LUA_TTABLE); lua_pushnil (L); while (lua_next (L, 4) != 0) { Action act; - lua_rawgeti (L, 6, 1); // transition + lua_rawgeti (L, 6, 1); // transition string transition = luaL_checkstring (L, -1); if (xstrcasecmp (transition, "set") == 0) transition = "start"; - act.transition = Event::getStringAsTransition (transition); + act.transition = Event::getStringAsTransition (transition); - lua_rawgeti (L, 6, 2); // event + lua_rawgeti (L, 6, 2); // event string event = luaL_checkstring (L, -1); act.event = getEventStringAsEvent (event, parent); - lua_rawgeti (L, 6, 3); // predicate + lua_rawgeti (L, 6, 3); // predicate act.predicate = nullptr; if (!lua_isnil (L, -1)) { @@ -604,7 +601,7 @@ l_parse_link (lua_State *L) lua_pushvalue (L, -3); lua_call (L, 2, 0); - Predicate *pred = predicate->getChildren()->front(); + Predicate *pred = predicate->getChildren ()->front (); act.predicate = pred; } @@ -612,30 +609,30 @@ l_parse_link (lua_State *L) lua_pop (L, 4); } - lua_rawgeti (L, 3, 2); // action list + lua_rawgeti (L, 3, 2); // action list luaL_checktype (L, 5, LUA_TTABLE); lua_pushnil (L); while (lua_next (L, 5) != 0) { Action act; - lua_rawgeti (L, 7, 1); // transition + lua_rawgeti (L, 7, 1); // transition string transition = luaL_checkstring (L, -1); if (xstrcasecmp (transition, "set") == 0) transition = "start"; - act.transition = Event::getStringAsTransition (transition); + act.transition = Event::getStringAsTransition (transition); - lua_rawgeti (L, 7, 2); // event + lua_rawgeti (L, 7, 2); // event string event = luaL_checkstring (L, -1); act.event = getEventStringAsEvent (event, parent); - lua_rawgeti (L, 7, 3); // value + lua_rawgeti (L, 7, 3); // value if (!lua_isnil (L, -1)) act.value = luaL_checkstring (L, -1); - lua_rawgeti (L, 7, 4); // parameter list + lua_rawgeti (L, 7, 4); // parameter list if (!lua_isnil (L, -1)) { luaL_checktype (L, 11, LUA_TTABLE); @@ -703,33 +700,34 @@ l_parse_predicate (lua_State *L) switch (type) { - case Predicate::ATOM: { - string left = str; - - lua_rawgeti (L, 2, 2); - str = luaL_checkstring (L, -1); - - lua_rawgeti (L, 2, 3); - string right = luaL_checkstring (L, -1); - - if (xstrcasecmp (str, "==") == 0) - test = Predicate::EQ; - else if (xstrcasecmp (str, "!=") == 0) - test = Predicate::NE; - else if (xstrcasecmp (str, "<") == 0) - test = Predicate::LT; - else if (xstrcasecmp (str, "<=") == 0) - test = Predicate::LE; - else if (xstrcasecmp (str, ">") == 0) - test = Predicate::GT; - else if (xstrcasecmp (str, ">=") == 0) - test = Predicate::GE; - else - g_assert_not_reached (); - - it->setTest (left, test, right); - break; - } + case Predicate::ATOM: + { + string left = str; + + lua_rawgeti (L, 2, 2); + str = luaL_checkstring (L, -1); + + lua_rawgeti (L, 2, 3); + string right = luaL_checkstring (L, -1); + + if (xstrcasecmp (str, "==") == 0) + test = Predicate::EQ; + else if (xstrcasecmp (str, "!=") == 0) + test = Predicate::NE; + else if (xstrcasecmp (str, "<") == 0) + test = Predicate::LT; + else if (xstrcasecmp (str, "<=") == 0) + test = Predicate::LE; + else if (xstrcasecmp (str, ">") == 0) + test = Predicate::GT; + else if (xstrcasecmp (str, ">=") == 0) + test = Predicate::GE; + else + g_assert_not_reached (); + + it->setTest (left, test, right); + break; + } case Predicate::FALSUM: case Predicate::VERUM: break; @@ -739,7 +737,7 @@ l_parse_predicate (lua_State *L) lua_pushlightuserdata (L, it); lua_rawgeti (L, 2, 3); lua_call (L, 2, 0); - case Predicate::NEGATION: // fall through + case Predicate::NEGATION: // fall through lua_pushcfunction (L, l_parse_predicate); lua_pushlightuserdata (L, it); lua_rawgeti (L, 2, 2); @@ -753,7 +751,6 @@ l_parse_predicate (lua_State *L) return 0; } - // External API. /// Helper function used by Parser::parseBuffer() and Parser::parseFile(). @@ -812,7 +809,7 @@ ParserLua::parseBuffer (const void *buf, size_t size, string *errmsg) doc = process (L, path, errmsg); - done: +done: g_free (str); lua_close (L); return doc; @@ -845,7 +842,7 @@ ParserLua::parseFile (const string &path, string *errmsg) doc = process (L, path, errmsg); - done: +done: lua_close (L); return doc; } diff --git a/lib/Switch.cpp b/lib/Switch.cpp index 506b4c616..c2ca1382a 100644 --- a/lib/Switch.cpp +++ b/lib/Switch.cpp @@ -67,12 +67,12 @@ Switch::toString () bool Switch::beforeTransition (Event *evt, Event::Transition transition) { - set switchPort_evts; // The possible selected events. + set switchPort_evts; // The possible selected events. if (evt->isLambda ()) { // If we are acting on the switch's @lambda all the @lambda children // events can be selected. - for (Object *obj : *(getChildren())) + for (Object *obj : *(getChildren ())) switchPort_evts.insert (obj->getLambda ()); } else @@ -80,15 +80,16 @@ Switch::beforeTransition (Event *evt, Event::Transition transition) // If we are action on a switchPort we should select only the events // being mapped by the switchPort (and the defaultComponent?). auto it = _switchPorts.find (evt->getId ()); - g_assert ( it != _switchPorts.end ()); + g_assert (it != _switchPorts.end ()); for (Event *e : it->second) - switchPort_evts.insert (e); + switchPort_evts.insert (e); } switch (evt->getType ()) { case Event::PRESENTATION: - TRACE ("Presentation event on switchPort: %s.", evt->getId ().c_str ()); + TRACE ("Presentation event on switchPort: %s.", + evt->getId ().c_str ()); switch (transition) { @@ -105,7 +106,8 @@ Switch::beforeTransition (Event *evt, Event::Transition transition) pred = item.second; g_assert_nonnull (pred); - // Check if the (possible) selected object is in the switchPort's + // Check if the (possible) selected object is in the + // switchPort's // list of possible events. selected_evt = nullptr; for (Event *e : switchPort_evts) @@ -163,7 +165,8 @@ Switch::afterTransition (Event *evt, Event::Transition transition) switch (evt->getType ()) { case Event::PRESENTATION: - TRACE ("Presentation event on switchPort: %s.", evt->getId ().c_str ()); + TRACE ("Presentation event on switchPort: %s.", + evt->getId ().c_str ()); switch (transition) { case Event::START: @@ -207,21 +210,19 @@ Switch::addRule (Object *obj, Predicate *pred) _rules.push_back (std::make_pair (obj, pred)); } -const map> * +const map > * Switch::getSwitchPorts () { return &_switchPorts; } void -Switch::addSwitchPort (const string &id, const list &evts) +Switch::addSwitchPort (const string &id, const list &evts) { addPresentationEvent (id, id); - TRACE ("Adding switchPort %s to %s mapping %u evts.", - id.c_str (), - getId ().c_str (), - (guint) evts.size ()); + TRACE ("Adding switchPort %s to %s mapping %u evts.", id.c_str (), + getId ().c_str (), (guint) evts.size ()); _switchPorts[id] = evts; } diff --git a/lib/Switch.h b/lib/Switch.h index 0497c77fe..14fd8b65d 100644 --- a/lib/Switch.h +++ b/lib/Switch.h @@ -38,12 +38,12 @@ class Switch : public Composition // Switch: const list > *getRules (); void addRule (Object *, Predicate *); - const map> * getSwitchPorts (); - void addSwitchPort (const string &, const list &); + const map > *getSwitchPorts (); + void addSwitchPort (const string &, const list &); private: - map> _switchPorts; ///< List of switchPorts. - list> _rules; + map > _switchPorts; ///< List of switchPorts. + list > _rules; Object *_selected; }; diff --git a/tests/test-Context-ports-started-from-links.cpp b/tests/test-Context-ports-started-from-links.cpp index 2f731916d..37f0dc5cc 100644 --- a/tests/test-Context-ports-started-from-links.cpp +++ b/tests/test-Context-ports-started-from-links.cpp @@ -175,7 +175,7 @@ main (void) delete fmt; } - // trigger a port, which is a switch + // trigger a port, which is a switch { Formatter *fmt; Document *doc; @@ -244,7 +244,8 @@ main (void) // -------------------------------- // check start document - // TODO: In an midia inside an Switch, fix start the switch and its parent + // TODO: In an midia inside an Switch, fix start the switch and its + // parent g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); // g_assert (c1_lambda->getState () == Event::OCCURRING); diff --git a/tests/test-Context-ports-started-from-ports.cpp b/tests/test-Context-ports-started-from-ports.cpp index a110a673d..d499e9ea1 100644 --- a/tests/test-Context-ports-started-from-ports.cpp +++ b/tests/test-Context-ports-started-from-ports.cpp @@ -164,7 +164,7 @@ main (void) delete fmt; } - // Port to a port, which is a switch + // Port to a port, which is a switch { Formatter *fmt; Document *doc; diff --git a/tests/test-Event-transition-Switch-start.cpp b/tests/test-Event-transition-Switch-start.cpp index 150166e52..de62a6ff6 100644 --- a/tests/test-Event-transition-Switch-start.cpp +++ b/tests/test-Event-transition-Switch-start.cpp @@ -53,8 +53,8 @@ main (void) Event *body_lambda = body->getLambda (); g_assert_nonnull (body_lambda); - MediaSettings *stgs = cast (MediaSettings *, - doc->getObjectByIdOrAlias ("stgs")); + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); g_assert_nonnull (stgs); Event *stgs_lambda = stgs->getLambda (); g_assert_nonnull (stgs_lambda); @@ -83,7 +83,8 @@ main (void) g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // After advancing time, s1@lambda and m1@lambda are OCCURRING. m2@lambda + // After advancing time, s1@lambda and m1@lambda are OCCURRING. + // m2@lambda // is not selected, and is not occurring. fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp index 20afa0cf9..fe33cbc1c 100644 --- a/tests/test-Media-anchors-started-from-links.cpp +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -159,14 +159,14 @@ main (void) delete fmt; } - - // start in anchor with begin nonzero and link waiting another anchor begin - // with time before the begin of the first anchor - for (int i = 0; i < samples.size (); i++) + // start in anchor with begin nonzero and link waiting another anchor + // begin with time before the begin of the first anchor + for (int i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -197,7 +197,7 @@ main (void) \n\ \n\ \n", - samples[i].uri, samples[i].uri)); + samples[i].uri, samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -229,13 +229,14 @@ main (void) delete fmt; } - // start in anchor with non-zero end and link waiting - // an anchor end with time after the end of the first anchor - for (int i = 0; i < samples.size (); i++) + // start in anchor with non-zero end and link waiting + // an anchor end with time after the end of the first anchor + for (int i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -265,7 +266,7 @@ main (void) \n\ \n\ \n", - samples[i].uri, samples[i].uri)); + samples[i].uri, samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -296,13 +297,14 @@ main (void) delete fmt; } - // start in anchor with non-zero end and link waiting an anchor with end - // time the end before to the first anchor - for (int i = 0; i < samples.size (); i++) + // start in anchor with non-zero end and link waiting an anchor with end + // time the end before to the first anchor + for (int i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -332,7 +334,7 @@ main (void) \n\ \n\ \n", - samples[i].uri, samples[i].uri)); + samples[i].uri, samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -364,12 +366,13 @@ main (void) delete fmt; } - // start an anchor and start another anchor - for (int i = 0; i < samples.size (); i++) + // start an anchor and start another anchor + for (int i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc,xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -399,7 +402,7 @@ main (void) \n\ \n\ \n", - samples[i].uri, samples[i].uri)); + samples[i].uri, samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); diff --git a/tests/test-Media-anchors-started-from-ports.cpp b/tests/test-Media-anchors-started-from-ports.cpp index fb9006e33..22469b6dd 100644 --- a/tests/test-Media-anchors-started-from-ports.cpp +++ b/tests/test-Media-anchors-started-from-ports.cpp @@ -163,14 +163,14 @@ main (void) delete fmt; } - - // start in anchor with begin nonzero and link waiting another anchor begin - // with time before the begin of the first anchor - for (int i = 0; i < samples.size (); i++) + // start in anchor with begin nonzero and link waiting another anchor + // begin with time before the begin of the first anchor + for (int i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -198,7 +198,7 @@ main (void) \n\ \n\ \n", - samples[i].uri, samples[i].uri)); + samples[i].uri, samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -235,13 +235,14 @@ main (void) delete fmt; } - // start in anchor with non-zero end and link waiting - // an anchor end with time after the end of the first anchor - for (int i = 0; i < samples.size (); i++) + // start in anchor with non-zero end and link waiting + // an anchor end with time after the end of the first anchor + for (int i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -268,7 +269,7 @@ main (void) \n\ \n\ \n", - samples[i].uri, samples[i].uri)); + samples[i].uri, samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -304,13 +305,14 @@ main (void) delete fmt; } - // start in anchor with non-zero end and link waiting an anchor with end - // time the end before to the first anchor - for (int i = 0; i < samples.size (); i++) + // start in anchor with non-zero end and link waiting an anchor with end + // time the end before to the first anchor + for (int i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -337,7 +339,7 @@ main (void) \n\ \n\ \n", - samples[i].uri, samples[i].uri)); + samples[i].uri, samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -374,12 +376,13 @@ main (void) delete fmt; } - // start an anchor and start another anchor - for (int i = 0; i < samples.size (); i++) + // start an anchor and start another anchor + for (int i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc,xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -406,7 +409,7 @@ main (void) \n\ \n\ \n", - samples[i].uri, samples[i].uri)); + samples[i].uri, samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); diff --git a/tests/test-Media-explicitDur.cpp b/tests/test-Media-explicitDur.cpp index 071f3804d..eaf8fb916 100644 --- a/tests/test-Media-explicitDur.cpp +++ b/tests/test-Media-explicitDur.cpp @@ -82,8 +82,8 @@ main (void) printf ("uri=%s\n", sample.uri); Formatter *fmt; Document *doc; - tests_parse_and_start ( - &fmt, &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -99,7 +99,8 @@ main (void) \n\ \n\ \n\ - \n", sample.uri, sample.uri)); + \n", + sample.uri, sample.uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); diff --git a/tests/test-Media-focusIndex.cpp b/tests/test-Media-focusIndex.cpp index 695e10dea..6e6a41b91 100644 --- a/tests/test-Media-focusIndex.cpp +++ b/tests/test-Media-focusIndex.cpp @@ -24,8 +24,8 @@ main (void) { Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, - &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -97,7 +97,8 @@ main (void) \n\ \n\ \n\ -\n", sample.uri, sample.uri)); +\n", + sample.uri, sample.uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); diff --git a/tests/test-Media-mime.cpp b/tests/test-Media-mime.cpp index ff0c79ef1..01ebaa584 100644 --- a/tests/test-Media-mime.cpp +++ b/tests/test-Media-mime.cpp @@ -34,7 +34,8 @@ main (void) \n\ \n\ \n\ -\n", samples[i].uri)); +\n", + samples[i].uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); diff --git a/tests/test-Media-nested-explicitDur.cpp b/tests/test-Media-nested-explicitDur.cpp index c7b896ec3..a3300e5e7 100644 --- a/tests/test-Media-nested-explicitDur.cpp +++ b/tests/test-Media-nested-explicitDur.cpp @@ -105,8 +105,8 @@ main (void) printf ("uri=%s\n", sample.uri); Formatter *fmt; Document *doc; - tests_parse_and_start ( - &fmt, &doc, xstrbuild ("\ + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ \n\ \n\ \n\ @@ -125,7 +125,8 @@ main (void) \n\ \n\ \n\ - \n", sample.uri, sample.uri)); + \n", + sample.uri, sample.uri)); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); diff --git a/tests/test-Parser-parseBuffer.cpp b/tests/test-Parser-parseBuffer.cpp index b4e867a52..f0e254b30 100644 --- a/tests/test-Parser-parseBuffer.cpp +++ b/tests/test-Parser-parseBuffer.cpp @@ -1769,8 +1769,7 @@ main (void) // ------------------------------------------------------------------------- XFAIL ("switchPort: Missing id", - " at line 5: Missing attribute 'id'", - "\ + " at line 5: Missing attribute 'id'", "\ \n\ \n\ \n\ @@ -1782,8 +1781,7 @@ main (void) "); XFAIL ("mapping: Missing component", - " at line 6: Missing attribute 'component'", - "\ + " at line 6: Missing attribute 'component'", "\ \n\ \n\ \n\ @@ -1796,9 +1794,9 @@ main (void) \n\ "); -// XFAIL ("mapping: Bad component", -// " at line 6: bad value 'x'", -// "\ + // XFAIL ("mapping: Bad component", + // " at line 6: bad value 'x'", + // "\ //\n\ // \n\ // \n\ diff --git a/tests/test-Parser-parseFile.cpp b/tests/test-Parser-parseFile.cpp index 5a65da31c..88b844af4 100644 --- a/tests/test-Parser-parseFile.cpp +++ b/tests/test-Parser-parseFile.cpp @@ -34,12 +34,10 @@ main (void) nclFolders.push_back (xpathbuildabs (ABS_TOP_SRCDIR, "tests-ncl")); nclFolders.push_back ( xpathbuildabs (ABS_TOP_SRCDIR, "tests-ncl/generated")); - nclFolders.push_back ( - xpathbuildabs (ABS_TOP_SRCDIR, "examples/hrace/")); + nclFolders.push_back (xpathbuildabs (ABS_TOP_SRCDIR, "examples/hrace/")); nclFolders.push_back ( xpathbuildabs (ABS_TOP_SRCDIR, "examples/luarocks/")); - nclFolders.push_back ( - xpathbuildabs (ABS_TOP_SRCDIR, "examples/pacman/")); + nclFolders.push_back (xpathbuildabs (ABS_TOP_SRCDIR, "examples/pacman/")); nclFolders.push_back ( xpathbuildabs (ABS_TOP_SRCDIR, "examples/primeiro-joao/")); diff --git a/tests/test-ParserLua-parseBuffer.cpp b/tests/test-ParserLua-parseBuffer.cpp index d17de6879..0c871b00b 100644 --- a/tests/test-ParserLua-parseBuffer.cpp +++ b/tests/test-ParserLua-parseBuffer.cpp @@ -42,7 +42,7 @@ main (void) }\n \ }\n \ return ncl", -"lua"); + "lua"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 5); @@ -86,7 +86,7 @@ return ncl", }\n \ }\n \ return ncl", -"lua"); + "lua"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 5); @@ -131,7 +131,7 @@ return ncl", }\n \ }\n \ return ncl", -"lua"); + "lua"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 4); @@ -175,7 +175,7 @@ return ncl", }\n \ }\n \ return ncl", -"lua"); + "lua"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 3); @@ -212,7 +212,7 @@ return ncl", }\n \ }\n \ return ncl", -"lua"); + "lua"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 3); @@ -255,7 +255,7 @@ return ncl", }\n \ }\n \ return ncl", -"lua"); + "lua"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 5); diff --git a/tests/test-SigGen-transmission.cpp b/tests/test-SigGen-transmission.cpp index f06924e43..b6f52620f 100644 --- a/tests/test-SigGen-transmission.cpp +++ b/tests/test-SigGen-transmission.cpp @@ -17,16 +17,18 @@ along with Ginga. If not, see . */ #include "tests.h" #include -//sleep thread +// sleep thread #include #include -//measure time +// measure time #include #include -void bin(unsigned short v, int number[], int size) { - for(; size-1 >= 0; size--) - number[size-1] = (v >> (size-1)) & 1; +void +bin (unsigned short v, int number[], int size) +{ + for (; size - 1 >= 0; size--) + number[size - 1] = (v >> (size - 1)) & 1; } int @@ -41,7 +43,7 @@ main (void) int number[size]; - auto start = std::chrono::system_clock::now(); + auto start = std::chrono::system_clock::now (); path = xpathbuildabs ( ABS_TOP_SRCDIR, "tests-ncl/test-player-siggen-bit-13freq-150hz.ncl"); @@ -52,7 +54,8 @@ main (void) doc = fmt->getDocument (); g_assert_nonnull (doc); - short dataToSend [] = { 1, 7, 5, 4, 19, 1}; // highest number should be 2^13-1 = 4095 + short dataToSend[] + = { 1, 7, 5, 4, 19, 1 }; // highest number should be 2^13-1 = 4095 fmt->sendTick (4 * GINGA_SECOND, 4 * GINGA_SECOND, 0); @@ -87,64 +90,100 @@ main (void) // g_assert_nonnull (m13); for (int t = 0; t < size; t++) - { - number[t] = 0; - } - - for (int i = 0; i < sizeof(dataToSend)/sizeof(dataToSend[0]); i++) - { - printf("number: %d\n",dataToSend[i]); - bin(dataToSend[i],number,size); - - for (int t = 0; t < size; t++) { - printf("%d", number[t]); + number[t] = 0; } - printf("\n"); - - if (number[0]) m1->setProperty ("volume", "0.5"); else m1->setProperty ("volume", "0"); - if (number[1]) m2->setProperty ("volume", "0.5"); else m2->setProperty ("volume", "0"); - if (number[2]) m3->setProperty ("volume", "0.5"); else m3->setProperty ("volume", "0"); - if (number[3]) m4->setProperty ("volume", "0.5"); else m4->setProperty ("volume", "0"); - if (number[4]) m5->setProperty ("volume", "0.5"); else m5->setProperty ("volume", "0"); - if (number[5]) m6->setProperty ("volume", "0.5"); else m6->setProperty ("volume", "0"); - if (number[6]) m7->setProperty ("volume", "0.5"); else m7->setProperty ("volume", "0"); - if (number[7]) m8->setProperty ("volume", "0.5"); else m8->setProperty ("volume", "0"); - if (number[8]) m9->setProperty ("volume", "0.5"); else m9->setProperty ("volume", "0"); - if (number[9]) m10->setProperty ("volume", "0.5"); else m10->setProperty ("volume", "0"); - if (number[10]) m11->setProperty ("volume", "0.5"); else m11->setProperty ("volume", "0"); - if (number[11]) m12->setProperty ("volume", "0.5"); else m12->setProperty ("volume", "0"); - // if (number[13]) m13->setProperty ("volume", "0.5"); else m13->setProperty ("volume", "0"); - - std::this_thread::sleep_for(std::chrono::milliseconds(300)); - - for (int t = 0; t < size; t++) + for (int i = 0; i < sizeof (dataToSend) / sizeof (dataToSend[0]); i++) { - number[t] = 0; + printf ("number: %d\n", dataToSend[i]); + bin (dataToSend[i], number, size); + + for (int t = 0; t < size; t++) + { + printf ("%d", number[t]); + } + + printf ("\n"); + + if (number[0]) + m1->setProperty ("volume", "0.5"); + else + m1->setProperty ("volume", "0"); + if (number[1]) + m2->setProperty ("volume", "0.5"); + else + m2->setProperty ("volume", "0"); + if (number[2]) + m3->setProperty ("volume", "0.5"); + else + m3->setProperty ("volume", "0"); + if (number[3]) + m4->setProperty ("volume", "0.5"); + else + m4->setProperty ("volume", "0"); + if (number[4]) + m5->setProperty ("volume", "0.5"); + else + m5->setProperty ("volume", "0"); + if (number[5]) + m6->setProperty ("volume", "0.5"); + else + m6->setProperty ("volume", "0"); + if (number[6]) + m7->setProperty ("volume", "0.5"); + else + m7->setProperty ("volume", "0"); + if (number[7]) + m8->setProperty ("volume", "0.5"); + else + m8->setProperty ("volume", "0"); + if (number[8]) + m9->setProperty ("volume", "0.5"); + else + m9->setProperty ("volume", "0"); + if (number[9]) + m10->setProperty ("volume", "0.5"); + else + m10->setProperty ("volume", "0"); + if (number[10]) + m11->setProperty ("volume", "0.5"); + else + m11->setProperty ("volume", "0"); + if (number[11]) + m12->setProperty ("volume", "0.5"); + else + m12->setProperty ("volume", "0"); + // if (number[13]) m13->setProperty ("volume", "0.5"); else + // m13->setProperty ("volume", "0"); + + std::this_thread::sleep_for (std::chrono::milliseconds (300)); + + for (int t = 0; t < size; t++) + { + number[t] = 0; + } + + m1->setProperty ("volume", "0"); + m2->setProperty ("volume", "0"); + m3->setProperty ("volume", "0"); + m4->setProperty ("volume", "0"); + m5->setProperty ("volume", "0"); + m6->setProperty ("volume", "0"); + m7->setProperty ("volume", "0"); + m8->setProperty ("volume", "0"); + m9->setProperty ("volume", "0"); + m10->setProperty ("volume", "0"); + m11->setProperty ("volume", "0"); + m12->setProperty ("volume", "0"); + + std::this_thread::sleep_for (std::chrono::milliseconds (50)); } - m1->setProperty ("volume", "0"); - m2->setProperty ("volume", "0"); - m3->setProperty ("volume", "0"); - m4->setProperty ("volume", "0"); - m5->setProperty ("volume", "0"); - m6->setProperty ("volume", "0"); - m7->setProperty ("volume", "0"); - m8->setProperty ("volume", "0"); - m9->setProperty ("volume", "0"); - m10->setProperty ("volume", "0"); - m11->setProperty ("volume", "0"); - m12->setProperty ("volume", "0"); - - std::this_thread::sleep_for(std::chrono::milliseconds(50)); - - } - - auto end = std::chrono::system_clock::now(); - std::chrono::duration elapsed_seconds = end-start; + auto end = std::chrono::system_clock::now (); + std::chrono::duration elapsed_seconds = end - start; - std::cout << "elapsed time: " << elapsed_seconds.count() << "s\n"; + std::cout << "elapsed time: " << elapsed_seconds.count () << "s\n"; while (true) ; From 1535a24b8ca91ffe3fd24dcb22993eb15ab6eae2 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 15:29:57 -0300 Subject: [PATCH 022/169] tests: Test Predicate::getParent() --- tests/test-Predicate-new.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-Predicate-new.cpp b/tests/test-Predicate-new.cpp index ffc11ed5e..c4a987ecb 100644 --- a/tests/test-Predicate-new.cpp +++ b/tests/test-Predicate-new.cpp @@ -135,11 +135,13 @@ main (void) child1->setTest ("a", Predicate::EQ, "a"); pred->addChild (child1); g_assert (pred->getChildren ()->size () == 1); + g_assert (child1->getParent () == pred); child2 = new Predicate (Predicate::ATOM); child2->setTest ("b", Predicate::EQ, "b"); pred->addChild (child2); g_assert (pred->getChildren ()->size () == 2); + g_assert (child2->getParent () == pred); delete pred; } From 4e65bff6cf2b203fcce00986b5dff6873be7ef92 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 15:39:09 -0300 Subject: [PATCH 023/169] src-gui: Use ncl-app.xml from the ginga code folder --- src-gui/Makefile.am | 1 + src-gui/view/BigPictureWindow.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src-gui/Makefile.am b/src-gui/Makefile.am index 8edfb29c5..bd5579d73 100644 --- a/src-gui/Makefile.am +++ b/src-gui/Makefile.am @@ -21,6 +21,7 @@ include $(top_srcdir)/build-aux/Makefile.am.common SUBDIRS= icons style AM_CPPFLAGS= -I$(top_srcdir)/lib -I$(top_builddir)/lib\ + -DABS_TOP_SRCDIR=\"$(abs_top_srcdir)\"\ -DGINGADATADIR=\"$(gingadatadir)\" AM_CXXFLAGS= $(CAIRO_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(SOUP_CFLAGS) AM_LDFLAGS= $(CAIRO_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(SOUP_LIBS) diff --git a/src-gui/view/BigPictureWindow.cpp b/src-gui/view/BigPictureWindow.cpp index 8c7b6bb4b..ac62db247 100644 --- a/src-gui/view/BigPictureWindow.cpp +++ b/src-gui/view/BigPictureWindow.cpp @@ -142,7 +142,7 @@ bool loadApplicationsXML () { const char *docname - = g_strdup ("/Users/antoniobusson/git/ginga/src-gui/ncl-apps.xml"); + = g_strdup (ABS_TOP_SRCDIR"/src-gui/ncl-apps.xml"); xmlDocPtr doc; xmlNodePtr cur; From 8fdbada7db8c1d44340ec4c594279abe885974dd Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 15:39:34 -0300 Subject: [PATCH 024/169] examples: Fetch vivamais-alim --- examples/fetch.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/fetch.sh b/examples/fetch.sh index ac9c66b93..846975b84 100755 --- a/examples/fetch.sh +++ b/examples/fetch.sh @@ -26,6 +26,7 @@ APPS="$APPS proderj" APPS="$APPS velha" APPS="$APPS velha" APPS="$APPS vivamais-peso" +APPS="$APPS vivamais-alim" URI=http://www.telemidia.puc-rio.br/~gflima/misc/nclapps URI_PATCHS=https://raw.githubusercontent.com/andrelbd1/ginga_aplications/master/ From 33386930a08f0fd5ba6693e96ed63c0ad538aeb2 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 15:53:43 -0300 Subject: [PATCH 025/169] tests-ncl: Rename some player tests --- ...layer-lua-random-property.ncl => test-lua-random-property.ncl} | 0 ...r-txt-font-properties-1.ncl => test-txt-font-properties-1.ncl} | 0 ...r-txt-font-properties-2.ncl => test-txt-font-properties-2.ncl} | 0 .../{test-player-video-volume.ncl => test-video-set-volume-2.ncl} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename tests-ncl/{test-player-lua-random-property.ncl => test-lua-random-property.ncl} (100%) rename tests-ncl/{test-player-txt-font-properties-1.ncl => test-txt-font-properties-1.ncl} (100%) rename tests-ncl/{test-player-txt-font-properties-2.ncl => test-txt-font-properties-2.ncl} (100%) rename tests-ncl/{test-player-video-volume.ncl => test-video-set-volume-2.ncl} (100%) diff --git a/tests-ncl/test-player-lua-random-property.ncl b/tests-ncl/test-lua-random-property.ncl similarity index 100% rename from tests-ncl/test-player-lua-random-property.ncl rename to tests-ncl/test-lua-random-property.ncl diff --git a/tests-ncl/test-player-txt-font-properties-1.ncl b/tests-ncl/test-txt-font-properties-1.ncl similarity index 100% rename from tests-ncl/test-player-txt-font-properties-1.ncl rename to tests-ncl/test-txt-font-properties-1.ncl diff --git a/tests-ncl/test-player-txt-font-properties-2.ncl b/tests-ncl/test-txt-font-properties-2.ncl similarity index 100% rename from tests-ncl/test-player-txt-font-properties-2.ncl rename to tests-ncl/test-txt-font-properties-2.ncl diff --git a/tests-ncl/test-player-video-volume.ncl b/tests-ncl/test-video-set-volume-2.ncl similarity index 100% rename from tests-ncl/test-player-video-volume.ncl rename to tests-ncl/test-video-set-volume-2.ncl From 079a19a29c0d92533f190daf4cb3a7d8039c668d Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 16:10:27 -0300 Subject: [PATCH 026/169] tests-ncl: Code format siggen tests --- .../test-player-siggen-bit-10freq-150hz.ncl | 6 +++--- .../test-player-siggen-bit-10freq-200hz.ncl | 6 +++--- .../test-player-siggen-bit-13freq-100hz.ncl | 6 +++--- .../test-player-siggen-bit-13freq-150hz.ncl | 6 +++--- .../test-player-siggen-bit-4freq-200hz.ncl | 6 +++--- .../test-player-siggen-bit-8freq-150hz.ncl | 6 +++--- .../test-player-siggen-bit-8freq-200hz.ncl | 6 +++--- .../test-player-siggen-bit-9freq-200hz.ncl | 6 +++--- tests-ncl/test-player-siggen-bit.ncl | 6 +++--- tests-ncl/test-player-siggen-wave.ncl | 18 +++++++----------- 10 files changed, 34 insertions(+), 38 deletions(-) diff --git a/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl b/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl index 2374a78dc..50aa61128 100644 --- a/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl +++ b/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl b/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl index 143a5cd4a..5d7a15ea3 100644 --- a/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl +++ b/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl b/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl index 14db4fbaf..f6d356cfb 100644 --- a/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl +++ b/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl b/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl index 1f419d7dd..70722124b 100644 --- a/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl +++ b/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl b/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl index c1f49d98d..171a4ed97 100644 --- a/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl +++ b/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl b/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl index eed8b2491..5738db26e 100644 --- a/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl +++ b/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl b/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl index 22553e928..1a6329291 100644 --- a/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl +++ b/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl b/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl index 764c66cf2..9c250e131 100644 --- a/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl +++ b/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-bit.ncl b/tests-ncl/test-player-siggen-bit.ncl index 3bf2914bb..0850f62b4 100644 --- a/tests-ncl/test-player-siggen-bit.ncl +++ b/tests-ncl/test-player-siggen-bit.ncl @@ -2,9 +2,9 @@ - - - + + + diff --git a/tests-ncl/test-player-siggen-wave.ncl b/tests-ncl/test-player-siggen-wave.ncl index 7a9c58ef6..050aa1b92 100644 --- a/tests-ncl/test-player-siggen-wave.ncl +++ b/tests-ncl/test-player-siggen-wave.ncl @@ -1,13 +1,9 @@ - - - - - - - - - - - + + + + + + + \ No newline at end of file From d2115dde62de74656cc041cb618613db145d9c3f Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 16:13:56 -0300 Subject: [PATCH 027/169] tests-ncl: Rename siggen tests --- ...en-bit-10freq-150hz.ncl => test-siggen-bit-10freq-150hz.ncl} | 0 ...en-bit-10freq-200hz.ncl => test-siggen-bit-10freq-200hz.ncl} | 0 ...en-bit-13freq-100hz.ncl => test-siggen-bit-13freq-100hz.ncl} | 0 ...en-bit-13freq-150hz.ncl => test-siggen-bit-13freq-150hz.ncl} | 0 ...ggen-bit-4freq-200hz.ncl => test-siggen-bit-4freq-200hz.ncl} | 0 ...ggen-bit-8freq-150hz.ncl => test-siggen-bit-8freq-150hz.ncl} | 0 ...ggen-bit-8freq-200hz.ncl => test-siggen-bit-8freq-200hz.ncl} | 0 ...ggen-bit-9freq-200hz.ncl => test-siggen-bit-9freq-200hz.ncl} | 0 tests-ncl/{test-player-siggen-bit.ncl => test-siggen-bit.ncl} | 0 tests-ncl/{test-player-siggen-freq.ncl => test-siggen-freq.ncl} | 0 .../{test-player-siggen-start.ncl => test-siggen-start.ncl} | 0 .../{test-player-siggen-volume.ncl => test-siggen-volume.ncl} | 0 tests-ncl/{test-player-siggen-wave.ncl => test-siggen-wave.ncl} | 0 tests/test-SigGen-transmission.cpp | 2 +- 14 files changed, 1 insertion(+), 1 deletion(-) rename tests-ncl/{test-player-siggen-bit-10freq-150hz.ncl => test-siggen-bit-10freq-150hz.ncl} (100%) rename tests-ncl/{test-player-siggen-bit-10freq-200hz.ncl => test-siggen-bit-10freq-200hz.ncl} (100%) rename tests-ncl/{test-player-siggen-bit-13freq-100hz.ncl => test-siggen-bit-13freq-100hz.ncl} (100%) rename tests-ncl/{test-player-siggen-bit-13freq-150hz.ncl => test-siggen-bit-13freq-150hz.ncl} (100%) rename tests-ncl/{test-player-siggen-bit-4freq-200hz.ncl => test-siggen-bit-4freq-200hz.ncl} (100%) rename tests-ncl/{test-player-siggen-bit-8freq-150hz.ncl => test-siggen-bit-8freq-150hz.ncl} (100%) rename tests-ncl/{test-player-siggen-bit-8freq-200hz.ncl => test-siggen-bit-8freq-200hz.ncl} (100%) rename tests-ncl/{test-player-siggen-bit-9freq-200hz.ncl => test-siggen-bit-9freq-200hz.ncl} (100%) rename tests-ncl/{test-player-siggen-bit.ncl => test-siggen-bit.ncl} (100%) rename tests-ncl/{test-player-siggen-freq.ncl => test-siggen-freq.ncl} (100%) rename tests-ncl/{test-player-siggen-start.ncl => test-siggen-start.ncl} (100%) rename tests-ncl/{test-player-siggen-volume.ncl => test-siggen-volume.ncl} (100%) rename tests-ncl/{test-player-siggen-wave.ncl => test-siggen-wave.ncl} (100%) diff --git a/tests-ncl/test-player-siggen-bit-10freq-150hz.ncl b/tests-ncl/test-siggen-bit-10freq-150hz.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit-10freq-150hz.ncl rename to tests-ncl/test-siggen-bit-10freq-150hz.ncl diff --git a/tests-ncl/test-player-siggen-bit-10freq-200hz.ncl b/tests-ncl/test-siggen-bit-10freq-200hz.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit-10freq-200hz.ncl rename to tests-ncl/test-siggen-bit-10freq-200hz.ncl diff --git a/tests-ncl/test-player-siggen-bit-13freq-100hz.ncl b/tests-ncl/test-siggen-bit-13freq-100hz.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit-13freq-100hz.ncl rename to tests-ncl/test-siggen-bit-13freq-100hz.ncl diff --git a/tests-ncl/test-player-siggen-bit-13freq-150hz.ncl b/tests-ncl/test-siggen-bit-13freq-150hz.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit-13freq-150hz.ncl rename to tests-ncl/test-siggen-bit-13freq-150hz.ncl diff --git a/tests-ncl/test-player-siggen-bit-4freq-200hz.ncl b/tests-ncl/test-siggen-bit-4freq-200hz.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit-4freq-200hz.ncl rename to tests-ncl/test-siggen-bit-4freq-200hz.ncl diff --git a/tests-ncl/test-player-siggen-bit-8freq-150hz.ncl b/tests-ncl/test-siggen-bit-8freq-150hz.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit-8freq-150hz.ncl rename to tests-ncl/test-siggen-bit-8freq-150hz.ncl diff --git a/tests-ncl/test-player-siggen-bit-8freq-200hz.ncl b/tests-ncl/test-siggen-bit-8freq-200hz.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit-8freq-200hz.ncl rename to tests-ncl/test-siggen-bit-8freq-200hz.ncl diff --git a/tests-ncl/test-player-siggen-bit-9freq-200hz.ncl b/tests-ncl/test-siggen-bit-9freq-200hz.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit-9freq-200hz.ncl rename to tests-ncl/test-siggen-bit-9freq-200hz.ncl diff --git a/tests-ncl/test-player-siggen-bit.ncl b/tests-ncl/test-siggen-bit.ncl similarity index 100% rename from tests-ncl/test-player-siggen-bit.ncl rename to tests-ncl/test-siggen-bit.ncl diff --git a/tests-ncl/test-player-siggen-freq.ncl b/tests-ncl/test-siggen-freq.ncl similarity index 100% rename from tests-ncl/test-player-siggen-freq.ncl rename to tests-ncl/test-siggen-freq.ncl diff --git a/tests-ncl/test-player-siggen-start.ncl b/tests-ncl/test-siggen-start.ncl similarity index 100% rename from tests-ncl/test-player-siggen-start.ncl rename to tests-ncl/test-siggen-start.ncl diff --git a/tests-ncl/test-player-siggen-volume.ncl b/tests-ncl/test-siggen-volume.ncl similarity index 100% rename from tests-ncl/test-player-siggen-volume.ncl rename to tests-ncl/test-siggen-volume.ncl diff --git a/tests-ncl/test-player-siggen-wave.ncl b/tests-ncl/test-siggen-wave.ncl similarity index 100% rename from tests-ncl/test-player-siggen-wave.ncl rename to tests-ncl/test-siggen-wave.ncl diff --git a/tests/test-SigGen-transmission.cpp b/tests/test-SigGen-transmission.cpp index b6f52620f..d7ed29df2 100644 --- a/tests/test-SigGen-transmission.cpp +++ b/tests/test-SigGen-transmission.cpp @@ -46,7 +46,7 @@ main (void) auto start = std::chrono::system_clock::now (); path = xpathbuildabs ( - ABS_TOP_SRCDIR, "tests-ncl/test-player-siggen-bit-13freq-150hz.ncl"); + ABS_TOP_SRCDIR, "tests-ncl/test-siggen-bit-13freq-150hz.ncl"); fmt = new Formatter (nullptr); g_assert_nonnull (fmt); From 56324a52521f3a1ee8098d3f8c34e0947b6ad4bc Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 16:15:11 -0300 Subject: [PATCH 028/169] tests-ncl: Rename empty tests --- tests-ncl/{test-misc-empty-body.ncl => test-empty-body.ncl} | 0 tests-ncl/{test-misc-empty-doc.ncl => test-empty-doc.ncl} | 0 tests-ncl/test-import-region.ncl | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename tests-ncl/{test-misc-empty-body.ncl => test-empty-body.ncl} (100%) rename tests-ncl/{test-misc-empty-doc.ncl => test-empty-doc.ncl} (100%) diff --git a/tests-ncl/test-misc-empty-body.ncl b/tests-ncl/test-empty-body.ncl similarity index 100% rename from tests-ncl/test-misc-empty-body.ncl rename to tests-ncl/test-empty-body.ncl diff --git a/tests-ncl/test-misc-empty-doc.ncl b/tests-ncl/test-empty-doc.ncl similarity index 100% rename from tests-ncl/test-misc-empty-doc.ncl rename to tests-ncl/test-empty-doc.ncl diff --git a/tests-ncl/test-import-region.ncl b/tests-ncl/test-import-region.ncl index 2a53878db..ab6485868 100644 --- a/tests-ncl/test-import-region.ncl +++ b/tests-ncl/test-import-region.ncl @@ -1,7 +1,7 @@ - + From f090ad0831f0f58fae300974de53b747cb4113b7 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 28 Mar 2018 18:51:59 -0300 Subject: [PATCH 029/169] tests: Add test-Siggen-new --- .gitignore | 1 + tests/Makefile.am | 4 ++ tests/test-Media-mime.cpp | 1 - tests/test-Siggen-new.cpp | 132 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 tests/test-Siggen-new.cpp diff --git a/.gitignore b/.gitignore index b493eb414..f88975114 100644 --- a/.gitignore +++ b/.gitignore @@ -157,6 +157,7 @@ /tests/test-Media-anchors-started-from-links /tests/test-MediaSettings-instances /tests/test-MediaSettings-new +/tests/test-Siggen-new /tests/test-Object-addAlias /tests/test-Object-addEvent /tests/test-Parser-parseBuffer diff --git a/tests/Makefile.am b/tests/Makefile.am index 202c5c325..3b0633566 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -279,6 +279,10 @@ test_Object_addAlias_SOURCES= test-Object-addAlias.cpp progs+= test-Object-addEvent test_Object_addEvent_SOURCES= test-Object-addEvent.cpp +# lib/PlayerSiggen.h ------------------------------------------------------- +progs+= test-Siggen-new +test_Siggen_new_SOURCES= test-Siggen-new.cpp + # lib/Media.h -------------------------------------------------------------- progs+= test-Media-new test_Media_new_SOURCES= test-Media-new.cpp diff --git a/tests/test-Media-mime.cpp b/tests/test-Media-mime.cpp index 01ebaa584..6897b822f 100644 --- a/tests/test-Media-mime.cpp +++ b/tests/test-Media-mime.cpp @@ -24,7 +24,6 @@ main (void) { for (int i = 2; i < samples.size (); i++) { - printf ("### %s\n", samples[i].uri); Formatter *fmt; Document *doc; Player *p; diff --git a/tests/test-Siggen-new.cpp b/tests/test-Siggen-new.cpp new file mode 100644 index 000000000..8c7786d35 --- /dev/null +++ b/tests/test-Siggen-new.cpp @@ -0,0 +1,132 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + + Formatter *fmt; + Document *doc; + Player *p; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + + Media *m1 = cast (Media *, body->getChildById ("m")); + g_assert_nonnull (m1); + Media *m2 = cast (Media *, body->getChildById ("m2")); + g_assert_nonnull (m2); + Media *m3 = cast (Media *, body->getChildById ("m3")); + g_assert_nonnull (m3); + Media *m4 = cast (Media *, body->getChildById ("m4")); + g_assert_nonnull (m4); + Media *m5 = cast (Media *, body->getChildById ("m5")); + g_assert_nonnull (m5); + Media *m6 = cast (Media *, body->getChildById ("m6")); + g_assert_nonnull (m6); + Media *m7 = cast (Media *, body->getChildById ("m7")); + g_assert_nonnull (m7); + Media *m8 = cast (Media *, body->getChildById ("m8")); + g_assert_nonnull (m8); + Media *m9 = cast (Media *, body->getChildById ("m9")); + g_assert_nonnull (m9); + Media *m10 = cast (Media *, body->getChildById ("m10")); + g_assert_nonnull (m10); + Media *m11 = cast (Media *, body->getChildById ("m11")); + g_assert_nonnull (m11); + Media *m12 = cast (Media *, body->getChildById ("m12")); + g_assert_nonnull (m12); + Media *m13 = cast (Media *, body->getChildById ("m13")); + g_assert_nonnull (m12); + + delete fmt; + + exit (EXIT_SUCCESS); +} From 8ddec5eded03629b19c9782aa61960eb9fdb9b07 Mon Sep 17 00:00:00 2001 From: Jorge Pumar Dodsworth Date: Mon, 2 Apr 2018 09:51:22 -0300 Subject: [PATCH 030/169] maint: fix missing action predicate --- lib/ParserLua.cpp | 7 +- tests/test-ParserLua-parseBuffer.cpp | 117 ++++++++++++++++++--------- 2 files changed, 82 insertions(+), 42 deletions(-) diff --git a/lib/ParserLua.cpp b/lib/ParserLua.cpp index 60410837e..2cb95a269 100644 --- a/lib/ParserLua.cpp +++ b/lib/ParserLua.cpp @@ -31,7 +31,6 @@ GINGA_END_DECLS GINGA_NAMESPACE_BEGIN // TODO: -// switch // make l_parse_children to avoid duplicated code // remember to test if property exist before adding to document // make maps<> to help parsing and avoid big if/case @@ -570,7 +569,7 @@ l_parse_link (lua_State *L) luaL_checktype (L, 3, LUA_TTABLE); - lua_rawgeti (L, 3, 1); // condition list + lua_rawgeti (L, 3, 1); // condition table luaL_checktype (L, 4, LUA_TTABLE); lua_pushnil (L); while (lua_next (L, 4) != 0) @@ -609,7 +608,7 @@ l_parse_link (lua_State *L) lua_pop (L, 4); } - lua_rawgeti (L, 3, 2); // action list + lua_rawgeti (L, 3, 2); // action table luaL_checktype (L, 5, LUA_TTABLE); lua_pushnil (L); while (lua_next (L, 5) != 0) @@ -653,6 +652,8 @@ l_parse_link (lua_State *L) lua_pop (L, 2); } + act.predicate = nullptr; + actions.push_back (act); lua_pop (L, 5); } diff --git a/tests/test-ParserLua-parseBuffer.cpp b/tests/test-ParserLua-parseBuffer.cpp index 0c871b00b..360c7c289 100644 --- a/tests/test-ParserLua-parseBuffer.cpp +++ b/tests/test-ParserLua-parseBuffer.cpp @@ -17,32 +17,54 @@ #include "tests.h" +static Document * +check_success (const string &log, const string &buf) +{ + static int i = 1; + Document *doc; + string msg = ""; + + g_printerr ("PASS #%d: %s\n", i++, log.c_str ()); + doc = ParserLua::parseBuffer (buf.c_str (), buf.length (), &msg); + if (msg != "") + { + g_printerr ("*** Unexpected error: %s", msg.c_str ()); + g_assert_not_reached (); + } + return doc; +} + +#define PASS(obj, log, str) \ + G_STMT_START \ + { \ + tryset (obj, check_success ((log), (str))); \ + g_assert_nonnull (*(obj)); \ + } \ + G_STMT_END + // Remember to do more thorough testing on every component int main (void) { - Formatter *fmt; - // ------------------------------------------------------------------------- // Sanity checks. // ------------------------------------------------------------------------- // Success: Context { - Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, "ncl =\ -{'context', 'ncl', nil,\n \ + PASS (&doc, "Context check", "ncl =\ +{'context', 'ncl',\n \ + {'m2@lambda'},\n \ {\n \ {'context', 'c1', nil,\n \ {{'media', 'm1'}}},\n \ {'media', 'm2'}\n \ }\n \ }\n \ -return ncl", - "lua"); +return ncl"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 5); @@ -74,31 +96,39 @@ return ncl", // Success: Switch { - Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, "ncl =\ + PASS (&doc, "Switch check", "ncl =\ {'context', 'ncl', nil,\n \ {\n \ {'switch', 's1',\n \ - {{'media', 'm1'}}},\n \ + {\n \ + {'media', 'm1'},\n \ + {'context', 'c1'},\n \ + {'switch', 's2'}\n \ + }\n \ + },\n \ {'media', 'm2'}\n \ }\n \ }\n \ -return ncl", - "lua"); +return ncl"); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 5); + g_assert (doc->getObjects ()->size () == 7); g_assert (doc->getMedias ()->size () == 3); - g_assert (doc->getContexts ()->size () == 1); - g_assert (doc->getSwitches ()->size () == 1); + g_assert (doc->getContexts ()->size () == 2); + g_assert (doc->getSwitches ()->size () == 2); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); Event *body_lambda = body->getLambda (); g_assert_nonnull (body_lambda); + Media *m2 = cast (Media *, body->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + Switch *s1 = cast (Switch *, body->getChildById ("s1")); g_assert_nonnull (s1); Event *s1_lambda = s1->getLambda (); @@ -109,10 +139,15 @@ return ncl", Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); - Media *m2 = cast (Media *, body->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); + Context *c1 = cast (Context *, s1->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Switch *s2 = cast (Switch *, s1->getChildById ("s2")); + g_assert_nonnull (s2); + Event *s2_lambda = s2->getLambda (); + g_assert_nonnull (s2_lambda); delete doc; } @@ -121,17 +156,23 @@ return ncl", { Document *doc; - tests_parse_and_start (&fmt, &doc, "ncl =\ + PASS (&doc, "Media check", "ncl =\ {'context', 'ncl', nil,\n \ {\n \ - {'media', 'm1'},\n \ + {'media', 'm1',\n \ + {src='path/to/file.txt',\n \ + transIn={type='barWipe',\n \ + dur='1s'},\n \ + transOut={type='barWipe',\n \ + dur='1s'}\n \ + }\n \ + },\n \ {'media', 'm2', nil,\n \ {a1={'5s', '8s'},\n \ a2={'1s', nil}}}\n \ }\n \ }\n \ -return ncl", - "lua"); +return ncl"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 4); @@ -164,18 +205,17 @@ return ncl", { Document *doc; - tests_parse_and_start (&fmt, &doc, "ncl = \ + PASS (&doc, "Link check", "ncl = \ {'context', 'ncl', nil,\n \ {\n \ {'media', 'm1'},\n \ },\n \ - {\n \ - {{{'start', 'm1@lambda', {true}}},\n \ - {{'stop', 'm1@lambda'}}}\n \ - }\n \ + {{\n \ + {{'start', 'm1@lambda', {true}}},\n \ + {{'stop', 'm1@lambda'}}\n \ + }}\n \ }\n \ -return ncl", - "lua"); +return ncl"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 3); @@ -201,18 +241,19 @@ return ncl", { Document *doc; - tests_parse_and_start (&fmt, &doc, "ncl = \ + PASS (&doc, "Predicate check", "ncl = \ {'context', 'ncl', nil,\n \ {\n \ {'media', 'm1'},\n \ },\n \ {\n \ - {{{'start', 'm1@lambda', {true}}},\n \ + {{{'start', 'm1@lambda',\n \ + {'or', {'2', '>=', '1'}, {true}}\n \ + }},\n \ {{'stop', 'm1@lambda'}}}\n \ }\n \ }\n \ -return ncl", - "lua"); +return ncl"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 3); @@ -234,17 +275,16 @@ return ncl", list cond = body->getLinks ()->front ().first; Predicate *pred = cond.front ().predicate; - g_assert (pred->getType () == Predicate::VERUM); + g_assert (pred->getType () == Predicate::DISJUNCTION); delete doc; } // Success: Switch rule { - Formatter *fmt; Document *doc; - tests_parse_and_start (&fmt, &doc, "ncl =\ + PASS (&doc, "Switch rule check", "ncl =\ {'context', 'ncl', nil,\n \ {\n \ {'switch', 's1',\n \ @@ -254,8 +294,7 @@ return ncl", {'media', 'm2'}\n \ }\n \ }\n \ -return ncl", - "lua"); +return ncl"); g_assert_nonnull (doc); g_assert (doc->getObjects ()->size () == 5); From 67659e09ac61ffe152ef9469e62d0b3271e9dd47 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 10:13:57 -0300 Subject: [PATCH 031/169] tests-ncl: Refactory focusIndex ncl tests --- .../generated/test-media-focusIndex.ncl.in | 30 +++++++++-- tests-ncl/test-focusIndex-no-settings.ncl | 28 ---------- tests-ncl/test-focusIndex.ncl | 51 ------------------- 3 files changed, 27 insertions(+), 82 deletions(-) delete mode 100644 tests-ncl/test-focusIndex-no-settings.ncl delete mode 100644 tests-ncl/test-focusIndex.ncl diff --git a/tests-ncl/generated/test-media-focusIndex.ncl.in b/tests-ncl/generated/test-media-focusIndex.ncl.in index 5764b7dc6..abef7bb39 100644 --- a/tests-ncl/generated/test-media-focusIndex.ncl.in +++ b/tests-ncl/generated/test-media-focusIndex.ncl.in @@ -16,7 +16,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -49,24 +49,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/tests-ncl/test-focusIndex-no-settings.ncl b/tests-ncl/test-focusIndex-no-settings.ncl deleted file mode 100644 index 61a420547..000000000 --- a/tests-ncl/test-focusIndex-no-settings.ncl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-focusIndex.ncl b/tests-ncl/test-focusIndex.ncl deleted file mode 100644 index 563f7e262..000000000 --- a/tests-ncl/test-focusIndex.ncl +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From c25668c754b1739ab21194e031cc9de78a53ca1d Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 11:13:42 -0300 Subject: [PATCH 032/169] test-ncl: Add sym link to ../samples in test-ncl/generated/ --- tests-ncl/generated/samples | 1 + 1 file changed, 1 insertion(+) create mode 120000 tests-ncl/generated/samples diff --git a/tests-ncl/generated/samples b/tests-ncl/generated/samples new file mode 120000 index 000000000..18cd9a30a --- /dev/null +++ b/tests-ncl/generated/samples @@ -0,0 +1 @@ +../samples/ \ No newline at end of file From 719eff2482b4a9756a111e282db50638e1fb9edb Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 11:34:53 -0300 Subject: [PATCH 033/169] test-ncl: Fix 4grid regions order --- tests-ncl/generated/test-media-4grid.ncl.in | 8 ++++---- tests-ncl/test-empty-body.ncl | 8 ++++---- tests-ncl/test-video-4grid.ncl | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests-ncl/generated/test-media-4grid.ncl.in b/tests-ncl/generated/test-media-4grid.ncl.in index 204a5cd9f..2c1a58bd1 100644 --- a/tests-ncl/generated/test-media-4grid.ncl.in +++ b/tests-ncl/generated/test-media-4grid.ncl.in @@ -1,10 +1,10 @@ - - - - + + + + diff --git a/tests-ncl/test-empty-body.ncl b/tests-ncl/test-empty-body.ncl index d82217906..e15771644 100644 --- a/tests-ncl/test-empty-body.ncl +++ b/tests-ncl/test-empty-body.ncl @@ -1,10 +1,10 @@ - - - - + + + + diff --git a/tests-ncl/test-video-4grid.ncl b/tests-ncl/test-video-4grid.ncl index 675b4e03c..172b1daad 100644 --- a/tests-ncl/test-video-4grid.ncl +++ b/tests-ncl/test-video-4grid.ncl @@ -1,10 +1,10 @@ - - - - + + + + @@ -21,7 +21,7 @@ - + From 8f61fb4c5aeafe8e5955c3c74793905ea2dd71f1 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 11:36:13 -0300 Subject: [PATCH 034/169] tests-ncl: Add a nested media in test-media-stop-self.ncl.in --- .../generated/test-media-stop-self.ncl.in | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/tests-ncl/generated/test-media-stop-self.ncl.in b/tests-ncl/generated/test-media-stop-self.ncl.in index bb60624ba..091032a5c 100644 --- a/tests-ncl/generated/test-media-stop-self.ncl.in +++ b/tests-ncl/generated/test-media-stop-self.ncl.in @@ -1,5 +1,17 @@ + + + + + + + + + + + + @@ -9,13 +21,22 @@ - + + + - + + + + + + + + - + \ No newline at end of file From 35ae3013fa29780715296d471b4ae115f6cfd9aa Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 11:37:37 -0300 Subject: [PATCH 035/169] tests-ncl: Remove naturalend tests, already covered by generated/test-media-stop-self.ncl.in --- tests-ncl/test-body-naturalend.ncl | 20 ------------- tests-ncl/test-ctx-naturalend-1.ncl | 20 ------------- tests-ncl/test-ctx-naturalend-2.ncl | 35 ---------------------- tests-ncl/test-ctx-nested-naturalend.ncl | 38 ------------------------ 4 files changed, 113 deletions(-) delete mode 100644 tests-ncl/test-body-naturalend.ncl delete mode 100644 tests-ncl/test-ctx-naturalend-1.ncl delete mode 100644 tests-ncl/test-ctx-naturalend-2.ncl delete mode 100644 tests-ncl/test-ctx-nested-naturalend.ncl diff --git a/tests-ncl/test-body-naturalend.ncl b/tests-ncl/test-body-naturalend.ncl deleted file mode 100644 index 19d447eec..000000000 --- a/tests-ncl/test-body-naturalend.ncl +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-ctx-naturalend-1.ncl b/tests-ncl/test-ctx-naturalend-1.ncl deleted file mode 100644 index 91c080793..000000000 --- a/tests-ncl/test-ctx-naturalend-1.ncl +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-ctx-naturalend-2.ncl b/tests-ncl/test-ctx-naturalend-2.ncl deleted file mode 100644 index d6810e059..000000000 --- a/tests-ncl/test-ctx-naturalend-2.ncl +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-ctx-nested-naturalend.ncl b/tests-ncl/test-ctx-nested-naturalend.ncl deleted file mode 100644 index 6ee55f20b..000000000 --- a/tests-ncl/test-ctx-nested-naturalend.ncl +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From f35a3647ce7313aed39fcf92d6f6f8c811e1af47 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 11:49:27 -0300 Subject: [PATCH 036/169] tests-ncl: Remove one region descriptor by bounds property --- tests-ncl/generated/test-media-anim-dimensions.ncl.in | 9 ++------- tests-ncl/generated/test-media-dimensions.ncl.in | 9 ++------- tests-ncl/test-txt-font-properties-2.ncl | 9 ++------- tests-ncl/test-video-set-volume-2.ncl | 8 +------- 4 files changed, 7 insertions(+), 28 deletions(-) diff --git a/tests-ncl/generated/test-media-anim-dimensions.ncl.in b/tests-ncl/generated/test-media-anim-dimensions.ncl.in index 751bbbc08..9b24120f6 100644 --- a/tests-ncl/generated/test-media-anim-dimensions.ncl.in +++ b/tests-ncl/generated/test-media-anim-dimensions.ncl.in @@ -1,11 +1,5 @@ - - - - - - @@ -17,7 +11,8 @@ - + + diff --git a/tests-ncl/generated/test-media-dimensions.ncl.in b/tests-ncl/generated/test-media-dimensions.ncl.in index eee07ebe9..3107965b3 100644 --- a/tests-ncl/generated/test-media-dimensions.ncl.in +++ b/tests-ncl/generated/test-media-dimensions.ncl.in @@ -1,11 +1,5 @@ - - - - - - @@ -16,7 +10,8 @@ - + + diff --git a/tests-ncl/test-txt-font-properties-2.ncl b/tests-ncl/test-txt-font-properties-2.ncl index 8d4136f9a..fab534d4c 100644 --- a/tests-ncl/test-txt-font-properties-2.ncl +++ b/tests-ncl/test-txt-font-properties-2.ncl @@ -1,11 +1,5 @@ - - - - - - @@ -16,7 +10,8 @@ - + + diff --git a/tests-ncl/test-video-set-volume-2.ncl b/tests-ncl/test-video-set-volume-2.ncl index aa03da980..345492de9 100644 --- a/tests-ncl/test-video-set-volume-2.ncl +++ b/tests-ncl/test-video-set-volume-2.ncl @@ -1,11 +1,5 @@ - - - - - - @@ -16,7 +10,7 @@ - + From d824dfcf8a876fc2842dcaaa9c1d175c1cf36db8 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 11:51:31 -0300 Subject: [PATCH 037/169] tests-ncl: Remove test-switch-simple.ncl covered by test-switch-dynamic-keys.ncl --- tests-ncl/test-switch-simple.ncl | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 tests-ncl/test-switch-simple.ncl diff --git a/tests-ncl/test-switch-simple.ncl b/tests-ncl/test-switch-simple.ncl deleted file mode 100644 index 094d09570..000000000 --- a/tests-ncl/test-switch-simple.ncl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From bbdb085e62218188b8581ca5deb005642cd0c8c7 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 12:53:52 -0300 Subject: [PATCH 038/169] tests-ncl: Remove test-video-explicit-dur.ncl and test-video-natural-end.ncl covered by generated ones --- tests-ncl/test-video-explicit-dur.ncl | 14 ----------- tests-ncl/test-video-natural-end.ncl | 34 --------------------------- 2 files changed, 48 deletions(-) delete mode 100644 tests-ncl/test-video-explicit-dur.ncl delete mode 100644 tests-ncl/test-video-natural-end.ncl diff --git a/tests-ncl/test-video-explicit-dur.ncl b/tests-ncl/test-video-explicit-dur.ncl deleted file mode 100644 index d833900af..000000000 --- a/tests-ncl/test-video-explicit-dur.ncl +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-video-natural-end.ncl b/tests-ncl/test-video-natural-end.ncl deleted file mode 100644 index f3c5deafb..000000000 --- a/tests-ncl/test-video-natural-end.ncl +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From ca9394aa27030c496d3b90a669667cb09b4e9a38 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 12:55:37 -0300 Subject: [PATCH 039/169] tests-ncl: Rename test-video-4grid.ncl to test-video-fullhd-4grid.ncl --- tests-ncl/{test-video-4grid.ncl => test-video-fullhd-4grid.ncl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests-ncl/{test-video-4grid.ncl => test-video-fullhd-4grid.ncl} (100%) diff --git a/tests-ncl/test-video-4grid.ncl b/tests-ncl/test-video-fullhd-4grid.ncl similarity index 100% rename from tests-ncl/test-video-4grid.ncl rename to tests-ncl/test-video-fullhd-4grid.ncl From 958fb889983ed13f8f460048531e37a2fcfde9d7 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 13:50:05 -0300 Subject: [PATCH 040/169] tests-ncl: Rename test-area-label-2.ncl to test-lua-area-label.ncl --- tests-ncl/test-area-label-1.ncl | 57 ------------------- ...ea-label-2.ncl => test-lua-area-label.ncl} | 0 2 files changed, 57 deletions(-) delete mode 100644 tests-ncl/test-area-label-1.ncl rename tests-ncl/{test-area-label-2.ncl => test-lua-area-label.ncl} (100%) diff --git a/tests-ncl/test-area-label-1.ncl b/tests-ncl/test-area-label-1.ncl deleted file mode 100644 index f66636a7b..000000000 --- a/tests-ncl/test-area-label-1.ncl +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-area-label-2.ncl b/tests-ncl/test-lua-area-label.ncl similarity index 100% rename from tests-ncl/test-area-label-2.ncl rename to tests-ncl/test-lua-area-label.ncl From f197a795bcf4026cafbe5dc7cf0d87248f2e86ca Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 2 Apr 2018 14:48:42 -0300 Subject: [PATCH 041/169] tests-ncl: Rename media anchor tests --- tests-ncl/{test-area-1.ncl => test-media-anchor-1.ncl} | 0 tests-ncl/{test-area-2.ncl => test-media-anchor-2.ncl} | 0 tests-ncl/{test-area-3.ncl => test-media-anchor-3.ncl} | 0 tests-ncl/{test-area-4.ncl => test-media-anchor-4.ncl} | 0 tests-ncl/{test-area-5.ncl => test-media-anchor-5.ncl} | 0 ...ime-anchor-1.ncl => test-media-anchor-started-from-port-1.ncl} | 0 ...ime-anchor-2.ncl => test-media-anchor-started-from-port-2.ncl} | 0 ...ime-anchor-3.ncl => test-media-anchor-started-from-port-3.ncl} | 0 ...ime-anchor-4.ncl => test-media-anchor-started-from-port-4.ncl} | 0 ...ime-anchor-5.ncl => test-media-anchor-started-from-port-5.ncl} | 0 ...ime-anchor-6.ncl => test-media-anchor-started-from-port-6.ncl} | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename tests-ncl/{test-area-1.ncl => test-media-anchor-1.ncl} (100%) rename tests-ncl/{test-area-2.ncl => test-media-anchor-2.ncl} (100%) rename tests-ncl/{test-area-3.ncl => test-media-anchor-3.ncl} (100%) rename tests-ncl/{test-area-4.ncl => test-media-anchor-4.ncl} (100%) rename tests-ncl/{test-area-5.ncl => test-media-anchor-5.ncl} (100%) rename tests-ncl/{test-video-time-anchor-1.ncl => test-media-anchor-started-from-port-1.ncl} (100%) rename tests-ncl/{test-video-time-anchor-2.ncl => test-media-anchor-started-from-port-2.ncl} (100%) rename tests-ncl/{test-video-time-anchor-3.ncl => test-media-anchor-started-from-port-3.ncl} (100%) rename tests-ncl/{test-video-time-anchor-4.ncl => test-media-anchor-started-from-port-4.ncl} (100%) rename tests-ncl/{test-video-time-anchor-5.ncl => test-media-anchor-started-from-port-5.ncl} (100%) rename tests-ncl/{test-video-time-anchor-6.ncl => test-media-anchor-started-from-port-6.ncl} (100%) diff --git a/tests-ncl/test-area-1.ncl b/tests-ncl/test-media-anchor-1.ncl similarity index 100% rename from tests-ncl/test-area-1.ncl rename to tests-ncl/test-media-anchor-1.ncl diff --git a/tests-ncl/test-area-2.ncl b/tests-ncl/test-media-anchor-2.ncl similarity index 100% rename from tests-ncl/test-area-2.ncl rename to tests-ncl/test-media-anchor-2.ncl diff --git a/tests-ncl/test-area-3.ncl b/tests-ncl/test-media-anchor-3.ncl similarity index 100% rename from tests-ncl/test-area-3.ncl rename to tests-ncl/test-media-anchor-3.ncl diff --git a/tests-ncl/test-area-4.ncl b/tests-ncl/test-media-anchor-4.ncl similarity index 100% rename from tests-ncl/test-area-4.ncl rename to tests-ncl/test-media-anchor-4.ncl diff --git a/tests-ncl/test-area-5.ncl b/tests-ncl/test-media-anchor-5.ncl similarity index 100% rename from tests-ncl/test-area-5.ncl rename to tests-ncl/test-media-anchor-5.ncl diff --git a/tests-ncl/test-video-time-anchor-1.ncl b/tests-ncl/test-media-anchor-started-from-port-1.ncl similarity index 100% rename from tests-ncl/test-video-time-anchor-1.ncl rename to tests-ncl/test-media-anchor-started-from-port-1.ncl diff --git a/tests-ncl/test-video-time-anchor-2.ncl b/tests-ncl/test-media-anchor-started-from-port-2.ncl similarity index 100% rename from tests-ncl/test-video-time-anchor-2.ncl rename to tests-ncl/test-media-anchor-started-from-port-2.ncl diff --git a/tests-ncl/test-video-time-anchor-3.ncl b/tests-ncl/test-media-anchor-started-from-port-3.ncl similarity index 100% rename from tests-ncl/test-video-time-anchor-3.ncl rename to tests-ncl/test-media-anchor-started-from-port-3.ncl diff --git a/tests-ncl/test-video-time-anchor-4.ncl b/tests-ncl/test-media-anchor-started-from-port-4.ncl similarity index 100% rename from tests-ncl/test-video-time-anchor-4.ncl rename to tests-ncl/test-media-anchor-started-from-port-4.ncl diff --git a/tests-ncl/test-video-time-anchor-5.ncl b/tests-ncl/test-media-anchor-started-from-port-5.ncl similarity index 100% rename from tests-ncl/test-video-time-anchor-5.ncl rename to tests-ncl/test-media-anchor-started-from-port-5.ncl diff --git a/tests-ncl/test-video-time-anchor-6.ncl b/tests-ncl/test-media-anchor-started-from-port-6.ncl similarity index 100% rename from tests-ncl/test-video-time-anchor-6.ncl rename to tests-ncl/test-media-anchor-started-from-port-6.ncl From 6861d0b82dc8976a203b7ea9e83df854e5d47784 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 3 Apr 2018 13:28:20 -0300 Subject: [PATCH 042/169] tests-ncl: Add test-media-actions.ncl.in to test actions (start, stop, etc) over media --- .gitignore | 1 + tests-ncl/generated/Makefile.am | 9 ++ tests-ncl/generated/test-media-actions.ncl.in | 131 ++++++++++++++++++ tests-ncl/samples/msg-abort.txt | 1 + tests-ncl/samples/msg-pause.txt | 1 + tests-ncl/samples/msg-resume.txt | 1 + tests-ncl/samples/msg-start.txt | 1 + tests-ncl/samples/msg-stop.txt | 1 + 8 files changed, 146 insertions(+) create mode 100644 tests-ncl/generated/test-media-actions.ncl.in create mode 100644 tests-ncl/samples/msg-abort.txt create mode 100644 tests-ncl/samples/msg-pause.txt create mode 100644 tests-ncl/samples/msg-resume.txt create mode 100644 tests-ncl/samples/msg-start.txt create mode 100644 tests-ncl/samples/msg-stop.txt diff --git a/.gitignore b/.gitignore index f88975114..132fabce3 100644 --- a/.gitignore +++ b/.gitignore @@ -97,6 +97,7 @@ /tests-ncl/generated/test-media-*-transparency.ncl /tests-ncl/generated/test-media-*-visible.ncl /tests-ncl/generated/test-media-*-zIndex.ncl +/tests-ncl/generated/test-media-*-actions.ncl /tests-ncl/generated/test-mime-*.ncl /tests/Makefile /tests/Makefile.in diff --git a/tests-ncl/generated/Makefile.am b/tests-ncl/generated/Makefile.am index ea0f03ab2..e340659de 100644 --- a/tests-ncl/generated/Makefile.am +++ b/tests-ncl/generated/Makefile.am @@ -179,6 +179,15 @@ TEST_MEDIA+= test-media-svg-anim-transparency.ncl TEST_MEDIA+= test-media-txt-anim-transparency.ncl TEST_MEDIA+= test-media-vid-anim-transparency.ncl TEST_MEDIA+= test-media-html-anim-transparency.ncl +# actinos (start, stop, pause, resume, abort) +TEST_MEDIA+= test-media-aud-actions.ncl +TEST_MEDIA+= test-media-img-actions.ncl +TEST_MEDIA+= test-media-lua-actions.ncl +TEST_MEDIA+= test-media-nil-actions.ncl +TEST_MEDIA+= test-media-svg-actions.ncl +TEST_MEDIA+= test-media-txt-actions.ncl +TEST_MEDIA+= test-media-vid-actions.ncl +TEST_MEDIA+= test-media-html-actions.ncl CLEANFILES+= $(TEST_MIME) $(TEST_MIME): test-mime*.ncl.in diff --git a/tests-ncl/generated/test-media-actions.ncl.in b/tests-ncl/generated/test-media-actions.ncl.in new file mode 100644 index 000000000..243b6a089 --- /dev/null +++ b/tests-ncl/generated/test-media-actions.ncl.in @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/samples/msg-abort.txt b/tests-ncl/samples/msg-abort.txt new file mode 100644 index 000000000..f7d13fd04 --- /dev/null +++ b/tests-ncl/samples/msg-abort.txt @@ -0,0 +1 @@ +abort diff --git a/tests-ncl/samples/msg-pause.txt b/tests-ncl/samples/msg-pause.txt new file mode 100644 index 000000000..45fc3c520 --- /dev/null +++ b/tests-ncl/samples/msg-pause.txt @@ -0,0 +1 @@ +pause diff --git a/tests-ncl/samples/msg-resume.txt b/tests-ncl/samples/msg-resume.txt new file mode 100644 index 000000000..1fbc10741 --- /dev/null +++ b/tests-ncl/samples/msg-resume.txt @@ -0,0 +1 @@ +resume diff --git a/tests-ncl/samples/msg-start.txt b/tests-ncl/samples/msg-start.txt new file mode 100644 index 000000000..d44e18fb9 --- /dev/null +++ b/tests-ncl/samples/msg-start.txt @@ -0,0 +1 @@ +start diff --git a/tests-ncl/samples/msg-stop.txt b/tests-ncl/samples/msg-stop.txt new file mode 100644 index 000000000..1e13d54dc --- /dev/null +++ b/tests-ncl/samples/msg-stop.txt @@ -0,0 +1 @@ +stop From b45f7ea753119f1ed71ec5cddcfc227986744d68 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 3 Apr 2018 14:48:14 -0300 Subject: [PATCH 043/169] tests-ncl: Remove tests covered by tests generated from test-media-actions.ncl.in --- tests-ncl/test-ctx-nested-pause.ncl | 41 ----------------- tests-ncl/test-ctx-nested.ncl | 68 ----------------------------- tests-ncl/test-ctx-pause.ncl | 44 ------------------- tests-ncl/test-ctx-simple.ncl | 12 ----- tests-ncl/test-ctx-stop-self.ncl | 22 ---------- tests-ncl/test-video-abort.ncl | 26 ----------- tests-ncl/test-video-pause.ncl | 30 ------------- tests-ncl/test-video-resume.ncl | 56 ------------------------ 8 files changed, 299 deletions(-) delete mode 100644 tests-ncl/test-ctx-nested-pause.ncl delete mode 100644 tests-ncl/test-ctx-nested.ncl delete mode 100644 tests-ncl/test-ctx-pause.ncl delete mode 100644 tests-ncl/test-ctx-simple.ncl delete mode 100644 tests-ncl/test-ctx-stop-self.ncl delete mode 100644 tests-ncl/test-video-abort.ncl delete mode 100644 tests-ncl/test-video-pause.ncl delete mode 100644 tests-ncl/test-video-resume.ncl diff --git a/tests-ncl/test-ctx-nested-pause.ncl b/tests-ncl/test-ctx-nested-pause.ncl deleted file mode 100644 index 6dc811e3c..000000000 --- a/tests-ncl/test-ctx-nested-pause.ncl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-ctx-nested.ncl b/tests-ncl/test-ctx-nested.ncl deleted file mode 100644 index 27bca482e..000000000 --- a/tests-ncl/test-ctx-nested.ncl +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-ctx-pause.ncl b/tests-ncl/test-ctx-pause.ncl deleted file mode 100644 index 737a5ad5e..000000000 --- a/tests-ncl/test-ctx-pause.ncl +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-ctx-simple.ncl b/tests-ncl/test-ctx-simple.ncl deleted file mode 100644 index 2466260b4..000000000 --- a/tests-ncl/test-ctx-simple.ncl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-ctx-stop-self.ncl b/tests-ncl/test-ctx-stop-self.ncl deleted file mode 100644 index 025db304d..000000000 --- a/tests-ncl/test-ctx-stop-self.ncl +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-video-abort.ncl b/tests-ncl/test-video-abort.ncl deleted file mode 100644 index 3420216b7..000000000 --- a/tests-ncl/test-video-abort.ncl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-video-pause.ncl b/tests-ncl/test-video-pause.ncl deleted file mode 100644 index e5ec4bec7..000000000 --- a/tests-ncl/test-video-pause.ncl +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-video-resume.ncl b/tests-ncl/test-video-resume.ncl deleted file mode 100644 index 2bc6419fa..000000000 --- a/tests-ncl/test-video-resume.ncl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From c2fb92c527f3ab0b7a626d62be22600afdf8516a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 4 Apr 2018 10:39:27 -0300 Subject: [PATCH 044/169] test-ncl: Add generated test-transtion tests for each media type --- .gitignore | 1 + tests-ncl/generated/Makefile.am | 48 ++++++++++++++++++- .../generated/test-transition-barwipe.ncl.in | 42 ++++++++++++++++ .../test-transition-diagonalwipe.ncl.in | 42 ++++++++++++++++ .../generated/test-transition-fade.ncl.in | 42 ++++++++++++++++ 5 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 tests-ncl/generated/test-transition-barwipe.ncl.in create mode 100644 tests-ncl/generated/test-transition-diagonalwipe.ncl.in create mode 100644 tests-ncl/generated/test-transition-fade.ncl.in diff --git a/.gitignore b/.gitignore index 132fabce3..06137d79d 100644 --- a/.gitignore +++ b/.gitignore @@ -99,6 +99,7 @@ /tests-ncl/generated/test-media-*-zIndex.ncl /tests-ncl/generated/test-media-*-actions.ncl /tests-ncl/generated/test-mime-*.ncl +/tests-ncl/generated/test-transition-*.ncl /tests/Makefile /tests/Makefile.in /tests/env.csh diff --git a/tests-ncl/generated/Makefile.am b/tests-ncl/generated/Makefile.am index e340659de..a47f418a1 100644 --- a/tests-ncl/generated/Makefile.am +++ b/tests-ncl/generated/Makefile.am @@ -18,7 +18,7 @@ include $(top_srcdir)/build-aux/Makefile.am.common -BUILT_SOURCES= $(TEST_MIME) $(TEST_MEDIA) +BUILT_SOURCES= $(TEST_MIME) $(TEST_MEDIA) $(TEST_TRANSITION) TEST_MIME= TEST_MIME+= test-mime-avi.ncl @@ -189,6 +189,32 @@ TEST_MEDIA+= test-media-txt-actions.ncl TEST_MEDIA+= test-media-vid-actions.ncl TEST_MEDIA+= test-media-html-actions.ncl +TEST_TRANSITION= +# transition-barwipe +TEST_TRANSITION+= test-transition-img-barwipe.ncl +TEST_TRANSITION+= test-transition-lua-barwipe.ncl +TEST_TRANSITION+= test-transition-nil-barwipe.ncl +TEST_TRANSITION+= test-transition-svg-barwipe.ncl +TEST_TRANSITION+= test-transition-txt-barwipe.ncl +TEST_TRANSITION+= test-transition-vid-barwipe.ncl +TEST_TRANSITION+= test-transition-html-barwipe.ncl +# transition-diagonalwipe +TEST_TRANSITION+= test-transition-img-diagonalwipe.ncl +TEST_TRANSITION+= test-transition-lua-diagonalwipe.ncl +TEST_TRANSITION+= test-transition-nil-diagonalwipe.ncl +TEST_TRANSITION+= test-transition-svg-diagonalwipe.ncl +TEST_TRANSITION+= test-transition-txt-diagonalwipe.ncl +TEST_TRANSITION+= test-transition-vid-diagonalwipe.ncl +TEST_TRANSITION+= test-transition-html-diagonalwipe.ncl +# transition-fade +TEST_TRANSITION+= test-transition-img-fade.ncl +TEST_TRANSITION+= test-transition-lua-fade.ncl +TEST_TRANSITION+= test-transition-nil-fade.ncl +TEST_TRANSITION+= test-transition-svg-fade.ncl +TEST_TRANSITION+= test-transition-txt-fade.ncl +TEST_TRANSITION+= test-transition-vid-fade.ncl +TEST_TRANSITION+= test-transition-html-fade.ncl + CLEANFILES+= $(TEST_MIME) $(TEST_MIME): test-mime*.ncl.in $(AM_V_GEN)\ @@ -210,6 +236,26 @@ $(TEST_MIME): test-mime*.ncl.in esac;\ sed -e "s,@SRC@,$$src,g" "test-mime.ncl.in" >$@ +CLEANFILES+= $(TEST_TRANSITION) +$(TEST_TRANSITION): test-transition-*.ncl.in + $(AM_V_GEN)\ + type=`basename $@ | sed 's,test-transition-\([a-z0-9]*\).*,\1,g'`;\ + suffix=`basename $@ | sed 's,test-transition-[a-z0-9]*-\(.*\)\.ncl,\1,g'`;\ + case $$type in\ + aud) src="samples/arcade.mp3";;\ + img) src="samples/gnu.png";;\ + lua) src="samples/fps.lua";;\ + nil) src="";;\ + svg) src="samples/vector.svg";;\ + txt) src="samples/text.txt";;\ + vid) src="samples/clock.ogv";;\ + html) src="samples/page.html";;\ + *) exit 1;;\ + esac;\ + src_remote="http://raw.github.com/telemidia/ginga/master//tests-ncl/$$src";\ + sed -e "s,@SRC@,$$src,gi;s,@SRC_REMOTE@,"$$src_remote",gi"\ + "test-transition-$$suffix.ncl.in" >$@ + CLEANFILES+= $(TEST_MEDIA) $(TEST_MEDIA): test-media-*.ncl.in $(AM_V_GEN)\ diff --git a/tests-ncl/generated/test-transition-barwipe.ncl.in b/tests-ncl/generated/test-transition-barwipe.ncl.in new file mode 100644 index 000000000..7b6822cf6 --- /dev/null +++ b/tests-ncl/generated/test-transition-barwipe.ncl.in @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/generated/test-transition-diagonalwipe.ncl.in b/tests-ncl/generated/test-transition-diagonalwipe.ncl.in new file mode 100644 index 000000000..6c075e22d --- /dev/null +++ b/tests-ncl/generated/test-transition-diagonalwipe.ncl.in @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests-ncl/generated/test-transition-fade.ncl.in b/tests-ncl/generated/test-transition-fade.ncl.in new file mode 100644 index 000000000..de3a8e5e7 --- /dev/null +++ b/tests-ncl/generated/test-transition-fade.ncl.in @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 4e55010dab15521473b7f329ed54db35ec20164a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 4 Apr 2018 10:40:44 -0300 Subject: [PATCH 045/169] test-ncl: Remove old test-transition covered by generated ones --- tests-ncl/test-transition-barwipe.lua | 58 ---------------------- tests-ncl/test-transition-barwipe.ncl | 32 ------------ tests-ncl/test-transition-diagonalwipe.ncl | 32 ------------ tests-ncl/test-transition-img-fade.ncl | 32 ------------ tests-ncl/test-transition-vid-fade.ncl | 32 ------------ 5 files changed, 186 deletions(-) delete mode 100644 tests-ncl/test-transition-barwipe.lua delete mode 100644 tests-ncl/test-transition-barwipe.ncl delete mode 100644 tests-ncl/test-transition-diagonalwipe.ncl delete mode 100644 tests-ncl/test-transition-img-fade.ncl delete mode 100644 tests-ncl/test-transition-vid-fade.ncl diff --git a/tests-ncl/test-transition-barwipe.lua b/tests-ncl/test-transition-barwipe.lua deleted file mode 100644 index 3ce2da0e8..000000000 --- a/tests-ncl/test-transition-barwipe.lua +++ /dev/null @@ -1,58 +0,0 @@ -local ncl = {'context', 'ncl', - - -- Ports. - {'m1@lambda', 'm2@lambda', 'm3@lambda', 'm4@lambda'}, - - -- Children - { - {'media', 'm1', - {top='0', - left='0', - width='50%', - height='50%', - src='samples/vector.svg', - transIn={type='barWipe', - dur='1s',}, - transOut={type='barWipe', - dur='1s'}}, - }, - {'media', 'm2', - {top='0', - left='50%', - width='50%', - height='50%', - src='samples/vector.svg', - transIn={type='barWipe', - dur='1s',}, - transOut={type='barWipe', - dur='1s'}}, - }, - {'media', 'm3', - {top='50%', - left='0', - width='50%', - height='50%', - src='samples/vector.svg', - transIn={type='barWipe', - dur='1s',}, - transOut={type='barWipe', - dur='1s'}}, - }, - {'media', 'm4', - {top='50%', - left='50%', - width='50%', - height='50%', - src='samples/vector.svg', - transIn={type='barWipe', - dur='1s',}, - transOut={type='barWipe', - dur='1s'}}, - }, - }, -} - --- Finally, return the constructed table to the caller. This means that --- whomever calls this script (e.g., the LuaParser) will receive the --- constructed table. -return ncl diff --git a/tests-ncl/test-transition-barwipe.ncl b/tests-ncl/test-transition-barwipe.ncl deleted file mode 100644 index bb4e2d49b..000000000 --- a/tests-ncl/test-transition-barwipe.ncl +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-transition-diagonalwipe.ncl b/tests-ncl/test-transition-diagonalwipe.ncl deleted file mode 100644 index bcdf7eb99..000000000 --- a/tests-ncl/test-transition-diagonalwipe.ncl +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-transition-img-fade.ncl b/tests-ncl/test-transition-img-fade.ncl deleted file mode 100644 index 74d1530ba..000000000 --- a/tests-ncl/test-transition-img-fade.ncl +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests-ncl/test-transition-vid-fade.ncl b/tests-ncl/test-transition-vid-fade.ncl deleted file mode 100644 index 1bb283691..000000000 --- a/tests-ncl/test-transition-vid-fade.ncl +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From bc337ac85dbf30dbeeb5886804d0e3823fd45ec5 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 5 Apr 2018 12:42:35 -0300 Subject: [PATCH 046/169] lib: Fix evalActionInContext return reported by macOS gcc --- lib/Document.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Document.cpp b/lib/Document.cpp index d0196ecf3..45de0d4d4 100644 --- a/lib/Document.cpp +++ b/lib/Document.cpp @@ -267,6 +267,7 @@ Document::evalActionInContext (Action act, Context *ctx) } } } + return stack; } /** From ec069899edac14dc2acc8ebf06ffbd3c0f96a364 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 5 Apr 2018 12:47:35 -0300 Subject: [PATCH 047/169] tests: Add test-Document-empty.cpp --- .gitignore | 1 + tests/Makefile.am | 3 ++ tests/test-Document-empty.cpp | 94 +++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 tests/test-Document-empty.cpp diff --git a/.gitignore b/.gitignore index 06137d79d..a6763310e 100644 --- a/.gitignore +++ b/.gitignore @@ -119,6 +119,7 @@ /tests/test-Document-getObjectById /tests/test-Document-getObjectByIdOrAlias /tests/test-Document-new +/tests/test-Document-empty /tests/test-Event-getEventStateAsString /tests/test-Event-getEventTransitionAsString /tests/test-Event-getEventTypeAsString diff --git a/tests/Makefile.am b/tests/Makefile.am index 3b0633566..e67adcdc1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -188,6 +188,9 @@ test_Document_evalPredicate_from_link_SOURCES= test-Document-evalPredicate-from- progs+= test-Document-evalPredicate-from-rule test_Document_evalPredicate_from_rule_SOURCES= test-Document-evalPredicate-from-rule.cpp +progs+= test-Document-empty +test_Document_empty_SOURCES= test-Document-empty.cpp + # lib/Predicate.h ---------------------------------------------------------- progs+= test-Predicate-new test_Predicate_new_SOURCES= test-Predicate-new.cpp diff --git a/tests/test-Document-empty.cpp b/tests/test-Document-empty.cpp new file mode 100644 index 000000000..ae1945f36 --- /dev/null +++ b/tests/test-Document-empty.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ +\n"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} From ad7921dbaa00e5edb210b690242a6a84ab7eba05 Mon Sep 17 00:00:00 2001 From: Antonio Busson Date: Mon, 2 Apr 2018 22:55:41 -0400 Subject: [PATCH 048/169] src-gui: menu keyboard bug fixed --- src-gui/view/MainWindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src-gui/view/MainWindow.cpp b/src-gui/view/MainWindow.cpp index 61245d443..7c65de9c7 100644 --- a/src-gui/view/MainWindow.cpp +++ b/src-gui/view/MainWindow.cpp @@ -641,11 +641,13 @@ create_window_components () g_assert_nonnull (playButton); g_signal_connect (playButton, "clicked", G_CALLBACK (play_pause_button_callback), NULL); + gtk_widget_set_can_focus(playButton, FALSE); stopButton = gtk_button_new (); g_assert_nonnull (stopButton); g_signal_connect (stopButton, "clicked", G_CALLBACK (stop_button_callback), NULL); + gtk_widget_set_can_focus(stopButton, FALSE); fullscreenButton = gtk_button_new (); g_assert_nonnull (fullscreenButton); @@ -653,6 +655,7 @@ create_window_components () gtk_widget_set_tooltip_text (fullscreenButton, "Fullscreen"); g_signal_connect (fullscreenButton, "clicked", G_CALLBACK (set_fullscreen_mode), NULL); + gtk_widget_set_can_focus(fullscreenButton, FALSE); volumeButton = gtk_volume_button_new (); g_assert_nonnull (volumeButton); @@ -663,6 +666,7 @@ create_window_components () gtk_widget_set_tooltip_text (settingsButton, "Preferences"); g_signal_connect (settingsButton, "clicked", G_CALLBACK (show_optbox), NULL); + gtk_widget_set_can_focus(settingsButton, FALSE); remoteButton = gtk_button_new (); g_assert_nonnull (remoteButton); @@ -677,6 +681,7 @@ create_window_components () gtk_widget_set_tooltip_text (toolsButton, "Tools"); g_signal_connect (toolsButton, "clicked", G_CALLBACK (show_toolbox), NULL); + gtk_widget_set_can_focus(toolsButton, FALSE); debugButton = gtk_button_new (); g_assert_nonnull (debugButton); From 5e228565536a8348586b910f4ac120d6c6075053 Mon Sep 17 00:00:00 2001 From: Antonio Busson Date: Tue, 3 Apr 2018 02:14:53 -0400 Subject: [PATCH 049/169] src-gui: new parameter -b for bigpicture mode presentation in gingagui --- src-gui/ginga-gtk.cpp | 26 +++++++++++++++++++------- src-gui/view/BigPictureWindow.cpp | 3 ++- src-gui/view/MainWindow.cpp | 4 ++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index 672983219..5232f0b86 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -27,7 +27,7 @@ using namespace ::std; #include #endif -// Global formatter. +//Global formatter Ginga *GINGA = nullptr; gchar *gingaID = nullptr; @@ -76,6 +76,7 @@ main (int argc, char **argv) status = g_option_context_parse (ctx, &saved_argc, &saved_argv, &error); g_option_context_free (ctx); +/* if (!status) { g_assert_nonnull (error); @@ -83,6 +84,7 @@ main (int argc, char **argv) g_error_free (error); _exit (0); } +*/ init_ginga_data (); load_settings (); @@ -102,16 +104,26 @@ main (int argc, char **argv) // check for ginga updates send_http_log_message (-1, (gchar *) "Check for Ginga updates"); g_assert (g_setenv ("G_MESSAGES_DEBUG", "all", true)); + create_main_window (); if (saved_argc > 1) { - gchar *filename = saved_argv[1]; - gchar *ext = strrchr (filename, '.'); - if (!g_strcmp0 (ext, ".ncl")) - { - insert_historicbox (filename); - } + printf("saved arg... \n"); + if( strcmp(saved_argv[1], "-b") == 0) + { + printf("create bigpicture window.\n"); + create_bigpicture_window (); + } + else + { + gchar *filename = saved_argv[1]; + gchar *ext = strrchr (filename, '.'); + if (!g_strcmp0 (ext, ".ncl")) + { + insert_historicbox (filename); + } + } } gtk_main (); diff --git a/src-gui/view/BigPictureWindow.cpp b/src-gui/view/BigPictureWindow.cpp index ac62db247..cdb92a3c9 100644 --- a/src-gui/view/BigPictureWindow.cpp +++ b/src-gui/view/BigPictureWindow.cpp @@ -389,7 +389,6 @@ carrousel_rotate (gint dir) void create_bigpicture_window () { - GdkRectangle rect; GdkDisplay *display = gdk_display_get_default (); g_assert_nonnull (display); @@ -492,4 +491,6 @@ destroy_bigpicture_window () GINGA->resize (presentationAttributes.resolutionWidth, presentationAttributes.resolutionHeight); + + exit(1); } diff --git a/src-gui/view/MainWindow.cpp b/src-gui/view/MainWindow.cpp index 7c65de9c7..6bb851995 100644 --- a/src-gui/view/MainWindow.cpp +++ b/src-gui/view/MainWindow.cpp @@ -483,7 +483,7 @@ keyboard_callback (unused (GtkWidget *widget), GdkEventKey *e, set_unfullscreen_mode (); else if (inBigPictureMode && (g_strcmp0 ((const char *) type, "press") != 0)) - destroy_bigpicture_window (); + destroy_bigpicture_window (); break; case GDK_KEY_Meta_L: case GDK_KEY_Meta_R: @@ -507,7 +507,7 @@ keyboard_callback (unused (GtkWidget *widget), GdkEventKey *e, case GDK_KEY_B: case GDK_KEY_b: if (isCrtlModifierActive) - create_bigpicture_window (); + // create_bigpicture_window (); break; case GDK_KEY_D: case GDK_KEY_d: From b46186eac9d50953e93de0be6a695441e006d38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Fri, 6 Apr 2018 17:18:01 -0300 Subject: [PATCH 050/169] lib: Adding Abort on Switch transition. * lib/Switch.cpp --- lib/Switch.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Switch.cpp b/lib/Switch.cpp index c2ca1382a..c76115c6f 100644 --- a/lib/Switch.cpp +++ b/lib/Switch.cpp @@ -136,6 +136,7 @@ Switch::beforeTransition (Event *evt, Event::Transition transition) return false; break; + case Event::ABORT: case Event::STOP: if (_selected != nullptr) { @@ -175,7 +176,8 @@ Switch::afterTransition (Event *evt, Event::Transition transition) if (_selected == nullptr) _doc->evalAction (evt, Event::STOP); break; - + + case Event::ABORT: case Event::STOP: Object::doStop (); TRACE ("stop %s", evt->getFullId ().c_str ()); From 22e8fbf7d8405c1d5a1f03f8f8ffdfb3d72df114 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 9 Apr 2018 19:23:41 -0300 Subject: [PATCH 051/169] examples: Fix 11nclua.ncl lua file path (Cloes #115) --- examples/primeiro-joao/11nclua.ncl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/primeiro-joao/11nclua.ncl b/examples/primeiro-joao/11nclua.ncl index cd9bab78a..e47aad84d 100644 --- a/examples/primeiro-joao/11nclua.ncl +++ b/examples/primeiro-joao/11nclua.ncl @@ -154,7 +154,7 @@ - + From 83b1c9e54a26093cc907a9f4131de13afee0093a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 11 Apr 2018 15:26:42 -0300 Subject: [PATCH 052/169] lib: Enable connectorParam type attribute as optional --- lib/Parser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Parser.cpp b/lib/Parser.cpp index fcfb05d9f..c30e19796 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -535,12 +535,13 @@ static map parser_syntax_table = { { { "id", ATTR_ID } } }, }, { - "connectorParam", + "connectorParam", // unused { nullptr, nullptr, 0, { "causalConnector" }, - { { "name", ATTR_NONEMPTY_NAME } } }, // unused + { { "name", ATTR_NONEMPTY_NAME }, + { "type", 0 } } }, }, { "compoundCondition", From b476cfe2dcb4583542b4049a8513d6f7630f7e6a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 12 Apr 2018 11:34:37 -0300 Subject: [PATCH 053/169] maint: Use onResume role instead of onResumes --- lib/Parser.cpp | 2 +- tests-ncl/test-link-onResume-body.ncl | 4 ++-- tests-ncl/test-link-onResume-ctx.ncl | 4 ++-- tests-ncl/test-link-onResume.ncl | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Parser.cpp b/lib/Parser.cpp index c30e19796..3190e899f 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -861,7 +861,7 @@ static map > { "onEnd", { Event::PRESENTATION, Event::STOP } }, { "onAbort", { Event::PRESENTATION, Event::ABORT } }, { "onPause", { Event::PRESENTATION, Event::PAUSE } }, - { "onResumes", { Event::PRESENTATION, Event::RESUME } }, + { "onResume", { Event::PRESENTATION, Event::RESUME } }, { "onBeginAttribution", { Event::ATTRIBUTION, Event::START } }, { "onEndAttribution", { Event::ATTRIBUTION, Event::STOP } }, { "onSelection", { Event::SELECTION, Event::START } }, diff --git a/tests-ncl/test-link-onResume-body.ncl b/tests-ncl/test-link-onResume-body.ncl index 9ac6884bd..25ea7f352 100644 --- a/tests-ncl/test-link-onResume-body.ncl +++ b/tests-ncl/test-link-onResume-body.ncl @@ -14,7 +14,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/tests-ncl/test-link-onResume-ctx.ncl b/tests-ncl/test-link-onResume-ctx.ncl index 902a93666..cd2b79943 100644 --- a/tests-ncl/test-link-onResume-ctx.ncl +++ b/tests-ncl/test-link-onResume-ctx.ncl @@ -13,7 +13,7 @@ - + @@ -41,7 +41,7 @@ - + diff --git a/tests-ncl/test-link-onResume.ncl b/tests-ncl/test-link-onResume.ncl index 39bb76b64..ee0e62e5e 100644 --- a/tests-ncl/test-link-onResume.ncl +++ b/tests-ncl/test-link-onResume.ncl @@ -13,7 +13,7 @@ - + @@ -38,7 +38,7 @@ - + From b81497e3857b22904023e718dff501e7ef485278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Thu, 12 Apr 2018 15:32:21 -0300 Subject: [PATCH 054/169] lib: Fixed Video EOS fails #119. I don't know why, but sometimes EOS event is not triggered by appsink element. So, now the EOS is checked when playbin element emit the signal "about-to-finish". * lib/PlayerVideo.cpp: Likewise * lib/PlayerVideo.h --- lib/PlayerVideo.cpp | 28 ++++++++++++++++++---------- lib/PlayerVideo.h | 1 + 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/PlayerVideo.cpp b/lib/PlayerVideo.cpp index 4a68969cb..0caf18ace 100644 --- a/lib/PlayerVideo.cpp +++ b/lib/PlayerVideo.cpp @@ -73,6 +73,8 @@ PlayerVideo::PlayerVideo (Formatter *formatter, Media *media) _playbin = gst_element_factory_make ("playbin", "playbin"); g_assert_nonnull (_playbin); + + //g_object_set (G_OBJECT (_playbin), "connection-speed", 56, nullptr); bus = gst_pipeline_get_bus (GST_PIPELINE (_playbin)); g_assert_nonnull (bus); @@ -151,11 +153,14 @@ PlayerVideo::PlayerVideo (Formatter *formatter, Media *media) g_object_set (G_OBJECT (_playbin), "video-sink", _video.bin, nullptr); // Callbacks. - _callbacks.eos = nullptr; + _callbacks.eos = nullptr; //Seldom the EOS event is not triggered by appsink. _callbacks.new_preroll = nullptr; _callbacks.new_sample = cb_NewSample; gst_app_sink_set_callbacks (GST_APP_SINK (_video.sink), &_callbacks, this, nullptr); + + g_signal_connect (G_OBJECT (_playbin), "about-to-finish", (GCallback) cb_EOS, + this); // Initialize some handled properties. static set handled = { "balance", "bass", "freeze", "mute", @@ -588,7 +593,7 @@ PlayerVideo::getPipelineState () if (unlikely (ret == GST_STATE_CHANGE_FAILURE)) { - return "NULL"; + return nullptr; } return gst_element_state_get_name (curr); } @@ -604,13 +609,6 @@ PlayerVideo::cb_Bus (GstBus *bus, GstMessage *msg, PlayerVideo *player) switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - { - if (unlikely (!player->getFreeze ())) - player->setEOS (true); - TRACE ("EOS of %s", player->_id.c_str ()); - break; - } case GST_MESSAGE_ERROR: case GST_MESSAGE_WARNING: { @@ -648,7 +646,6 @@ PlayerVideo::cb_Bus (GstBus *bus, GstMessage *msg, PlayerVideo *player) default: break; } - // gst_object_unref (msg); return TRUE; } @@ -661,4 +658,15 @@ PlayerVideo::cb_NewSample (unused (GstAppSink *appsink), gpointer data) return GST_FLOW_OK; } +void +PlayerVideo::cb_EOS (unused (GstElement *playbin), gpointer data) +{ + PlayerVideo *player = (PlayerVideo *) data; + g_assert_nonnull (player); + TRACE ("EOS of %s", player->_id.c_str ()); + + if (unlikely (!player->getFreeze ())) + player->setEOS (true); +} + GINGA_NAMESPACE_END diff --git a/lib/PlayerVideo.h b/lib/PlayerVideo.h index 733aab77f..6b357f297 100644 --- a/lib/PlayerVideo.h +++ b/lib/PlayerVideo.h @@ -87,6 +87,7 @@ class PlayerVideo : public Player // GStreamer callbacks. static gboolean cb_Bus (GstBus *, GstMessage *, PlayerVideo *); static GstFlowReturn cb_NewSample (GstAppSink *, gpointer); + static void cb_EOS (GstElement *, gpointer); }; GINGA_NAMESPACE_END From 939c3512e62b81b30afb55755c021ec45b92a518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Thu, 12 Apr 2018 15:58:28 -0300 Subject: [PATCH 055/169] examples: Adding "roteiro-do-dia" app. * examples/fetch.sh --- examples/fetch.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/fetch.sh b/examples/fetch.sh index 846975b84..02a8f9b59 100755 --- a/examples/fetch.sh +++ b/examples/fetch.sh @@ -23,6 +23,7 @@ APPS="$APPS hackerteen" APPS="$APPS orchestra" APPS="$APPS pixelation" APPS="$APPS proderj" +APPS="$APPS roteiro-do-dia" APPS="$APPS velha" APPS="$APPS velha" APPS="$APPS vivamais-peso" @@ -30,7 +31,7 @@ APPS="$APPS vivamais-alim" URI=http://www.telemidia.puc-rio.br/~gflima/misc/nclapps URI_PATCHS=https://raw.githubusercontent.com/andrelbd1/ginga_aplications/master/ -PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl comerciais-proview/app_cover.png comerciais-proview/app_thumbnail.png formula1/formula1.ncl formula1/app_cover.png formula1/app_thumbnail.png hackerteen/hackerteen.lua hackerteen/hackerteen.ncl hackerteen/app_cover.png hackerteen/app_thumbnail.png orchestra/orchestra.ncl orchestra/app_cover.png orchestra/app_thumbnail.png pixelation/pixelation.ncl pixelation/app_cover.png pixelation/app_thumbnail.png proderj/proderj.ncl proderj/app_cover.png proderj/app_thumbnail.png roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-dlso-dia/regionBase.ncl roteiro-do-dia/app_cover.png roteiro-do-dia/app_thumbnail.png velha/connbase.ncl velha/main.ncl velha/app_cover.png velha/app_thumbnail.png vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-alim/app_cover.png vivamais-alim/app_thumbnail.png vivamais-peso/peso.deps vivamais-peso/peso.lua vivamais-peso/app_cover.png vivamais-peso/app_thumbnail.png pacman/app_cover.png pacman/app_thumbnail.png" +PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl comerciais-proview/app_cover.png comerciais-proview/app_thumbnail.png formula1/formula1.ncl formula1/app_cover.png formula1/app_thumbnail.png hackerteen/hackerteen.lua hackerteen/hackerteen.ncl hackerteen/app_cover.png hackerteen/app_thumbnail.png orchestra/orchestra.ncl orchestra/app_cover.png orchestra/app_thumbnail.png pixelation/pixelation.ncl pixelation/app_cover.png pixelation/app_thumbnail.png proderj/proderj.ncl proderj/app_cover.png proderj/app_thumbnail.png roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-do-dia/regionBase.ncl roteiro-do-dia/app_cover.png roteiro-do-dia/app_thumbnail.png velha/connbase.ncl velha/main.ncl velha/app_cover.png velha/app_thumbnail.png vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-alim/app_cover.png vivamais-alim/app_thumbnail.png vivamais-peso/peso.deps vivamais-peso/peso.lua vivamais-peso/app_cover.png vivamais-peso/app_thumbnail.png pacman/app_cover.png pacman/app_thumbnail.png" for app in $APPS; do wget --show-progress -q -r -N -np -nH --cut-dirs 3 \ From b0c80429d0805243c864578a287dd83717649011 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 13 Apr 2018 16:17:15 -0300 Subject: [PATCH 056/169] lib: Enable Switch pause and resume --- lib/Switch.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Switch.cpp b/lib/Switch.cpp index c76115c6f..1f997d8af 100644 --- a/lib/Switch.cpp +++ b/lib/Switch.cpp @@ -136,6 +136,8 @@ Switch::beforeTransition (Event *evt, Event::Transition transition) return false; break; + case Event::PAUSE: + case Event::RESUME: case Event::ABORT: case Event::STOP: if (_selected != nullptr) @@ -176,7 +178,15 @@ Switch::afterTransition (Event *evt, Event::Transition transition) if (_selected == nullptr) _doc->evalAction (evt, Event::STOP); break; - + + case Event::PAUSE: + TRACE ("pause %s", evt->getFullId ().c_str ()); + break; + + case Event::RESUME: + TRACE ("resume %s", evt->getFullId ().c_str ()); + break; + case Event::ABORT: case Event::STOP: Object::doStop (); From e96f35fac8c08813784be6842a7c05b36485430c Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 13 Apr 2018 16:29:49 -0300 Subject: [PATCH 057/169] tests: Add more Event-transtion-Switch tests --- .gitignore | 4 + tests/Makefile.am | 16 +++ tests/test-Event-transition-Switch-abort.cpp | 115 +++++++++++++++++ tests/test-Event-transition-Switch-pause.cpp | 116 ++++++++++++++++++ tests/test-Event-transition-Switch-resume.cpp | 115 +++++++++++++++++ tests/test-Event-transition-Switch-start.cpp | 36 ++---- tests/test-Event-transition-Switch-stop.cpp | 116 ++++++++++++++++++ 7 files changed, 495 insertions(+), 23 deletions(-) create mode 100644 tests/test-Event-transition-Switch-abort.cpp create mode 100644 tests/test-Event-transition-Switch-pause.cpp create mode 100644 tests/test-Event-transition-Switch-resume.cpp create mode 100644 tests/test-Event-transition-Switch-stop.cpp diff --git a/.gitignore b/.gitignore index a6763310e..9afc729b4 100644 --- a/.gitignore +++ b/.gitignore @@ -137,7 +137,11 @@ /tests/test-Event-transition-Media-resume /tests/test-Event-transition-Media-start /tests/test-Event-transition-Media-stop +/tests/test-Event-transition-Switch-abort +/tests/test-Event-transition-Switch-pause +/tests/test-Event-transition-Switch-resume /tests/test-Event-transition-Switch-start +/tests/test-Event-transition-Switch-stop /tests/test-Ginga-create /tests/test-Ginga-getOptionBool /tests/test-Ginga-getOptionInt diff --git a/tests/Makefile.am b/tests/Makefile.am index e67adcdc1..b8c0be392 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -251,6 +251,10 @@ progs+= test-Event-transition-Context-stop test_Event_transition_Context_stop_SOURCES=\ test-Event-transition-Context-stop.cpp +progs+= test-Event-transition-Switch-stop +test_Event_transition_Switch_stop_SOURCES=\ + test-Event-transition-Switch-stop.cpp + progs+= test-Event-transition-Media-abort test_Event_transition_Media_abort_SOURCES=\ test-Event-transition-Media-abort.cpp @@ -259,6 +263,10 @@ progs+= test-Event-transition-Context-abort test_Event_transition_Context_abort_SOURCES=\ test-Event-transition-Context-abort.cpp +progs+= test-Event-transition-Switch-abort +test_Event_transition_Switch_abort_SOURCES=\ + test-Event-transition-Switch-abort.cpp + progs+= test-Event-transition-Media-pause test_Event_transition_Media_pause_SOURCES=\ test-Event-transition-Media-pause.cpp @@ -267,6 +275,10 @@ progs+= test-Event-transition-Context-pause test_Event_transition_Context_pause_SOURCES=\ test-Event-transition-Context-pause.cpp +progs+= test-Event-transition-Switch-pause +test_Event_transition_Switch_pause_SOURCES=\ + test-Event-transition-Switch-pause.cpp + progs+= test-Event-transition-Media-resume test_Event_transition_Media_resume_SOURCES=\ test-Event-transition-Media-resume.cpp @@ -275,6 +287,10 @@ progs+= test-Event-transition-Context-resume test_Event_transition_Context_resume_SOURCES=\ test-Event-transition-Context-resume.cpp +progs+= test-Event-transition-Switch-resume +test_Event_transition_Switch_resume_SOURCES=\ + test-Event-transition-Switch-resume.cpp + # lib/Object.h ------------------------------------------------------------- progs+= test-Object-addAlias test_Object_addAlias_SOURCES= test-Object-addAlias.cpp diff --git a/tests/test-Event-transition-Switch-abort.cpp b/tests/test-Event-transition-Switch-abort.cpp new file mode 100644 index 000000000..014c1e7ea --- /dev/null +++ b/tests/test-Event-transition-Switch-abort.cpp @@ -0,0 +1,115 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // Presentation events --------------------------------------------------- + + // @lambda: ABORT from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // after advance time, s1@lambda is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // ABORT is done + g_assert (swt_lambda->transition (Event::ABORT)); + + // after start, s1@lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // @lambda: ABORT from state SLEEPING. + + // Attribution events ---------------------------------------------------- + + // ABORT from state SLEEPING. + + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Event-transition-Switch-pause.cpp b/tests/test-Event-transition-Switch-pause.cpp new file mode 100644 index 000000000..eb05fa62b --- /dev/null +++ b/tests/test-Event-transition-Switch-pause.cpp @@ -0,0 +1,116 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // Presentation events --------------------------------------------------- + + // @lambda: START from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // After advancing time, s1@lambda and m1@lambda are OCCURRING. + // m2@lambda is not selected, and is not OCCURRING. + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done + g_assert (swt_lambda->transition (Event::PAUSE)); + + // after start, s1@lambda is PAUSED + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::PAUSED); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // @lambda: START from state SLEEPING. + + // Attribution events ---------------------------------------------------- + + // START from state SLEEPING. + + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Event-transition-Switch-resume.cpp b/tests/test-Event-transition-Switch-resume.cpp new file mode 100644 index 000000000..05b130873 --- /dev/null +++ b/tests/test-Event-transition-Switch-resume.cpp @@ -0,0 +1,115 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // Presentation events --------------------------------------------------- + + // @lambda: RESUME from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // After advancing time, s1@lambda and m1@lambda is OCCURRING. + // m2@lambda is not selected, and is not OCCURRING. + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // main check + + // RESUME is not done + g_assert_false(swt_lambda->transition (Event::RESUME)); + + // after start, s1@lambda is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // @lambda: RESUME from state SLEEPING. + + // Attribution events ---------------------------------------------------- + + // RESUME from state SLEEPING. + + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Event-transition-Switch-start.cpp b/tests/test-Event-transition-Switch-start.cpp index de62a6ff6..a84776335 100644 --- a/tests/test-Event-transition-Switch-start.cpp +++ b/tests/test-Event-transition-Switch-start.cpp @@ -59,17 +59,17 @@ main (void) Event *stgs_lambda = stgs->getLambda (); g_assert_nonnull (stgs_lambda); - Switch *swtch = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swtch); - Event *swtch_lambda = swtch->getLambda (); - g_assert_nonnull (swtch_lambda); + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); - Media *m1 = cast (Media *, swtch->getChildById ("m1")); + Media *m1 = cast (Media *, swt->getChildById ("m1")); g_assert_nonnull (m1); Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); - Media *m2 = cast (Media *, swtch->getChildById ("m2")); + Media *m2 = cast (Media *, swt->getChildById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); g_assert_nonnull (m2_lambda); @@ -79,37 +79,27 @@ main (void) // When the document is started, only the body@lambda is OCCURRING. g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swtch_lambda->getState () == Event::SLEEPING); + g_assert (swt_lambda->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); // After advancing time, s1@lambda and m1@lambda are OCCURRING. - // m2@lambda - // is not selected, and is not occurring. + // m2@lambda is not selected, and is not OCCURRING. fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swtch_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // after advance time, s1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swtch_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); // -------------------------------- // main check - // START is not done and return false. - g_assert_false (swtch_lambda->transition (Event::START)); + // START is not done + g_assert_false(swt_lambda->transition (Event::START)); - // after start, s1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING + // after start, s1@lambda is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swtch_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); diff --git a/tests/test-Event-transition-Switch-stop.cpp b/tests/test-Event-transition-Switch-stop.cpp new file mode 100644 index 000000000..e8454cfb1 --- /dev/null +++ b/tests/test-Event-transition-Switch-stop.cpp @@ -0,0 +1,116 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // Presentation events --------------------------------------------------- + + // @lambda: STOP from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // After advancing time, s1@lambda and m1@lambda is OCCURRING. + // m2@lambda is not selected, and is not OCCURRING. + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done + g_assert (swt_lambda->transition (Event::STOP)); + + // after STOP, s1@lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // @lambda: STOP from state SLEEPING. + + // Attribution events ---------------------------------------------------- + + // STOP from state SLEEPING. + + exit (EXIT_SUCCESS); +} From 1f9efc46a6c171a1d7f48cc19384e635baea4530 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 17 Apr 2018 15:03:28 -0300 Subject: [PATCH 058/169] tests: Tests anchors state in test-Media-anchors-started-from-links --- .../test-Media-anchors-started-from-links.cpp | 171 +++++++++++++++++- 1 file changed, 165 insertions(+), 6 deletions(-) diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp index fe33cbc1c..2703f8bb8 100644 --- a/tests/test-Media-anchors-started-from-links.cpp +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -16,6 +16,8 @@ You should have received a copy of the GNU General Public License along with Ginga. If not, see . */ #include "tests.h" +#include +using namespace std; int main (void) @@ -69,6 +71,23 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 0); + g_assert_cmpuint (end, ==, 20 * GINGA_SECOND); + Event *a3 = m1->getPresentationEvent ("a3"); + g_assert_nonnull (a3); + a3->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 30 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -77,13 +96,45 @@ main (void) // -------------------------------- // check start document + // when start document, a2 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::OCCURRING); + // TODO: this should SLEEPING + // g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + // -------------------------------- + // main check + + // when advance 10s, a1 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + // TODO: this should SLEEPING + // g_assert (a3->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when advance more 10s, a2 is SLEEPING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); + // TODO: this should SLEEPING + // g_assert (a3->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + // when advance more 10s, m1 is SLEEPING and m2 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; @@ -139,6 +190,23 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 20 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a3 = m1->getPresentationEvent ("a3"); + g_assert_nonnull (a3); + a3->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 30 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -147,13 +215,33 @@ main (void) // -------------------------------- // check start document + // when start document, a1 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + // -------------------------------- + // main check + + // when advance 10s, a1 and a2 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (a3->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + // when advance 10s, a1, a2, a3 and m2 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (a3->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; @@ -209,6 +297,23 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 20 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a3 = m1->getPresentationEvent ("a3"); + g_assert_nonnull (a3); + a3->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 30 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -217,13 +322,25 @@ main (void) // -------------------------------- // check start document + // when start document, a2 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + // -------------------------------- + // main check + + // when advance 10s, a2 and a3 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + // TODO: this should SLEEPING + // g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (a3->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); delete fmt; @@ -278,6 +395,18 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 20 * GINGA_SECOND); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 15 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 25 * GINGA_SECOND); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -286,12 +415,21 @@ main (void) // -------------------------------- // check start document + // when start document, a1 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (25 * GINGA_SECOND, 25 * GINGA_SECOND, 0); + // -------------------------------- + // main check + + // when advance 15s, a1 and a2 is SLEEPING + fmt->sendTick (15 * GINGA_SECOND, 15 * GINGA_SECOND, 0); g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); delete fmt; @@ -346,6 +484,18 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 20 * GINGA_SECOND); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 5 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 15 * GINGA_SECOND); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -354,13 +504,22 @@ main (void) // -------------------------------- // check start document + // when start document, a1 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + // -------------------------------- + // main check + + // when advance 5, a1 and a2 is OCCURRING + fmt->sendTick (5 * GINGA_SECOND, 5 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; From b0992814de131f4b6c288b0fcf0e6400484b21b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Thu, 19 Apr 2018 17:29:15 -0300 Subject: [PATCH 059/169] lib: Edit a comment. * lib/PlayerVideo.cpp: Likewise --- lib/PlayerVideo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PlayerVideo.cpp b/lib/PlayerVideo.cpp index 0caf18ace..24e46cd58 100644 --- a/lib/PlayerVideo.cpp +++ b/lib/PlayerVideo.cpp @@ -153,7 +153,7 @@ PlayerVideo::PlayerVideo (Formatter *formatter, Media *media) g_object_set (G_OBJECT (_playbin), "video-sink", _video.bin, nullptr); // Callbacks. - _callbacks.eos = nullptr; //Seldom the EOS event is not triggered by appsink. + _callbacks.eos = nullptr; //Seldom the EOS event is triggered by appsink. _callbacks.new_preroll = nullptr; _callbacks.new_sample = cb_NewSample; gst_app_sink_set_callbacks (GST_APP_SINK (_video.sink), &_callbacks, this, From c7d5de29bbb79d93e3dd13a5e638756792da9add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Thu, 19 Apr 2018 18:15:18 -0300 Subject: [PATCH 060/169] lib: Gstreamer is verifying if video object is playable. Further, a advice is printed in case of decoder and plugins problems. * lib/PlayerVideo.cpp: Likewise --- lib/PlayerVideo.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/PlayerVideo.cpp b/lib/PlayerVideo.cpp index 24e46cd58..5fd6862f7 100644 --- a/lib/PlayerVideo.cpp +++ b/lib/PlayerVideo.cpp @@ -622,13 +622,39 @@ PlayerVideo::cb_Bus (GstBus *bus, GstMessage *msg, PlayerVideo *player) { gst_message_parse_error (msg, &error, nullptr); g_assert_nonnull (error); - ERROR ("%s", error->message); + + string advice = ""; + switch (error->code) + { + case GST_CORE_ERROR_MISSING_PLUGIN: + { + advice = "Check if the following plugins are installed: gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad and gstreamer1.0-libav."; + break; + } + default: + break; + } + + ERROR ("%s %s", error->message, advice.c_str ()); } else { gst_message_parse_warning (msg, &error, nullptr); g_assert_nonnull (error); - WARNING ("%s", error->message); + + string advice = ""; + switch (error->code) + { + case GST_LIBRARY_ERROR_ENCODE: + { + advice = "You should verify if there is some decoder installed to run this file type."; + break; + } + default: + break; + } + + WARNING ("%s %s", error->message, advice.c_str ()); } g_error_free (error); gst_object_unref (obj); From 37b2d33df3fb13c27b4fa43e45e6ecec14206293 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 19 Apr 2018 16:57:55 -0300 Subject: [PATCH 061/169] doc: Fix MSYS2 URI. --- extra/windows/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/windows/README.md b/extra/windows/README.md index a609abc05..38e8ddad1 100644 --- a/extra/windows/README.md +++ b/extra/windows/README.md @@ -1,6 +1,6 @@ ## Building the repository on Windows -Download [MSYS2](www.msys2.org). +Download [MSYS2](). To install the dependencies run on MSYS terminal: From 6a1372418873604b2ad885de8ecc054b0a9d098e Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 19 Apr 2018 17:44:13 -0300 Subject: [PATCH 062/169] tests: Remove tests-SigGen-transmisison --- .gitignore | 1 - tests/Makefile.am | 6 - tests/test-SigGen-transmission.cpp | 190 ----------------------------- 3 files changed, 197 deletions(-) delete mode 100644 tests/test-SigGen-transmission.cpp diff --git a/.gitignore b/.gitignore index 9afc729b4..9d8a234ff 100644 --- a/.gitignore +++ b/.gitignore @@ -173,7 +173,6 @@ /tests/test-Predicate-atom /tests/test-Predicate-new /tests/test-Switch-new -/tests/test-SigGen-transmission /tests/test-aux-ginga-parse-bool /tests/test-aux-ginga-parse-color /tests/test-aux-ginga-parse-list diff --git a/tests/Makefile.am b/tests/Makefile.am index b8c0be392..b36347b95 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,9 +27,6 @@ AM_LDFLAGS= -static $(GINGA_ALL_LDFLAGS) LDADD= $(top_builddir)/lib/libginga.la EXTRA_DIST+= tests.h -# Auxiliary programs. -noinst_PROGRAMS= test-SigGen-transmission - # Auxiliary scripts. noinst_SCRIPTS= @@ -57,9 +54,6 @@ AM_TESTS_ENVIRONMENT=\ # Auxiliary programs. -test_SigGen_transmission_SOURCES=\ - test-SigGen-transmission.cpp - # Test applications. ncls= ncls+= xfail-test-img-open.ncl diff --git a/tests/test-SigGen-transmission.cpp b/tests/test-SigGen-transmission.cpp deleted file mode 100644 index d7ed29df2..000000000 --- a/tests/test-SigGen-transmission.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" -#include -// sleep thread -#include -#include -// measure time -#include -#include - -void -bin (unsigned short v, int number[], int size) -{ - for (; size - 1 >= 0; size--) - number[size - 1] = (v >> (size - 1)) & 1; -} - -int -main (void) -{ - string path; - Document *doc; - Formatter *fmt; - string errmsg = ""; - - int const size = 16; - - int number[size]; - - auto start = std::chrono::system_clock::now (); - - path = xpathbuildabs ( - ABS_TOP_SRCDIR, "tests-ncl/test-siggen-bit-13freq-150hz.ncl"); - - fmt = new Formatter (nullptr); - g_assert_nonnull (fmt); - fmt->start (path, &errmsg); - doc = fmt->getDocument (); - g_assert_nonnull (doc); - - short dataToSend[] - = { 1, 7, 5, 4, 19, 1 }; // highest number should be 2^13-1 = 4095 - - fmt->sendTick (4 * GINGA_SECOND, 4 * GINGA_SECOND, 0); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - - Media *m1 = cast (Media *, body->getChildById ("m")); - g_assert_nonnull (m1); - Media *m2 = cast (Media *, body->getChildById ("m2")); - g_assert_nonnull (m2); - Media *m3 = cast (Media *, body->getChildById ("m3")); - g_assert_nonnull (m3); - Media *m4 = cast (Media *, body->getChildById ("m4")); - g_assert_nonnull (m4); - Media *m5 = cast (Media *, body->getChildById ("m5")); - g_assert_nonnull (m5); - Media *m6 = cast (Media *, body->getChildById ("m6")); - g_assert_nonnull (m6); - Media *m7 = cast (Media *, body->getChildById ("m7")); - g_assert_nonnull (m7); - Media *m8 = cast (Media *, body->getChildById ("m8")); - g_assert_nonnull (m8); - Media *m9 = cast (Media *, body->getChildById ("m9")); - g_assert_nonnull (m9); - Media *m10 = cast (Media *, body->getChildById ("m10")); - g_assert_nonnull (m10); - Media *m11 = cast (Media *, body->getChildById ("m11")); - g_assert_nonnull (m11); - Media *m12 = cast (Media *, body->getChildById ("m12")); - g_assert_nonnull (m12); - // Media *m13 = cast (Media *, body->getChildById ("m13")); - // g_assert_nonnull (m13); - - for (int t = 0; t < size; t++) - { - number[t] = 0; - } - - for (int i = 0; i < sizeof (dataToSend) / sizeof (dataToSend[0]); i++) - { - printf ("number: %d\n", dataToSend[i]); - bin (dataToSend[i], number, size); - - for (int t = 0; t < size; t++) - { - printf ("%d", number[t]); - } - - printf ("\n"); - - if (number[0]) - m1->setProperty ("volume", "0.5"); - else - m1->setProperty ("volume", "0"); - if (number[1]) - m2->setProperty ("volume", "0.5"); - else - m2->setProperty ("volume", "0"); - if (number[2]) - m3->setProperty ("volume", "0.5"); - else - m3->setProperty ("volume", "0"); - if (number[3]) - m4->setProperty ("volume", "0.5"); - else - m4->setProperty ("volume", "0"); - if (number[4]) - m5->setProperty ("volume", "0.5"); - else - m5->setProperty ("volume", "0"); - if (number[5]) - m6->setProperty ("volume", "0.5"); - else - m6->setProperty ("volume", "0"); - if (number[6]) - m7->setProperty ("volume", "0.5"); - else - m7->setProperty ("volume", "0"); - if (number[7]) - m8->setProperty ("volume", "0.5"); - else - m8->setProperty ("volume", "0"); - if (number[8]) - m9->setProperty ("volume", "0.5"); - else - m9->setProperty ("volume", "0"); - if (number[9]) - m10->setProperty ("volume", "0.5"); - else - m10->setProperty ("volume", "0"); - if (number[10]) - m11->setProperty ("volume", "0.5"); - else - m11->setProperty ("volume", "0"); - if (number[11]) - m12->setProperty ("volume", "0.5"); - else - m12->setProperty ("volume", "0"); - // if (number[13]) m13->setProperty ("volume", "0.5"); else - // m13->setProperty ("volume", "0"); - - std::this_thread::sleep_for (std::chrono::milliseconds (300)); - - for (int t = 0; t < size; t++) - { - number[t] = 0; - } - - m1->setProperty ("volume", "0"); - m2->setProperty ("volume", "0"); - m3->setProperty ("volume", "0"); - m4->setProperty ("volume", "0"); - m5->setProperty ("volume", "0"); - m6->setProperty ("volume", "0"); - m7->setProperty ("volume", "0"); - m8->setProperty ("volume", "0"); - m9->setProperty ("volume", "0"); - m10->setProperty ("volume", "0"); - m11->setProperty ("volume", "0"); - m12->setProperty ("volume", "0"); - - std::this_thread::sleep_for (std::chrono::milliseconds (50)); - } - - auto end = std::chrono::system_clock::now (); - std::chrono::duration elapsed_seconds = end - start; - - std::cout << "elapsed time: " << elapsed_seconds.count () << "s\n"; - - while (true) - ; -} \ No newline at end of file From d91acd9b67315611f2dfcde22f4819ea0c3b90f3 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 20 Apr 2018 10:20:53 -0300 Subject: [PATCH 063/169] tests: Tests anchors state and refactory in test-Media-anchors-started-from-* --- .../test-Media-anchors-started-from-links.cpp | 26 ++- .../test-Media-anchors-started-from-ports.cpp | 185 +++++++++++++++++- 2 files changed, 197 insertions(+), 14 deletions(-) diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp index 2703f8bb8..3aa7b31c2 100644 --- a/tests/test-Media-anchors-started-from-links.cpp +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -556,7 +556,7 @@ main (void) \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ @@ -573,6 +573,18 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 20 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -581,18 +593,22 @@ main (void) // -------------------------------- // check start document + // when start document, a1 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); + // -------------------------------- + // main check + // when advance 10, a1 is OCCURRING and the sendcond start is ignored fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); delete fmt; diff --git a/tests/test-Media-anchors-started-from-ports.cpp b/tests/test-Media-anchors-started-from-ports.cpp index 22469b6dd..561962652 100644 --- a/tests/test-Media-anchors-started-from-ports.cpp +++ b/tests/test-Media-anchors-started-from-ports.cpp @@ -66,6 +66,23 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 0); + g_assert_cmpuint (end, ==, 20 * GINGA_SECOND); + Event *a3 = m1->getPresentationEvent ("a3"); + g_assert_nonnull (a3); + a3->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 30 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -79,13 +96,45 @@ main (void) g_assert (m2_lambda->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); + // when start document, a2 is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::OCCURRING); + // TODO: this should SLEEPING + // g_assert (a3->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // when advance 10s, a1 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + // TODO: this should SLEEPING + // g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + // when advance more 10s, a2 is SLEEPING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); + // TODO: this should SLEEPING + // g_assert (a3->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + // when advance more 10s, m1 is SLEEPING and m2 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; @@ -138,6 +187,23 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 20 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a3 = m1->getPresentationEvent ("a3"); + g_assert_nonnull (a3); + a3->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 30 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -151,13 +217,22 @@ main (void) g_assert (m2_lambda->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); + // when advance 10s, a1 and a2 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (a3->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::OCCURRING); - fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + // when advance 10s, a1, a2, a3 and m2 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (a3->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; @@ -210,6 +285,23 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 20 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a3 = m1->getPresentationEvent ("a3"); + g_assert_nonnull (a3); + a3->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 30 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -223,13 +315,25 @@ main (void) g_assert (m2_lambda->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); + // when start document, a2 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + // -------------------------------- + // main check + + // when advance 10s, a2 and a3 is OCCURRING + fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + // TODO: this should SLEEPING + // g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (a3->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); delete fmt; @@ -281,6 +385,18 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 20 * GINGA_SECOND); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 15 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 25 * GINGA_SECOND); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -294,12 +410,21 @@ main (void) g_assert (m2_lambda->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); + // when start document, a1 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (25 * GINGA_SECOND, 25 * GINGA_SECOND, 0); + // -------------------------------- + // main check + + // when advance 15s, a1 and a2 is SLEEPING + fmt->sendTick (15 * GINGA_SECOND, 15 * GINGA_SECOND, 0); g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); delete fmt; @@ -351,6 +476,18 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 20 * GINGA_SECOND); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 5 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 15 * GINGA_SECOND); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -364,13 +501,22 @@ main (void) g_assert (m2_lambda->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); + // when start document, a1 and a2 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); - fmt->sendTick (20 * GINGA_SECOND, 20 * GINGA_SECOND, 0); + // -------------------------------- + // main check + + // when advance 5, a1 and a2 is OCCURRING + fmt->sendTick (5 * GINGA_SECOND, 5 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; @@ -404,7 +550,7 @@ main (void) \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ @@ -421,6 +567,18 @@ main (void) Event *m1_lambda = m1->getLambda (); g_assert_nonnull (m1_lambda); + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 20 * GINGA_SECOND); + g_assert_cmpuint (end, ==, GINGA_TIME_NONE); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); g_assert_nonnull (m2); Event *m2_lambda = m2->getLambda (); @@ -430,17 +588,26 @@ main (void) // check start document g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); + // when start document, a1 is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); + // -------------------------------- + // main check + + // when advance 10, a1 is OCCURRING and the sendcond start is ignored fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); delete fmt; From 23e074084f35d8de2115a8335d36877208c0a3e5 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 20 Apr 2018 11:15:44 -0300 Subject: [PATCH 064/169] tests: Convert test-Event-transtion-Media-{start,stop,pause,resume} in test-Media-transition-{presentation,selection,attribution} --- .gitignore | 8 +- tests/Makefile.am | 29 +- tests/test-Event-transition-Media-abort.cpp | 288 ---- tests/test-Event-transition-Media-pause.cpp | 292 ---- tests/test-Event-transition-Media-resume.cpp | 292 ---- tests/test-Event-transition-Media-start.cpp | 484 ------ tests/test-Event-transition-Media-stop.cpp | 291 ---- tests/test-Media-transition-attribution.cpp | 24 + tests/test-Media-transition-presentation.cpp | 1435 ++++++++++++++++++ tests/test-Media-transition-selection.cpp | 24 + 10 files changed, 1495 insertions(+), 1672 deletions(-) delete mode 100644 tests/test-Event-transition-Media-abort.cpp delete mode 100644 tests/test-Event-transition-Media-pause.cpp delete mode 100644 tests/test-Event-transition-Media-resume.cpp delete mode 100644 tests/test-Event-transition-Media-start.cpp delete mode 100644 tests/test-Event-transition-Media-stop.cpp create mode 100644 tests/test-Media-transition-attribution.cpp create mode 100644 tests/test-Media-transition-presentation.cpp create mode 100644 tests/test-Media-transition-selection.cpp diff --git a/.gitignore b/.gitignore index 9d8a234ff..4787ab854 100644 --- a/.gitignore +++ b/.gitignore @@ -132,11 +132,9 @@ /tests/test-Event-transition-Context-resume /tests/test-Event-transition-Context-start /tests/test-Event-transition-Context-stop -/tests/test-Event-transition-Media-abort -/tests/test-Event-transition-Media-pause -/tests/test-Event-transition-Media-resume -/tests/test-Event-transition-Media-start -/tests/test-Event-transition-Media-stop +/tests/test-Media-transition-attribution +/tests/test-Media-transition-presentation +/tests/test-Media-transition-selection /tests/test-Event-transition-Switch-abort /tests/test-Event-transition-Switch-pause /tests/test-Event-transition-Switch-resume diff --git a/tests/Makefile.am b/tests/Makefile.am index b36347b95..9f15ee6a7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -213,10 +213,6 @@ progs+= test-Event-getEventTransitionAsString test_Event_getEventTransitionAsString_SOURCES=\ test-Event-getEventTransitionAsString.cpp -progs+= test-Event-transition-Media-start -test_Event_transition_Media_start_SOURCES=\ - test-Event-transition-Media-start.cpp - progs+= test-Event-transition-Context-start test_Event_transition_Context_start_SOURCES=\ test-Event-transition-Context-start.cpp @@ -237,10 +233,6 @@ progs+= test-Context-ports-started-from-links test_Context_ports_started_from_links_SOURCES=\ test-Context-ports-started-from-links.cpp -progs+= test-Event-transition-Media-stop -test_Event_transition_Media_stop_SOURCES=\ - test-Event-transition-Media-stop.cpp - progs+= test-Event-transition-Context-stop test_Event_transition_Context_stop_SOURCES=\ test-Event-transition-Context-stop.cpp @@ -249,10 +241,6 @@ progs+= test-Event-transition-Switch-stop test_Event_transition_Switch_stop_SOURCES=\ test-Event-transition-Switch-stop.cpp -progs+= test-Event-transition-Media-abort -test_Event_transition_Media_abort_SOURCES=\ - test-Event-transition-Media-abort.cpp - progs+= test-Event-transition-Context-abort test_Event_transition_Context_abort_SOURCES=\ test-Event-transition-Context-abort.cpp @@ -261,10 +249,6 @@ progs+= test-Event-transition-Switch-abort test_Event_transition_Switch_abort_SOURCES=\ test-Event-transition-Switch-abort.cpp -progs+= test-Event-transition-Media-pause -test_Event_transition_Media_pause_SOURCES=\ - test-Event-transition-Media-pause.cpp - progs+= test-Event-transition-Context-pause test_Event_transition_Context_pause_SOURCES=\ test-Event-transition-Context-pause.cpp @@ -273,10 +257,6 @@ progs+= test-Event-transition-Switch-pause test_Event_transition_Switch_pause_SOURCES=\ test-Event-transition-Switch-pause.cpp -progs+= test-Event-transition-Media-resume -test_Event_transition_Media_resume_SOURCES=\ - test-Event-transition-Media-resume.cpp - progs+= test-Event-transition-Context-resume test_Event_transition_Context_resume_SOURCES=\ test-Event-transition-Context-resume.cpp @@ -315,6 +295,15 @@ test_Media_focusIndex_SOURCES= test-Media-focusIndex.cpp progs+= test-Media-mime test_Media_mime_SOURCES= test-Media-mime.cpp +progs+= test-Media-transition-presentation +test_Media_transition_presentation_SOURCES= test-Media-transition-presentation.cpp + +progs+= test-Media-transition-selection +test_Media_transition_selection_SOURCES= test-Media-transition-selection.cpp + +progs+= test-Media-transition-attribution +test_Media_transition_attribution_SOURCES= test-Media-transition-attribution.cpp + progs+= test-Media-anchors-started-from-ports test_Media_anchors_started_from_ports_SOURCES= test-Media-anchors-started-from-ports.cpp diff --git a/tests/test-Event-transition-Media-abort.cpp b/tests/test-Event-transition-Media-abort.cpp deleted file mode 100644 index fae4b5269..000000000 --- a/tests/test-Event-transition-Media-abort.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: ABORT from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // ABORT is done and return true - g_assert (m1_lambda->transition (Event::ABORT)); - - // after ABORT all events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: ABORT from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are PAUSED - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::ABORT)); - - // after PAUSE all events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: ABORT from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (m1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // ABORT is not done and return false - g_assert_false (m1_lambda->transition (Event::ABORT)); - - // after ABORT all events are still SLEEPING - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Attribution events ---------------------------------------------------- - - // Selection events ------------------------------------------------------ - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Media-pause.cpp b/tests/test-Event-transition-Media-pause.cpp deleted file mode 100644 index 5ea810d88..000000000 --- a/tests/test-Event-transition-Media-pause.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: PAUSE from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are PAUSED - // anchors are in PAUSED and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: PAUSE from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are PAUSED - // anchors are in PAUSED and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // PAUSE is done and return false - g_assert_false (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are PAUSED - // anchors are in PAUSED and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: PAUSE from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (m1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // PAUSE is not done and return false - g_assert_false (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are still SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Attribution events ---------------------------------------------------- - - // Selection events ------------------------------------------------------ - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Media-resume.cpp b/tests/test-Event-transition-Media-resume.cpp deleted file mode 100644 index c44e10001..000000000 --- a/tests/test-Event-transition-Media-resume.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: RESUME from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // RESUME is done and return false - g_assert_false (m1_lambda->transition (Event::RESUME)); - - // after RESUME all events are still OCCURRING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: RESUME from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE, anchors events go to PAUSED - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // RESUME is done and return true - g_assert_true (m1_lambda->transition (Event::RESUME)); - - // after RESUME, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - delete fmt; - } - - // @lambda: RESUME from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (m1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // PAUSE is not done and return false - g_assert_false (m1_lambda->transition (Event::RESUME)); - - // after PAUSE all events are still SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Attribution events - // ---------------------------------------------------- - - // Selection events - // ------------------------------------------------------ - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Media-start.cpp b/tests/test-Event-transition-Media-start.cpp deleted file mode 100644 index d5ce733e2..000000000 --- a/tests/test-Event-transition-Media-start.cpp +++ /dev/null @@ -1,484 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: START from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START is done and return false - g_assert_false (m1_lambda->transition (Event::START)); - - // after START all timed events are OCCURRING - g_assert (body_lambda->getState () == Event::OCCURRING); - - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: START from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE lambda and timed anchors are PAUSED and - // labelled anchors and properties are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert_true (m1_lambda->transition (Event::START)); - - // after START all events are OCCURRING - g_assert (body_lambda->getState () == Event::OCCURRING); - - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, timed anchors events go to OCCURRING - // and labelled anchors and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: START from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (m1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert_true (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, timed anchors events go to OCCURRING - // and labelled anchors and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // START events in a labeled area ---------------------------------------- - - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - // g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START labelled anchor - g_assert_false (m1_a2->transition (Event::START)); - - // after START a2 timed anchors are OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - - g_assert (m1_lambda->getState () == Event::OCCURRING); - // g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Selection events ------------------------------------------------------ - - // Attribution events ---------------------------------------------------- - - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START AttributionEvent is done and return true - g_assert (m1_p1->setParameter ("value", "1")); - g_assert (m1_p1->transition (Event::START)); - - // after START AttributionEvent is OCCURRING - g_assert (m1_p1->getState () == Event::OCCURRING); - g_assert (m1->getProperty ("p1") == "1"); - - // when advance time AttributionEvent is SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Selection events ------------------------------------------------------ - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Media-stop.cpp b/tests/test-Event-transition-Media-stop.cpp deleted file mode 100644 index 5d802d78e..000000000 --- a/tests/test-Event-transition-Media-stop.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: STOP from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (m1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: STOP from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE lambda and anchors are PAUSED and - // properties are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // STOP is done and return true - g_assert_true (m1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: STOP from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (m1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // STOP is done and return false - g_assert_false (m1_lambda->transition (Event::STOP)); - - // after STOP all events are still SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Attribution events ---------------------------------------------------- - - // Selection events ------------------------------------------------------ - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Media-transition-attribution.cpp b/tests/test-Media-transition-attribution.cpp new file mode 100644 index 000000000..375f59f3e --- /dev/null +++ b/tests/test-Media-transition-attribution.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Media-transition-presentation.cpp b/tests/test-Media-transition-presentation.cpp new file mode 100644 index 000000000..e67d642d2 --- /dev/null +++ b/tests/test-Media-transition-presentation.cpp @@ -0,0 +1,1435 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // ABORT lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // ABORT is done and return true + g_assert (m1_lambda->transition (Event::ABORT)); + + // after ABORT all events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // ABORT lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (m1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are PAUSED + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m1_a1->getState () == Event::PAUSED); + g_assert (m1_a2->getState () == Event::PAUSED); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // PAUSE is done and return true + g_assert_true (m1_lambda->transition (Event::ABORT)); + + // after PAUSE all events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // ABORT lambda from state SLEEPING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (m1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // ABORT is not done and return false + g_assert_false (m1_lambda->transition (Event::ABORT)); + + // after ABORT all events are still SLEEPING + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // PAUSE lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (m1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are PAUSED + // anchors are in PAUSED and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m1_a1->getState () == Event::PAUSED); + g_assert (m1_a2->getState () == Event::PAUSED); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // PAUSE lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (m1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are PAUSED + // anchors are in PAUSED and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m1_a1->getState () == Event::PAUSED); + g_assert (m1_a2->getState () == Event::PAUSED); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // PAUSE is done and return false + g_assert_false (m1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are PAUSED + // anchors are in PAUSED and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m1_a1->getState () == Event::PAUSED); + g_assert (m1_a2->getState () == Event::PAUSED); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // PAUSE lambda from state SLEEPING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (m1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // PAUSE is not done and return false + g_assert_false (m1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // RESUME lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // RESUME is done and return false + g_assert_false (m1_lambda->transition (Event::RESUME)); + + // after RESUME all events are still OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // RESUME lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (m1_lambda->transition (Event::PAUSE)); + + // after PAUSE, anchors events go to PAUSED + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m1_a1->getState () == Event::PAUSED); + g_assert (m1_a2->getState () == Event::PAUSED); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // RESUME is done and return true + g_assert_true (m1_lambda->transition (Event::RESUME)); + + // after RESUME, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + delete fmt; + } + + // RESUME lambda from state SLEEPING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (m1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // PAUSE is not done and return false + g_assert_false (m1_lambda->transition (Event::RESUME)); + + // after PAUSE all events are still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // START is done and return false + g_assert_false (m1_lambda->transition (Event::START)); + + // after START all timed events are OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (m1_lambda->transition (Event::PAUSE)); + + // after PAUSE lambda and timed anchors are PAUSED and + // labelled anchors and properties are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m1_a1->getState () == Event::PAUSED); + g_assert (m1_a2->getState () == Event::PAUSED); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert_true (m1_lambda->transition (Event::START)); + + // after START all events are OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::PAUSED); + g_assert (m1_a2->getState () == Event::PAUSED); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, timed anchors events go to OCCURRING + // and labelled anchors and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state SLEEPING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (m1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert_true (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, timed anchors events go to OCCURRING + // and labelled anchors and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // START labeled area ---------------------------------------- + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + // g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // START labeled anchor + g_assert_false (m1_a2->transition (Event::START)); + + // after START a2 timed anchors are OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + + g_assert (m1_lambda->getState () == Event::OCCURRING); + // g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (m1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (m1_lambda->transition (Event::PAUSE)); + + // after PAUSE lambda and anchors are PAUSED and + // properties are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m1_a1->getState () == Event::PAUSED); + g_assert (m1_a2->getState () == Event::PAUSED); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // STOP is done and return true + g_assert_true (m1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP lambda from state SLEEPING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_a1 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a1); + Event *m1_a2 = m1->getPresentationEvent ("a1"); + g_assert_nonnull (m1_a2); + Event *m1_p1 = m1->getAttributionEvent ("p1"); + g_assert_nonnull (m1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING and + // anchors are in SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_a1->getState () == Event::OCCURRING); + g_assert (m1_a2->getState () == Event::OCCURRING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (m1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + // STOP is done and return false + g_assert_false (m1_lambda->transition (Event::STOP)); + + // after STOP all events are still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_a1->getState () == Event::SLEEPING); + g_assert (m1_a2->getState () == Event::SLEEPING); + g_assert (m1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Media-transition-selection.cpp b/tests/test-Media-transition-selection.cpp new file mode 100644 index 000000000..375f59f3e --- /dev/null +++ b/tests/test-Media-transition-selection.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + exit (EXIT_SUCCESS); +} From 3423dea6967ee43d99a265cda4e9cf0b7400abeb Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 20 Apr 2018 14:46:05 -0300 Subject: [PATCH 065/169] tests: Convert test-Event-transtion-Switch-{start,stop,pause,resume} in test-Switch-transition-{presentation,selection,attribution} --- .gitignore | 8 +- tests/Makefile.am | 29 +- tests/test-Switch-transition-attribution.cpp | 24 + tests/test-Switch-transition-presentation.cpp | 442 ++++++++++++++++++ tests/test-Switch-transition-selection.cpp | 24 + 5 files changed, 502 insertions(+), 25 deletions(-) create mode 100644 tests/test-Switch-transition-attribution.cpp create mode 100644 tests/test-Switch-transition-presentation.cpp create mode 100644 tests/test-Switch-transition-selection.cpp diff --git a/.gitignore b/.gitignore index 4787ab854..7d3e8076c 100644 --- a/.gitignore +++ b/.gitignore @@ -135,11 +135,9 @@ /tests/test-Media-transition-attribution /tests/test-Media-transition-presentation /tests/test-Media-transition-selection -/tests/test-Event-transition-Switch-abort -/tests/test-Event-transition-Switch-pause -/tests/test-Event-transition-Switch-resume -/tests/test-Event-transition-Switch-start -/tests/test-Event-transition-Switch-stop +/tests/test-Switch-transition-attribution +/tests/test-Switch-transition-presentation +/tests/test-Switch-transition-selection /tests/test-Ginga-create /tests/test-Ginga-getOptionBool /tests/test-Ginga-getOptionInt diff --git a/tests/Makefile.am b/tests/Makefile.am index 9f15ee6a7..09f13f766 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -217,10 +217,6 @@ progs+= test-Event-transition-Context-start test_Event_transition_Context_start_SOURCES=\ test-Event-transition-Context-start.cpp -progs+= test-Event-transition-Switch-start -test_Event_transition_Switch_start_SOURCES=\ - test-Event-transition-Switch-start.cpp - progs+= test-Context-ports test_Context_ports_SOURCES=\ test-Context-ports.cpp @@ -237,34 +233,18 @@ progs+= test-Event-transition-Context-stop test_Event_transition_Context_stop_SOURCES=\ test-Event-transition-Context-stop.cpp -progs+= test-Event-transition-Switch-stop -test_Event_transition_Switch_stop_SOURCES=\ - test-Event-transition-Switch-stop.cpp - progs+= test-Event-transition-Context-abort test_Event_transition_Context_abort_SOURCES=\ test-Event-transition-Context-abort.cpp -progs+= test-Event-transition-Switch-abort -test_Event_transition_Switch_abort_SOURCES=\ - test-Event-transition-Switch-abort.cpp - progs+= test-Event-transition-Context-pause test_Event_transition_Context_pause_SOURCES=\ test-Event-transition-Context-pause.cpp -progs+= test-Event-transition-Switch-pause -test_Event_transition_Switch_pause_SOURCES=\ - test-Event-transition-Switch-pause.cpp - progs+= test-Event-transition-Context-resume test_Event_transition_Context_resume_SOURCES=\ test-Event-transition-Context-resume.cpp -progs+= test-Event-transition-Switch-resume -test_Event_transition_Switch_resume_SOURCES=\ - test-Event-transition-Switch-resume.cpp - # lib/Object.h ------------------------------------------------------------- progs+= test-Object-addAlias test_Object_addAlias_SOURCES= test-Object-addAlias.cpp @@ -331,6 +311,15 @@ test_Context_nested_naturalend_SOURCES= test-Context-nested-naturalend.cpp progs+= test-Switch-new test_Switch_new_SOURCES= test-Switch-new.cpp +progs+= test-Switch-transition-presentation +test_Switch_transition_presentation_SOURCES= test-Switch-transition-presentation.cpp + +progs+= test-Switch-transition-attribution +test_Switch_transition_attribution_SOURCES= test-Switch-transition-attribution.cpp + +progs+= test-Switch-transition-selection +test_Switch_transition_selection_SOURCES= test-Switch-transition-selection.cpp + # lib/Parser.h ------------------------------------------------------------- progs+= test-Parser-parseFile test_Parser_parseFile_SOURCES= test-Parser-parseFile.cpp diff --git a/tests/test-Switch-transition-attribution.cpp b/tests/test-Switch-transition-attribution.cpp new file mode 100644 index 000000000..375f59f3e --- /dev/null +++ b/tests/test-Switch-transition-attribution.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Switch-transition-presentation.cpp b/tests/test-Switch-transition-presentation.cpp new file mode 100644 index 000000000..3e72e6fb0 --- /dev/null +++ b/tests/test-Switch-transition-presentation.cpp @@ -0,0 +1,442 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // ABORT lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // after advance time, s1@lambda is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // ABORT is done + g_assert (swt_lambda->transition (Event::ABORT)); + + // after start, s1@lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // After advancing time, s1@lambda and m1@lambda are OCCURRING. + // m2@lambda is not selected, and is not OCCURRING. + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done + g_assert (swt_lambda->transition (Event::PAUSE)); + + // after start, s1@lambda is PAUSED + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::PAUSED); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // RESUME lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // After advancing time, s1@lambda and m1@lambda is OCCURRING. + // m2@lambda is not selected, and is not OCCURRING. + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // main check + + // RESUME is not done + g_assert_false (swt_lambda->transition (Event::RESUME)); + + // after start, s1@lambda is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // After advancing time, s1@lambda and m1@lambda are OCCURRING. + // m2@lambda is not selected, and is not OCCURRING. + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // START is not done + g_assert_false (swt_lambda->transition (Event::START)); + + // after start, s1@lambda is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + MediaSettings *stgs + = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); + g_assert_nonnull (stgs); + Event *stgs_lambda = stgs->getLambda (); + g_assert_nonnull (stgs_lambda); + + Switch *swt = cast (Switch *, body->getChildById ("s1")); + g_assert_nonnull (swt); + Event *swt_lambda = swt->getLambda (); + g_assert_nonnull (swt_lambda); + + Media *m1 = cast (Media *, swt->getChildById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, swt->getChildById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // When the document is started, only the body@lambda is OCCURRING. + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // After advancing time, s1@lambda and m1@lambda is OCCURRING. + // m2@lambda is not selected, and is not OCCURRING. + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done + g_assert (swt_lambda->transition (Event::STOP)); + + // after STOP, s1@lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Switch-transition-selection.cpp b/tests/test-Switch-transition-selection.cpp new file mode 100644 index 000000000..375f59f3e --- /dev/null +++ b/tests/test-Switch-transition-selection.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + exit (EXIT_SUCCESS); +} From 65b3c1b8a8e81382dfdac56077ce87fd9b91edc5 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 20 Apr 2018 17:25:27 -0300 Subject: [PATCH 066/169] tests: Convert test-Event-transtion-Context-{start,stop,pause,resume} in test-Context-transition-{presentation,selection,attribution} --- .gitignore | 8 +- tests/Makefile.am | 9 + tests/test-Context-transition-attribution.cpp | 24 + .../test-Context-transition-presentation.cpp | 1442 +++++++++++++++++ tests/test-Context-transition-selection.cpp | 24 + 5 files changed, 1502 insertions(+), 5 deletions(-) create mode 100644 tests/test-Context-transition-attribution.cpp create mode 100644 tests/test-Context-transition-presentation.cpp create mode 100644 tests/test-Context-transition-selection.cpp diff --git a/.gitignore b/.gitignore index 7d3e8076c..1bd37b68b 100644 --- a/.gitignore +++ b/.gitignore @@ -127,11 +127,9 @@ /tests/test-Event-new /tests/test-Event-setInterval /tests/test-Event-setParameter -/tests/test-Event-transition-Context-abort -/tests/test-Event-transition-Context-pause -/tests/test-Event-transition-Context-resume -/tests/test-Event-transition-Context-start -/tests/test-Event-transition-Context-stop +/tests/test-Context-transition-attribution +/tests/test-Context-transition-presentation +/tests/test-Context-transition-selection /tests/test-Media-transition-attribution /tests/test-Media-transition-presentation /tests/test-Media-transition-selection diff --git a/tests/Makefile.am b/tests/Makefile.am index 09f13f766..fc103d2a9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -307,6 +307,15 @@ test_Context_naturalend_SOURCES= test-Context-naturalend.cpp progs+= test-Context-nested-naturalend test_Context_nested_naturalend_SOURCES= test-Context-nested-naturalend.cpp +progs+= test-Context-transition-presentation +test_Context_transition_presentation_SOURCES= test-Context-transition-presentation.cpp + +progs+= test-Context-transition-attribution +test_Context_transition_attribution_SOURCES= test-Context-transition-attribution.cpp + +progs+= test-Context-transition-selection +test_Context_transition_selection_SOURCES= test-Context-transition-selection.cpp + # lib/Switch.h ------------------------------------------------------------ progs+= test-Switch-new test_Switch_new_SOURCES= test-Switch-new.cpp diff --git a/tests/test-Context-transition-attribution.cpp b/tests/test-Context-transition-attribution.cpp new file mode 100644 index 000000000..375f59f3e --- /dev/null +++ b/tests/test-Context-transition-attribution.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Context-transition-presentation.cpp b/tests/test-Context-transition-presentation.cpp new file mode 100644 index 000000000..ed602854b --- /dev/null +++ b/tests/test-Context-transition-presentation.cpp @@ -0,0 +1,1442 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + // ABORT lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // ABORT is done and return true + g_assert_true (c1_lambda->transition (Event::ABORT)); + + // after ABORT all events are SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // ABORT lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (c1_lambda->transition (Event::PAUSE)); + + // after PAUSE, c1@lambda and its anchors + // are PAUSED, and its properties are SLEEPING + g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::PAUSED); + g_assert (c1_port2->getState () == Event::PAUSED); + + // ABORT is done and return true + g_assert_true (c1_lambda->transition (Event::ABORT)); + + // after ABORT all events are SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + + delete fmt; + } + + // ABORT lambda from state SLEEPING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (c1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // ABORT is not done and return false + g_assert_false (c1_lambda->transition (Event::ABORT)); + + // after ABORT all events are still SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + delete fmt; + } + + // PAUSE lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (c1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are PAUSED + g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_port1->getState () == Event::PAUSED); + g_assert (c1_port2->getState () == Event::PAUSED); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // PAUSE lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (c1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are PAUSED + g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_port1->getState () == Event::PAUSED); + g_assert (c1_port2->getState () == Event::PAUSED); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // PAUSE is not done and return false + g_assert_false (c1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are still PAUSED + g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_port1->getState () == Event::PAUSED); + g_assert (c1_port2->getState () == Event::PAUSED); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // PAUSE lambda from state SLEEPING. + + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (c1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // PAUSE is not done and return false + g_assert_false (c1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events still SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // RESUME lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + + // RESUME is done and return true + g_assert_false (c1_lambda->transition (Event::RESUME)); + + // after RESUME, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + + delete fmt; + } + + // RESUME lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (c1_lambda->transition (Event::PAUSE)); + + // after PAUSE, anchors events go to PAUSED + // and properties events are SLEEPING + g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_port1->getState () == Event::PAUSED); + g_assert (c1_port2->getState () == Event::PAUSED); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // RESUME is done and return true + g_assert_true (c1_lambda->transition (Event::RESUME)); + + // after RESUME, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // RESUME lambda from state SLEEPING. + + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (c1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // RESUME is not done and return false + g_assert_false (c1_lambda->transition (Event::RESUME)); + + // after PAUSE all events still SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // START is not done and return false + g_assert_false (c1_lambda->transition (Event::START)); + + // after start, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (c1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are PAUSED + g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_port1->getState () == Event::PAUSED); + g_assert (c1_port2->getState () == Event::PAUSED); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert_true (c1_lambda->transition (Event::START)); + + // after start, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::PAUSED); + g_assert (c1_port2->getState () == Event::PAUSED); + g_assert (c1_p1->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state SLEEPING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert (c1_lambda->transition (Event::STOP)); + + // after STOP, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // START is done and return true + g_assert_true (c1_lambda->transition (Event::START)); + + // after START, c1@lambda is SLEEPING and its anchors + // and properties are SLEEPING + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // Attribution events ---------------------------------------------------- + + // START from state SLEEPING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // START AttributionEvent is done and return true + g_assert (c1_p1->setParameter ("value", "1")); + g_assert_true (c1_p1->transition (Event::START)); + + // after START AttributionEvent is OCCURRING + g_assert (c1_p1->getState () == Event::OCCURRING); + g_assert (c1->getProperty ("p1") == "1"); + + // when advance time AttributionEvent is SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP c1_lambda from state OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert_true (c1_lambda->transition (Event::STOP)); + + // after STOP all events are SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP c1_lambda from state PAUSED. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // PAUSE is done and return true + g_assert_true (c1_lambda->transition (Event::PAUSE)); + + // after PAUSE all events are PAUSED + g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_port1->getState () == Event::PAUSED); + g_assert (c1_port2->getState () == Event::PAUSED); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // STOP is done and return true + g_assert_true (c1_lambda->transition (Event::STOP)); + + // after STOP all events are still SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP c1_lambda from state SLEEPING. + + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Context *c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + Event *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + + Event *c1_p1 = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_p1); + + auto iter = c1->getPorts ()->begin (); + Event *c1_port1 = *iter; + g_assert_nonnull (c1_port1); + iter++; + Event *c1_port2 = *iter; + g_assert_nonnull (c1_port2); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_lambda->getState () == Event::SLEEPING); + + // after advance time, c1@lambda is OCCURRING, and its + // anchors and properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // after advance time, c1@lambda and its anchors + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_port1->getState () == Event::OCCURRING); + g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // STOP is done and return true + g_assert (c1_lambda->transition (Event::STOP)); + + // after STOP all events SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + // STOP is not done and return false + g_assert_false (c1_lambda->transition (Event::STOP)); + + // after STOP all events still SLEEPING + g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_port1->getState () == Event::SLEEPING); + g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_p1->getState () == Event::SLEEPING); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Context-transition-selection.cpp b/tests/test-Context-transition-selection.cpp new file mode 100644 index 000000000..375f59f3e --- /dev/null +++ b/tests/test-Context-transition-selection.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + exit (EXIT_SUCCESS); +} From 9b3fc01aa2466be63f9bea207292ef79db2adb95 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 20 Apr 2018 18:25:29 -0300 Subject: [PATCH 067/169] tests: Remove test-Event-transition-Context from build --- tests/Makefile.am | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index fc103d2a9..d32d1f0b4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -213,10 +213,6 @@ progs+= test-Event-getEventTransitionAsString test_Event_getEventTransitionAsString_SOURCES=\ test-Event-getEventTransitionAsString.cpp -progs+= test-Event-transition-Context-start -test_Event_transition_Context_start_SOURCES=\ - test-Event-transition-Context-start.cpp - progs+= test-Context-ports test_Context_ports_SOURCES=\ test-Context-ports.cpp @@ -229,22 +225,6 @@ progs+= test-Context-ports-started-from-links test_Context_ports_started_from_links_SOURCES=\ test-Context-ports-started-from-links.cpp -progs+= test-Event-transition-Context-stop -test_Event_transition_Context_stop_SOURCES=\ - test-Event-transition-Context-stop.cpp - -progs+= test-Event-transition-Context-abort -test_Event_transition_Context_abort_SOURCES=\ - test-Event-transition-Context-abort.cpp - -progs+= test-Event-transition-Context-pause -test_Event_transition_Context_pause_SOURCES=\ - test-Event-transition-Context-pause.cpp - -progs+= test-Event-transition-Context-resume -test_Event_transition_Context_resume_SOURCES=\ - test-Event-transition-Context-resume.cpp - # lib/Object.h ------------------------------------------------------------- progs+= test-Object-addAlias test_Object_addAlias_SOURCES= test-Object-addAlias.cpp From d62cee40f6aaccf47c097ab9e273c0d97827099d Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 20 Apr 2018 18:25:59 -0300 Subject: [PATCH 068/169] tests: Update test-Media-transition-selection.cpp --- tests/test-Media-transition-selection.cpp | 93 +++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/tests/test-Media-transition-selection.cpp b/tests/test-Media-transition-selection.cpp index 375f59f3e..2e89572ab 100644 --- a/tests/test-Media-transition-selection.cpp +++ b/tests/test-Media-transition-selection.cpp @@ -20,5 +20,98 @@ along with Ginga. If not, see . */ int main (void) { + // ABORT selection when Media is OCCURRING. + // ABORT selection when Media is PAUSED. + // ABORT selection when Media is SLEEPING. + + // PAUSE selection when Media is OCCURRING. + // PAUSE selection when Media is PAUSED. + // PAUSE selection when Media is SLEEPING. + + // START selection when Media is OCCURRING. + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + puts(m1->toString ().c_str ()); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_selection = m1->getSelectionEvent (""); + g_assert_nonnull (m1_selection); + + // -------------------------------- + // check start document + + // when document is started, only the body@lambda is OCCURING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_selection->getState () == Event::SLEEPING); + + // START is done and return true + g_assert (m1_lambda->transition (Event::START)); + + // after START lambda is in OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_selection->getState () == Event::SLEEPING); + + // advance time + fmt->sendTick (0, 0, 0); + + // when advance time, anchors events go to OCCURRING + // and properties events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_selection->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + + // START is done + g_assert (m1_selection->transition (Event::START)); + + // after START, selection is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_selection->getState () == Event::OCCURRING); + + delete fmt; + } + + // START selection when Media is PAUSED. + // START selection when Media is SLEEPING. + + // STOP selection when Media is OCCURRING. + // STOP selection when Media is PAUSED. + // STOP selection when Media is SLEEPING. + exit (EXIT_SUCCESS); } From 86f1026cead977316a8532c506a3976d368994f1 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 22 Apr 2018 14:25:14 -0300 Subject: [PATCH 069/169] tests: Remove old test-Event-transition-* --- tests/test-Event-transition-Context-abort.cpp | 287 ------------- tests/test-Event-transition-Context-pause.cpp | 292 ------------- .../test-Event-transition-Context-resume.cpp | 296 ------------- tests/test-Event-transition-Context-start.cpp | 393 ------------------ tests/test-Event-transition-Context-stop.cpp | 288 ------------- tests/test-Event-transition-Switch-abort.cpp | 115 ----- tests/test-Event-transition-Switch-pause.cpp | 116 ------ tests/test-Event-transition-Switch-resume.cpp | 115 ----- tests/test-Event-transition-Switch-start.cpp | 116 ------ tests/test-Event-transition-Switch-stop.cpp | 116 ------ 10 files changed, 2134 deletions(-) delete mode 100644 tests/test-Event-transition-Context-abort.cpp delete mode 100644 tests/test-Event-transition-Context-pause.cpp delete mode 100644 tests/test-Event-transition-Context-resume.cpp delete mode 100644 tests/test-Event-transition-Context-start.cpp delete mode 100644 tests/test-Event-transition-Context-stop.cpp delete mode 100644 tests/test-Event-transition-Switch-abort.cpp delete mode 100644 tests/test-Event-transition-Switch-pause.cpp delete mode 100644 tests/test-Event-transition-Switch-resume.cpp delete mode 100644 tests/test-Event-transition-Switch-start.cpp delete mode 100644 tests/test-Event-transition-Switch-stop.cpp diff --git a/tests/test-Event-transition-Context-abort.cpp b/tests/test-Event-transition-Context-abort.cpp deleted file mode 100644 index 756cf0ab9..000000000 --- a/tests/test-Event-transition-Context-abort.cpp +++ /dev/null @@ -1,287 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: ABORT from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // ABORT is done and return true - g_assert_true (c1_lambda->transition (Event::ABORT)); - - // after ABORT all events are SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: ABORT from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (c1_lambda->transition (Event::PAUSE)); - - // after PAUSE, c1@lambda and its anchors - // are PAUSED, and its properties are SLEEPING - g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - - // ABORT is done and return true - g_assert_true (c1_lambda->transition (Event::ABORT)); - - // after ABORT all events are SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: ABORT from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (c1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // ABORT is not done and return false - g_assert_false (c1_lambda->transition (Event::ABORT)); - - // after ABORT all events are still SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - delete fmt; - } - - // Attribution events ---------------------------------------------------- -} diff --git a/tests/test-Event-transition-Context-pause.cpp b/tests/test-Event-transition-Context-pause.cpp deleted file mode 100644 index 8ab93c258..000000000 --- a/tests/test-Event-transition-Context-pause.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: PAUSE from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (c1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are PAUSED - g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: PAUSE from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (c1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are PAUSED - g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // PAUSE is not done and return false - g_assert_false (c1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are still PAUSED - g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: PAUSE from state SLEEPING. - - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (c1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // PAUSE is not done and return false - g_assert_false (c1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events still SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Attribution events ---------------------------------------------------- - - // Selection events ------------------------------------------------------ - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Context-resume.cpp b/tests/test-Event-transition-Context-resume.cpp deleted file mode 100644 index ffeb2c433..000000000 --- a/tests/test-Event-transition-Context-resume.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: RESUME from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - - // -------------------------------- - // main check - - // RESUME is done and return true - g_assert_false (c1_lambda->transition (Event::RESUME)); - - // after RESUME, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - - delete fmt; - } - - // @lambda: RESUME from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (c1_lambda->transition (Event::PAUSE)); - - // after PAUSE, anchors events go to PAUSED - // and properties events are SLEEPING - g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // RESUME is done and return true - g_assert_true (c1_lambda->transition (Event::RESUME)); - - // after RESUME, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: RESUME from state SLEEPING. - - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (c1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // RESUME is not done and return false - g_assert_false (c1_lambda->transition (Event::RESUME)); - - // after PAUSE all events still SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Attribution events ---------------------------------------------------- - - // Selection events ------------------------------------------------------ - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Context-start.cpp b/tests/test-Event-transition-Context-start.cpp deleted file mode 100644 index 6e2d1521e..000000000 --- a/tests/test-Event-transition-Context-start.cpp +++ /dev/null @@ -1,393 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: START from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START is not done and return false - g_assert_false (c1_lambda->transition (Event::START)); - - // after start, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: START from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (c1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are PAUSED - g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert_true (c1_lambda->transition (Event::START)); - - // after start, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: START from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert (c1_lambda->transition (Event::STOP)); - - // after STOP, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert_true (c1_lambda->transition (Event::START)); - - // after START, c1@lambda is SLEEPING and its anchors - // and properties are SLEEPING - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // Attribution events ---------------------------------------------------- - - // START from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START AttributionEvent is done and return true - g_assert (c1_p1->setParameter ("value", "1")); - g_assert_true (c1_p1->transition (Event::START)); - - // after START AttributionEvent is OCCURRING - g_assert (c1_p1->getState () == Event::OCCURRING); - g_assert (c1->getProperty ("p1") == "1"); - - // when advance time AttributionEvent is SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Context-stop.cpp b/tests/test-Event-transition-Context-stop.cpp deleted file mode 100644 index bc186b576..000000000 --- a/tests/test-Event-transition-Context-stop.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @c1_lambda: STOP from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (c1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @c1_lambda: STOP from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done and return true - g_assert_true (c1_lambda->transition (Event::PAUSE)); - - // after PAUSE all events are PAUSED - g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // STOP is done and return true - g_assert_true (c1_lambda->transition (Event::STOP)); - - // after STOP all events are still SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // @c1_lambda: STOP from state SLEEPING. - - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert (c1_lambda->transition (Event::STOP)); - - // after STOP all events SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // STOP is not done and return false - g_assert_false (c1_lambda->transition (Event::STOP)); - - // after STOP all events still SLEEPING - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Switch-abort.cpp b/tests/test-Event-transition-Switch-abort.cpp deleted file mode 100644 index 014c1e7ea..000000000 --- a/tests/test-Event-transition-Switch-abort.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: ABORT from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // after advance time, s1@lambda is OCCURRING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // ABORT is done - g_assert (swt_lambda->transition (Event::ABORT)); - - // after start, s1@lambda is SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: ABORT from state SLEEPING. - - // Attribution events ---------------------------------------------------- - - // ABORT from state SLEEPING. - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Switch-pause.cpp b/tests/test-Event-transition-Switch-pause.cpp deleted file mode 100644 index eb05fa62b..000000000 --- a/tests/test-Event-transition-Switch-pause.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: START from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // After advancing time, s1@lambda and m1@lambda are OCCURRING. - // m2@lambda is not selected, and is not OCCURRING. - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // PAUSE is done - g_assert (swt_lambda->transition (Event::PAUSE)); - - // after start, s1@lambda is PAUSED - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::PAUSED); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: START from state SLEEPING. - - // Attribution events ---------------------------------------------------- - - // START from state SLEEPING. - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Switch-resume.cpp b/tests/test-Event-transition-Switch-resume.cpp deleted file mode 100644 index 05b130873..000000000 --- a/tests/test-Event-transition-Switch-resume.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: RESUME from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // After advancing time, s1@lambda and m1@lambda is OCCURRING. - // m2@lambda is not selected, and is not OCCURRING. - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // main check - - // RESUME is not done - g_assert_false(swt_lambda->transition (Event::RESUME)); - - // after start, s1@lambda is OCCURRING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: RESUME from state SLEEPING. - - // Attribution events ---------------------------------------------------- - - // RESUME from state SLEEPING. - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Switch-start.cpp b/tests/test-Event-transition-Switch-start.cpp deleted file mode 100644 index a84776335..000000000 --- a/tests/test-Event-transition-Switch-start.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: START from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // After advancing time, s1@lambda and m1@lambda are OCCURRING. - // m2@lambda is not selected, and is not OCCURRING. - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START is not done - g_assert_false(swt_lambda->transition (Event::START)); - - // after start, s1@lambda is OCCURRING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: START from state SLEEPING. - - // Attribution events ---------------------------------------------------- - - // START from state SLEEPING. - - exit (EXIT_SUCCESS); -} diff --git a/tests/test-Event-transition-Switch-stop.cpp b/tests/test-Event-transition-Switch-stop.cpp deleted file mode 100644 index e8454cfb1..000000000 --- a/tests/test-Event-transition-Switch-stop.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia - -This file is part of Ginga (Ginga-NCL). - -Ginga is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -Ginga is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -License for more details. - -You should have received a copy of the GNU General Public License -along with Ginga. If not, see . */ - -#include "tests.h" - -int -main (void) -{ - // Presentation events --------------------------------------------------- - - // @lambda: STOP from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // After advancing time, s1@lambda and m1@lambda is OCCURRING. - // m2@lambda is not selected, and is not OCCURRING. - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done - g_assert (swt_lambda->transition (Event::STOP)); - - // after STOP, s1@lambda is SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - delete fmt; - } - - // @lambda: STOP from state SLEEPING. - - // Attribution events ---------------------------------------------------- - - // STOP from state SLEEPING. - - exit (EXIT_SUCCESS); -} From b3357c6e2eef8589f9d12e195d5f62e4e916968d Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 22 Apr 2018 16:02:57 -0300 Subject: [PATCH 070/169] tests: Refactory test-Media-transition-presentation.cpp --- tests/test-Media-transition-presentation.cpp | 1318 ++---------------- tests/tests.h | 64 + 2 files changed, 210 insertions(+), 1172 deletions(-) diff --git a/tests/test-Media-transition-presentation.cpp b/tests/test-Media-transition-presentation.cpp index e67d642d2..d409f964a 100644 --- a/tests/test-Media-transition-presentation.cpp +++ b/tests/test-Media-transition-presentation.cpp @@ -23,69 +23,10 @@ main (void) // ABORT lambda from state OCCURRING. { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // ABORT is done and return true g_assert (m1_lambda->transition (Event::ABORT)); @@ -93,187 +34,71 @@ main (void) // after ABORT all events are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // ABORT lambda from state PAUSED. + // ABORT lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are PAUSED + // after PAUSE, m1_lambda and m1_anchor0s are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::ABORT)); - // after PAUSE all events are SLEEPING + // after PAUSE, all events are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // ABORT lambda from state SLEEPING. + // ABORT lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); // after STOP all events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // ABORT is not done and return false g_assert_false (m1_lambda->transition (Event::ABORT)); // after ABORT all events are still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -281,261 +106,84 @@ main (void) // PAUSE lambda from state OCCURRING. { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // -------------------------------- // main check // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are PAUSED - // anchors are in PAUSED and properties events are SLEEPING + // after PAUSE, m1_lambda and m1_anchor0s are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // PAUSE lambda from state PAUSED. + // PAUSE lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are PAUSED - // anchors are in PAUSED and properties events are SLEEPING + // after PAUSE, m1_lambda and m1_anchor0s are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // PAUSE is done and return false g_assert_false (m1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are PAUSED - // anchors are in PAUSED and properties events are SLEEPING + // after PAUSE, m1_lambda and m1_anchor0s are still PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // PAUSE lambda from state SLEEPING. + // PAUSE lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); // after STOP all events are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // PAUSE is not done and return false g_assert_false (m1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are still SLEEPING + // after PAUSE, m1_lambda and m1_anchor0s are still SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -543,629 +191,133 @@ main (void) // RESUME lambda from state OCCURRING. { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // RESUME is done and return false + // RESUME is not done and return false g_assert_false (m1_lambda->transition (Event::RESUME)); - // after RESUME all events are still OCCURRING + // after RESUME m1_lambda and m1_anchor_0s are OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // RESUME lambda from state PAUSED. + // RESUME lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::PAUSE)); + g_assert (m1_lambda->transition (Event::PAUSE)); - // after PAUSE, anchors events go to PAUSED - // and properties events are SLEEPING + // after PAUSE, m1_lambda and m1_anchor0s are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // RESUME is done and return true - g_assert_true (m1_lambda->transition (Event::RESUME)); - - // after RESUME, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - delete fmt; - } - - // RESUME lambda from state SLEEPING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); + g_assert (m1_lambda->transition (Event::RESUME)); - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING + // after RESUME m1_lambda and m1_anchor_0s are OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // STOP is done and return true - g_assert_true (m1_lambda->transition (Event::STOP)); - - // after STOP all events are SLEEPING - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // PAUSE is not done and return false - g_assert_false (m1_lambda->transition (Event::RESUME)); - - // after PAUSE all events are still SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // START lambda from state OCCURRING. + // START lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START is done and return false - g_assert_false (m1_lambda->transition (Event::START)); - - // after START all timed events are OCCURRING - g_assert (body_lambda->getState () == Event::OCCURRING); - - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // START lambda from state PAUSED. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // PAUSE is done and return true - g_assert_true (m1_lambda->transition (Event::PAUSE)); + g_assert (m1_lambda->transition (Event::PAUSE)); - // after PAUSE lambda and timed anchors are PAUSED and - // labelled anchors and properties are in SLEEPING + // after PAUSE, m1_lambda and m1_anchor0s are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // START is done and return true g_assert_true (m1_lambda->transition (Event::START)); - // after START all events are OCCURRING + // after START m1_lambda is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // advance time fmt->sendTick (0, 0, 0); - // when advance time, timed anchors events go to OCCURRING - // and labelled anchors and properties events are SLEEPING + // when advance time, m1_anchor_0s is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // START lambda from state SLEEPING. + // START lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); - // after STOP all events are SLEEPING + // after STOP m1_lambada and m1_anchor_0s are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // START is done and return true g_assert_true (m1_lambda->transition (Event::START)); - // after START lambda is in OCCURRING and - // anchors are in SLEEPING + // after START m1_lambada and m1_anchor_0s are OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // advance time fmt->sendTick (0, 0, 0); - // when advance time, timed anchors events go to OCCURRING - // and labelled anchors and properties events are SLEEPING + // when advance time, timed m1_lambda and m1@a1 go to OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // START labeled area ---------------------------------------- - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a2"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - // g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START labeled anchor - g_assert_false (m1_a2->transition (Event::START)); - - // after START a2 timed anchors are OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - - g_assert (m1_lambda->getState () == Event::OCCURRING); - // g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -1173,69 +325,10 @@ main (void) // STOP lambda from state OCCURRING. { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); @@ -1243,90 +336,30 @@ main (void) // after STOP all events are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // STOP lambda from state PAUSED. + // STOP lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::PAUSE)); - // after PAUSE lambda and anchors are PAUSED and - // properties are in SLEEPING + // after PAUSE, m1_lambda and m1_anchor_0s are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_a1->getState () == Event::PAUSED); - g_assert (m1_a2->getState () == Event::PAUSED); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); @@ -1334,99 +367,40 @@ main (void) // after STOP all events are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } - // STOP lambda from state SLEEPING. + // STOP lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_a1 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a1); - Event *m1_a2 = m1->getPresentationEvent ("a1"); - g_assert_nonnull (m1_a2); - Event *m1_p1 = m1->getAttributionEvent ("p1"); - g_assert_nonnull (m1_p1); - - // -------------------------------- - // check start document + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // START is done and return true - g_assert (m1_lambda->transition (Event::START)); - - // after START lambda is in OCCURRING and - // anchors are in SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // advance time - fmt->sendTick (0, 0, 0); - - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_a1->getState () == Event::OCCURRING); - g_assert (m1_a2->getState () == Event::OCCURRING); - g_assert (m1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); - // after STOP all events are SLEEPING + // after STOP, m1_lambda and m1_anchor_0s are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); - // STOP is done and return false + // STOP is not done and return false g_assert_false (m1_lambda->transition (Event::STOP)); - // after STOP all events are still SLEEPING + // after STOP, m1_lambda and m1_anchor_0s are still SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_a1->getState () == Event::SLEEPING); - g_assert (m1_a2->getState () == Event::SLEEPING); - g_assert (m1_p1->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); delete fmt; } diff --git a/tests/tests.h b/tests/tests.h index 7ade9f56a..606e6d48d 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -112,4 +112,68 @@ tests_create_document (Document **doc, Context **root, g_assert ((*doc)->getObjectById ("__settings__") == *settings); } +static G_GNUC_UNUSED void +tests_create_document_with_media_and_start ( + Formatter **fmt, Event **body_lambda, Event **m1_lambda, + Event **m1_anchor_0s, Event **m1_anchor_label, Event **m1_prop) +{ + Document *doc; + Context *body; + Media *m1; + + tests_parse_and_start (fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +"); + + body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + *body_lambda = body->getLambda (); + g_assert_nonnull (*body_lambda); + + m1 = cast (Media *, body->getChildById ("m1")); + g_assert_nonnull (m1); + *m1_lambda = m1->getLambda (); + g_assert_nonnull (*m1_lambda); + *m1_anchor_0s = m1->getPresentationEvent ("a1"); + g_assert_nonnull (*m1_anchor_0s); + *m1_anchor_label = m1->getPresentationEvent ("a2"); + g_assert_nonnull (*m1_anchor_label); + *m1_prop = m1->getAttributionEvent ("p1"); + g_assert_nonnull (*m1_prop); + + // -------------------------------- + // check start document + + // when document is started, only the body_lambda is OCCURING + g_assert_cmpint ((*body_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_anchor_0s)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_anchor_label)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_prop)->getState (), ==, Event::SLEEPING); + + // when advance time, m1_lambda is OCCURRING + (*fmt)->sendTick (0, 0, 0); + g_assert_cmpint ((*body_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_anchor_0s)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_anchor_label)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_prop)->getState (), ==, Event::SLEEPING); + + // when advance time, m1_anchor_0s is OCCURRING + (*fmt)->sendTick (0, 0, 0); + g_assert_cmpint ((*body_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_anchor_0s)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_anchor_label)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_prop)->getState (), ==, Event::SLEEPING); +} + #endif // TESTS_H From 9c7309e6a0a881994712b9261c7008b506925059 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 22 Apr 2018 17:06:00 -0300 Subject: [PATCH 071/169] tests: Increase test-{Context,Media}-transition-attribution --- tests/test-Context-transition-attribution.cpp | 45 +++++++++++++++++++ tests/test-Media-transition-attribution.cpp | 43 ++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/tests/test-Context-transition-attribution.cpp b/tests/test-Context-transition-attribution.cpp index 375f59f3e..ccd03f4fb 100644 --- a/tests/test-Context-transition-attribution.cpp +++ b/tests/test-Context-transition-attribution.cpp @@ -20,5 +20,50 @@ along with Ginga. If not, see . */ int main (void) { + { + // ABORT prop from state OCCURRING + // ABORT prop from state PAUSED + // ABORT prop from state SLEEPING + + // PAUSE prop from state OCCURRING + // PAUSE prop from state PAUSED + // PAUSE prop from state SLEEPING + + // START prop from state OCCURRING + // START prop from state PAUSED + // START prop from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + + // START AttributionEvent is done and return true + g_assert_true (c1_prop->transition (Event::START)); + + // after START AttributionEvent is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::OCCURRING); + + // when advance time AttributionEvent is SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP lambda from state OCCURRING + // STOP lambda from state PAUSED + // STOP lambda from state SLEEPING + } + exit (EXIT_SUCCESS); } diff --git a/tests/test-Media-transition-attribution.cpp b/tests/test-Media-transition-attribution.cpp index 375f59f3e..aa46ece51 100644 --- a/tests/test-Media-transition-attribution.cpp +++ b/tests/test-Media-transition-attribution.cpp @@ -20,5 +20,48 @@ along with Ginga. If not, see . */ int main (void) { + + // ABORT prop from state OCCURRING + // ABORT prop from state PAUSED + // ABORT prop from state SLEEPING + + // PAUSE prop from state OCCURRING + // PAUSE prop from state PAUSED + // PAUSE prop from state SLEEPING + + // START prop from state OCCURRING + // START prop from state PAUSED + // START prop from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + + // START is done and return true + g_assert_true (m1_prop->transition (Event::START)); + + // after START m1_lambada and m1_anchor_0s are OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::OCCURRING); + + // when advance time AttributionEvent is SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP lambda from state OCCURRING + // STOP lambda from state PAUSED + // STOP lambda from state SLEEPING exit (EXIT_SUCCESS); } From 554178c2f23de233ac1916e055d42f75715c58c2 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 22 Apr 2018 17:16:48 -0300 Subject: [PATCH 072/169] tests: Refactory test-Context-transition-presentation --- .../test-Context-transition-presentation.cpp | 1349 +++-------------- tests/tests.h | 72 + 2 files changed, 252 insertions(+), 1169 deletions(-) diff --git a/tests/test-Context-transition-presentation.cpp b/tests/test-Context-transition-presentation.cpp index ed602854b..280746864 100644 --- a/tests/test-Context-transition-presentation.cpp +++ b/tests/test-Context-transition-presentation.cpp @@ -20,597 +20,178 @@ along with Ginga. If not, see . */ int main (void) { - // ABORT lambda from state OCCURRING. + // ABORT lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // ABORT is done and return true g_assert_true (c1_lambda->transition (Event::ABORT)); - // after ABORT all events are SLEEPING + // after ABORT c1_lambda, m1_lambda and m2_lambda are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // ABORT lambda from state PAUSED. + // ABORT lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); - // after PAUSE, c1@lambda and its anchors - // are PAUSED, and its properties are SLEEPING + // after PAUSE, c1_lambda, m1_lambda and m2_lambda are PAUSED + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); // ABORT is done and return true g_assert_true (c1_lambda->transition (Event::ABORT)); - // after ABORT all events are SLEEPING + // after ABORT c1_lambda, m1_lambda and m2_lambda are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); delete fmt; } - // ABORT lambda from state SLEEPING. + // ABORT lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); - // after STOP all events are SLEEPING + // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); // ABORT is not done and return false g_assert_false (c1_lambda->transition (Event::ABORT)); - // after ABORT all events are still SLEEPING + // after ABORT c1_lambda, m1_lambda and m2_lambda are still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + delete fmt; } - // PAUSE lambda from state OCCURRING. + // PAUSE lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are PAUSED + // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // PAUSE lambda from state PAUSED. + // PAUSE lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are PAUSED + // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); // PAUSE is not done and return false g_assert_false (c1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are still PAUSED + // after PAUSE c1_lambda, m1_lambda and m2_lambda are still PAUSED g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // PAUSE lambda from state SLEEPING. + // PAUSE lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); - // after STOP all events are SLEEPING + // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); // PAUSE is not done and return false g_assert_false (c1_lambda->transition (Event::PAUSE)); - // after PAUSE all events still SLEEPING + // after PAUSE c1_lambda, m1_lambda and m2_lambda still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // RESUME lambda from state OCCURRING. + // RESUME lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // RESUME is done and return true g_assert_false (c1_lambda->transition (Event::RESUME)); @@ -619,81 +200,20 @@ main (void) // and properties events are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; } - // RESUME lambda from state PAUSED. + // RESUME lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); @@ -701,9 +221,9 @@ main (void) // after PAUSE, anchors events go to PAUSED // and properties events are SLEEPING g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); // RESUME is done and return true g_assert_true (c1_lambda->transition (Event::RESUME)); @@ -711,729 +231,220 @@ main (void) // after RESUME, anchors events go to OCCURRING // and properties events are SLEEPING g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // RESUME lambda from state SLEEPING. - + // RESUME lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); - // after STOP all events are SLEEPING + // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); // RESUME is not done and return false g_assert_false (c1_lambda->transition (Event::RESUME)); - // after PAUSE all events still SLEEPING + // after PAUSE c1_lambda, m1_lambda and m2_lambda still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // START lambda from state OCCURRING. + // START lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // START is not done and return false g_assert_false (c1_lambda->transition (Event::START)); - // after start, c1@lambda and its anchors + // after start, c1_lambda, m1_lambda and m2_lambda are PAUSED // are OCCURRING, and its properties are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // START lambda from state PAUSED. + // START lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are PAUSED + // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); // START is done and return true g_assert_true (c1_lambda->transition (Event::START)); - // after start, c1@lambda and its anchors + // after start, c1_lambda, m1_lambda and m2_lambda are PAUSED // are OCCURRING, and its properties are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // START lambda from state SLEEPING. + // START lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // STOP is done and return true g_assert (c1_lambda->transition (Event::STOP)); - // after STOP, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING + // after STOP, c1_lambda, m1_lambda and m2_lambda are PAUSED + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); // START is done and return true g_assert_true (c1_lambda->transition (Event::START)); - // after START, c1@lambda is SLEEPING and its anchors - // and properties are SLEEPING + // after START, c1_lambda is SLEEPING g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); - // after advance time, c1@lambda and its anchors + // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED // are OCCURRING, and its properties are SLEEPING fmt->sendTick (0, 0, 0); g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // Attribution events ---------------------------------------------------- - - // START from state SLEEPING. + // STOP c1_lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // START AttributionEvent is done and return true - g_assert (c1_p1->setParameter ("value", "1")); - g_assert_true (c1_p1->transition (Event::START)); - - // after START AttributionEvent is OCCURRING - g_assert (c1_p1->getState () == Event::OCCURRING); - g_assert (c1->getProperty ("p1") == "1"); - - // when advance time AttributionEvent is SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (c1_p1->getState () == Event::SLEEPING); - - delete fmt; - } - - // STOP c1_lambda from state OCCURRING. - { - Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); - // after STOP all events are SLEEPING + // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // STOP c1_lambda from state PAUSED. + // STOP c1_lambda from state PAUSED { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); - // after PAUSE all events are PAUSED + // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (c1_lambda->getState () == Event::PAUSED); - g_assert (c1_port1->getState () == Event::PAUSED); - g_assert (c1_port2->getState () == Event::PAUSED); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::PAUSED); + g_assert (m2_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); - // after STOP all events are still SLEEPING + // after STOP c1_lambda, m1_lambda and m2_lambda are still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } - // STOP c1_lambda from state SLEEPING. - + // STOP c1_lambda from state SLEEPING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Context *c1 = cast (Context *, body->getChildById ("c1")); - g_assert_nonnull (c1); - Event *c1_lambda = c1->getLambda (); - g_assert_nonnull (c1_lambda); - - Event *c1_p1 = c1->getAttributionEvent ("p1"); - g_assert_nonnull (c1_p1); - - auto iter = c1->getPorts ()->begin (); - Event *c1_port1 = *iter; - g_assert_nonnull (c1_port1); - iter++; - Event *c1_port2 = *iter; - g_assert_nonnull (c1_port2); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_lambda->getState () == Event::SLEEPING); - - // after advance time, c1@lambda is OCCURRING, and its - // anchors and properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); - - // after advance time, c1@lambda and its anchors - // are OCCURRING, and its properties are SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (c1_lambda->getState () == Event::OCCURRING); - g_assert (c1_port1->getState () == Event::OCCURRING); - g_assert (c1_port2->getState () == Event::OCCURRING); - g_assert (c1_p1->getState () == Event::SLEEPING); + Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; - // -------------------------------- - // main check + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); // STOP is done and return true g_assert (c1_lambda->transition (Event::STOP)); - // after STOP all events SLEEPING + // after STOP c1_lambda, m1_lambda and m2_lambda SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); // STOP is not done and return false g_assert_false (c1_lambda->transition (Event::STOP)); - // after STOP all events still SLEEPING + // after STOP c1_lambda, m1_lambda and m2_lambda still SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); - g_assert (c1_port1->getState () == Event::SLEEPING); - g_assert (c1_port2->getState () == Event::SLEEPING); - g_assert (c1_p1->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } diff --git a/tests/tests.h b/tests/tests.h index 606e6d48d..af2531f4a 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -176,4 +176,76 @@ tests_create_document_with_media_and_start ( g_assert_cmpint ((*m1_prop)->getState (), ==, Event::SLEEPING); } +static G_GNUC_UNUSED void +tests_create_document_with_context_and_start ( + Formatter **fmt, Event **body_lambda, Event **c1_lambda, + Event **c1_prop, Event **m1_lambda, Event **m2_lambda) +{ + Document *doc; + Context *body, *c1; + Media *m1, *m2; + + tests_parse_and_start (fmt, &doc, "\ +\n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + *body_lambda = body->getLambda (); + g_assert_nonnull (*body_lambda); + + c1 = cast (Context *, body->getChildById ("c1")); + g_assert_nonnull (c1); + *c1_lambda = c1->getLambda (); + g_assert_nonnull (c1_lambda); + *c1_prop = c1->getAttributionEvent ("p1"); + g_assert_nonnull (c1_prop); + + m1 = cast (Media *, c1->getChildById ("m1")); + g_assert_nonnull (m1); + *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + m2 = cast (Media *, c1->getChildById ("m2")); + g_assert_nonnull (m2); + *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // when document is started, only the body_lambda is OCCURING + g_assert_cmpint ((*body_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*c1_lambda)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m2_lambda)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*c1_prop)->getState (), ==, Event::SLEEPING); + + // when advance time, c1_lambda is OCCURRING + (*fmt)->sendTick (0, 0, 0); + g_assert_cmpint ((*body_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*c1_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m2_lambda)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*c1_prop)->getState (), ==, Event::SLEEPING); + + // when advance time, m1_lambda and m2_lambda are OCCURRING + (*fmt)->sendTick (0, 0, 0); + g_assert_cmpint ((*body_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*c1_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m2_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*c1_prop)->getState (), ==, Event::SLEEPING); +} + #endif // TESTS_H From 0b19a96aaa78a3e6abbd2d16ece6ca8fd9c04d68 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 22 Apr 2018 18:51:33 -0300 Subject: [PATCH 073/169] tests: Refactory test-Media-transition-selection --- tests/test-Media-transition-presentation.cpp | 76 +++++++---- tests/test-Media-transition-selection.cpp | 127 +++++++++---------- tests/tests.h | 20 ++- 3 files changed, 127 insertions(+), 96 deletions(-) diff --git a/tests/test-Media-transition-presentation.cpp b/tests/test-Media-transition-presentation.cpp index d409f964a..98530022f 100644 --- a/tests/test-Media-transition-presentation.cpp +++ b/tests/test-Media-transition-presentation.cpp @@ -23,10 +23,10 @@ main (void) // ABORT lambda from state OCCURRING. { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // ABORT is done and return true g_assert (m1_lambda->transition (Event::ABORT)); @@ -37,6 +37,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -44,10 +45,10 @@ main (void) // ABORT lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::PAUSE)); @@ -58,6 +59,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::PAUSED); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::ABORT)); @@ -68,6 +70,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -75,10 +78,10 @@ main (void) // ABORT lambda from state SLEEPING { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); @@ -89,6 +92,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // ABORT is not done and return false g_assert_false (m1_lambda->transition (Event::ABORT)); @@ -99,6 +103,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -106,10 +111,10 @@ main (void) // PAUSE lambda from state OCCURRING. { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // -------------------------------- // main check @@ -122,6 +127,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::PAUSED); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -129,10 +135,10 @@ main (void) // PAUSE lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::PAUSE)); @@ -143,6 +149,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::PAUSED); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // PAUSE is done and return false g_assert_false (m1_lambda->transition (Event::PAUSE)); @@ -153,6 +160,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::PAUSED); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -160,10 +168,10 @@ main (void) // PAUSE lambda from state SLEEPING { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); @@ -174,6 +182,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // PAUSE is not done and return false g_assert_false (m1_lambda->transition (Event::PAUSE)); @@ -184,6 +193,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -191,10 +201,10 @@ main (void) // RESUME lambda from state OCCURRING. { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // RESUME is not done and return false g_assert_false (m1_lambda->transition (Event::RESUME)); @@ -205,6 +215,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::OCCURRING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -212,10 +223,10 @@ main (void) // RESUME lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // PAUSE is done and return true g_assert (m1_lambda->transition (Event::PAUSE)); @@ -226,6 +237,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::PAUSED); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // RESUME is done and return true g_assert (m1_lambda->transition (Event::RESUME)); @@ -236,6 +248,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::OCCURRING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -243,10 +256,10 @@ main (void) // START lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // PAUSE is done and return true g_assert (m1_lambda->transition (Event::PAUSE)); @@ -257,6 +270,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::PAUSED); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // START is done and return true g_assert_true (m1_lambda->transition (Event::START)); @@ -267,6 +281,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::PAUSED); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // advance time fmt->sendTick (0, 0, 0); @@ -277,6 +292,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::OCCURRING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -284,10 +300,10 @@ main (void) // START lambda from state SLEEPING { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); @@ -298,6 +314,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // START is done and return true g_assert_true (m1_lambda->transition (Event::START)); @@ -308,6 +325,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // advance time fmt->sendTick (0, 0, 0); @@ -318,6 +336,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::OCCURRING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -325,10 +344,10 @@ main (void) // STOP lambda from state OCCURRING. { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); @@ -339,6 +358,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -346,10 +366,10 @@ main (void) // STOP lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // PAUSE is done and return true g_assert_true (m1_lambda->transition (Event::PAUSE)); @@ -360,6 +380,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::PAUSED); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); @@ -370,6 +391,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } @@ -377,10 +399,10 @@ main (void) // STOP lambda from state SLEEPING { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // STOP is done and return true g_assert_true (m1_lambda->transition (Event::STOP)); @@ -391,6 +413,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); // STOP is not done and return false g_assert_false (m1_lambda->transition (Event::STOP)); @@ -401,6 +424,7 @@ main (void) g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () ==Event::SLEEPING); delete fmt; } diff --git a/tests/test-Media-transition-selection.cpp b/tests/test-Media-transition-selection.cpp index 2e89572ab..06bdbc6cf 100644 --- a/tests/test-Media-transition-selection.cpp +++ b/tests/test-Media-transition-selection.cpp @@ -20,98 +20,87 @@ along with Ginga. If not, see . */ int main (void) { - // ABORT selection when Media is OCCURRING. - // ABORT selection when Media is PAUSED. - // ABORT selection when Media is SLEEPING. + // ABORT selection from state OCCURRING + // ABORT selection from state PAUSED + // ABORT selection from state SLEEPING - // PAUSE selection when Media is OCCURRING. - // PAUSE selection when Media is PAUSED. - // PAUSE selection when Media is SLEEPING. + // PAUSE selection from state OCCURRING + // PAUSE selection from state PAUSED + // PAUSE selection from state SLEEPING - // START selection when Media is OCCURRING. + // START selection from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - Media *m1 = cast (Media *, body->getChildById ("m1")); - g_assert_nonnull (m1); - puts(m1->toString ().c_str ()); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - Event *m1_selection = m1->getSelectionEvent (""); - g_assert_nonnull (m1_selection); - - // -------------------------------- - // check start document - - // when document is started, only the body@lambda is OCCURING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m1_selection->getState () == Event::SLEEPING); + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, + *m1_sel; + + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, + &m1_sel); // START is done and return true - g_assert (m1_lambda->transition (Event::START)); + g_assert (m1_sel->transition (Event::START)); - // after START lambda is in OCCURRING + // after START, m1_sel is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_selection->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () == Event::OCCURRING); - // advance time - fmt->sendTick (0, 0, 0); + // START is not done and return true + g_assert_false (m1_sel->transition (Event::START)); - // when advance time, anchors events go to OCCURRING - // and properties events are SLEEPING + // when advance time, m1_sel is still OCCURRING + fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_selection->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () == Event::OCCURRING); - // -------------------------------- - // main check + delete fmt; + } + + // START selection from state PAUSED + // START selection from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, + *m1_sel; + + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, + &m1_sel); // START is done - g_assert (m1_selection->transition (Event::START)); + g_assert (m1_sel->transition (Event::START)); - // after START, selection is OCCURRING + // after START, m1_sel is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_selection->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () == Event::OCCURRING); + + // when advance time, m1_sel is still OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () == Event::OCCURRING); delete fmt; } - // START selection when Media is PAUSED. - // START selection when Media is SLEEPING. - - // STOP selection when Media is OCCURRING. - // STOP selection when Media is PAUSED. - // STOP selection when Media is SLEEPING. + // STOP selection from state OCCURRING + // STOP selection from state PAUSED + // STOP selection from state SLEEPING exit (EXIT_SUCCESS); } diff --git a/tests/tests.h b/tests/tests.h index af2531f4a..f25b39a3f 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -115,7 +115,7 @@ tests_create_document (Document **doc, Context **root, static G_GNUC_UNUSED void tests_create_document_with_media_and_start ( Formatter **fmt, Event **body_lambda, Event **m1_lambda, - Event **m1_anchor_0s, Event **m1_anchor_label, Event **m1_prop) + Event **m1_anchor_0s, Event **m1_anchor_label, Event **m1_prop, Event **m1_sel) { Document *doc; Context *body; @@ -123,6 +123,14 @@ tests_create_document_with_media_and_start ( tests_parse_and_start (fmt, &doc, "\ \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n\ \n\ @@ -130,6 +138,10 @@ tests_create_document_with_media_and_start ( \n\ \n\ \n\ + \n\ + \n\ + \n\ + \n\ \n\ "); @@ -148,6 +160,8 @@ tests_create_document_with_media_and_start ( g_assert_nonnull (*m1_anchor_label); *m1_prop = m1->getAttributionEvent ("p1"); g_assert_nonnull (*m1_prop); + *m1_sel = m1->getSelectionEvent (""); + g_assert_nonnull (*m1_sel); // -------------------------------- // check start document @@ -158,6 +172,7 @@ tests_create_document_with_media_and_start ( g_assert_cmpint ((*m1_anchor_0s)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m1_anchor_label)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m1_prop)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_sel)->getState (), ==, Event::SLEEPING); // when advance time, m1_lambda is OCCURRING (*fmt)->sendTick (0, 0, 0); @@ -166,6 +181,7 @@ tests_create_document_with_media_and_start ( g_assert_cmpint ((*m1_anchor_0s)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m1_anchor_label)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m1_prop)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_sel)->getState (), ==, Event::SLEEPING); // when advance time, m1_anchor_0s is OCCURRING (*fmt)->sendTick (0, 0, 0); @@ -174,6 +190,8 @@ tests_create_document_with_media_and_start ( g_assert_cmpint ((*m1_anchor_0s)->getState (), ==, Event::OCCURRING); g_assert_cmpint ((*m1_anchor_label)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m1_prop)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_sel)->getState (), ==, Event::SLEEPING); + } static G_GNUC_UNUSED void From 53d88f1478c091a805bb172cde8f398851bc6006 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 22 Apr 2018 19:46:08 -0300 Subject: [PATCH 074/169] tests: Refactory in test-Switch-transition-presentation --- tests/test-Media-transition-attribution.cpp | 4 +- tests/test-Switch-transition-presentation.cpp | 418 +++--------------- tests/tests.h | 104 ++++- 3 files changed, 156 insertions(+), 370 deletions(-) diff --git a/tests/test-Media-transition-attribution.cpp b/tests/test-Media-transition-attribution.cpp index aa46ece51..258dc47d7 100644 --- a/tests/test-Media-transition-attribution.cpp +++ b/tests/test-Media-transition-attribution.cpp @@ -34,10 +34,10 @@ main (void) // START prop from state SLEEPING { Formatter *fmt; - Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; tests_create_document_with_media_and_start ( - &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop); + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); // START is done and return true g_assert_true (m1_prop->transition (Event::START)); diff --git a/tests/test-Switch-transition-presentation.cpp b/tests/test-Switch-transition-presentation.cpp index 3e72e6fb0..ed6998efd 100644 --- a/tests/test-Switch-transition-presentation.cpp +++ b/tests/test-Switch-transition-presentation.cpp @@ -20,423 +20,123 @@ along with Ginga. If not, see . */ int main (void) { - // ABORT lambda from state OCCURRING. + // ABORT lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); + // ABORT is done and return true + g_assert (swt1_lambda->transition (Event::ABORT)); - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // after advance time, s1@lambda is OCCURRING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // -------------------------------- - // main check - - // ABORT is done - g_assert (swt_lambda->transition (Event::ABORT)); - - // after start, s1@lambda is SLEEPING - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); + // after start, swt1_lambda is SLEEPING + g_assert_cmpint (body_lambda->getState (), ==, Event::OCCURRING); + g_assert_cmpint (swt1_lambda->getState (), ==, Event::SLEEPING); + g_assert_cmpint (m1_lambda->getState (), ==, Event::SLEEPING); + g_assert_cmpint (m2_lambda->getState (), ==, Event::SLEEPING); + // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); delete fmt; } + // ABORT lambda from state PAUSED + // ABORT lambda from state SLEEPING - // START lambda from state OCCURRING. + // START lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // After advancing time, s1@lambda and m1@lambda are OCCURRING. - // m2@lambda is not selected, and is not OCCURRING. - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); // PAUSE is done - g_assert (swt_lambda->transition (Event::PAUSE)); + g_assert (swt1_lambda->transition (Event::PAUSE)); - // after start, s1@lambda is PAUSED + // after start, swt1_lambda is PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::PAUSED); + g_assert (swt1_lambda->getState () == Event::PAUSED); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::SLEEPING); + // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); delete fmt; } + // START lambda from state PAUSED + // START lambda from state SLEEPING - // RESUME lambda from state OCCURRING. + // RESUME lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // After advancing time, s1@lambda and m1@lambda is OCCURRING. - // m2@lambda is not selected, and is not OCCURRING. - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // main check + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); // RESUME is not done - g_assert_false (swt_lambda->transition (Event::RESUME)); + g_assert_false (swt1_lambda->transition (Event::RESUME)); - // after start, s1@lambda is OCCURRING + // after start, swt1_lambda is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); + // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); delete fmt; } + // RESUME lambda from state PAUSED + // RESUME lambda from state SLEEPING - // START lambda from state OCCURRING. + // START lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // After advancing time, s1@lambda and m1@lambda are OCCURRING. - // m2@lambda is not selected, and is not OCCURRING. - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // -------------------------------- - // main check + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); // START is not done - g_assert_false (swt_lambda->transition (Event::START)); + g_assert_false (swt1_lambda->transition (Event::START)); - // after start, s1@lambda is OCCURRING + // after start, swt1_lambda is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); + // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); delete fmt; } + // START lambda from state PAUSED + // START lambda from state SLEEPING - // STOP lambda from state OCCURRING. + // STOP lambda from state OCCURRING { Formatter *fmt; - Document *doc; - tests_parse_and_start (&fmt, &doc, "\ -\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n\ -"); - - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - MediaSettings *stgs - = cast (MediaSettings *, doc->getObjectByIdOrAlias ("stgs")); - g_assert_nonnull (stgs); - Event *stgs_lambda = stgs->getLambda (); - g_assert_nonnull (stgs_lambda); - - Switch *swt = cast (Switch *, body->getChildById ("s1")); - g_assert_nonnull (swt); - Event *swt_lambda = swt->getLambda (); - g_assert_nonnull (swt_lambda); - - Media *m1 = cast (Media *, swt->getChildById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - Media *m2 = cast (Media *, swt->getChildById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - // When the document is started, only the body@lambda is OCCURRING. - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // After advancing time, s1@lambda and m1@lambda is OCCURRING. - // m2@lambda is not selected, and is not OCCURRING. - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::SLEEPING); + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; - // -------------------------------- - // main check + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); // STOP is done - g_assert (swt_lambda->transition (Event::STOP)); + g_assert (swt1_lambda->transition (Event::STOP)); - // after STOP, s1@lambda is SLEEPING + // after STOP, swt1_lambda is SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (swt_lambda->getState () == Event::SLEEPING); + g_assert (swt1_lambda->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); + // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); delete fmt; } + // STOP lambda from state PAUSED + // STOP lambda from state SLEEPING exit (EXIT_SUCCESS); } diff --git a/tests/tests.h b/tests/tests.h index f25b39a3f..3ebef4c52 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -113,9 +113,12 @@ tests_create_document (Document **doc, Context **root, } static G_GNUC_UNUSED void -tests_create_document_with_media_and_start ( - Formatter **fmt, Event **body_lambda, Event **m1_lambda, - Event **m1_anchor_0s, Event **m1_anchor_label, Event **m1_prop, Event **m1_sel) +tests_create_document_with_media_and_start (Formatter **fmt, + Event **body_lambda, + Event **m1_lambda, + Event **m1_anchor_0s, + Event **m1_anchor_label, + Event **m1_prop, Event **m1_sel) { Document *doc; Context *body; @@ -125,22 +128,22 @@ tests_create_document_with_media_and_start ( \n\ \n\ \n\ - \n\ + \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ \n\ \n\ \n\ - \n\ + \n\ \n\ - \n\ + \n\ \n\ \n\ "); @@ -191,7 +194,6 @@ tests_create_document_with_media_and_start ( g_assert_cmpint ((*m1_anchor_label)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m1_prop)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m1_sel)->getState (), ==, Event::SLEEPING); - } static G_GNUC_UNUSED void @@ -266,4 +268,88 @@ tests_create_document_with_context_and_start ( g_assert_cmpint ((*c1_prop)->getState (), ==, Event::SLEEPING); } +static G_GNUC_UNUSED void +tests_create_document_with_switch_and_start ( + Formatter **fmt, Event **body_lambda, Event **swt1_lambda, + Event **swt1_sel, Event **m1_lambda, Event **m2_lambda) +{ + Document *doc; + Context *body; + Switch *swt1; + Media *m1, *m2; + + tests_parse_and_start (fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ +"); + + body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + *body_lambda = body->getLambda (); + g_assert_nonnull (*body_lambda); + + swt1 = cast (Switch *, body->getChildById ("swt1")); + g_assert_nonnull (swt1); + *swt1_lambda = swt1->getLambda (); + g_assert_nonnull (swt1_lambda); + // *swt1_sel = swt1->getSelectionEvent (""); + // g_assert_nonnull (*m1_sel); + + m1 = cast (Media *, swt1->getChildById ("m1")); + g_assert_nonnull (m1); + *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + m2 = cast (Media *, swt1->getChildById ("m2")); + g_assert_nonnull (m2); + *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // when document is started, only the body_lambda is OCCURING + g_assert_cmpint ((*body_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*swt1_lambda)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*m2_lambda)->getState (), ==, Event::SLEEPING); + // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + + // when advance time, c1_lambda is OCCURRING + (*fmt)->sendTick (0, 0, 0); + g_assert_cmpint ((*body_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*swt1_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::OCCURRING); + g_assert_cmpint ((*m2_lambda)->getState (), ==, Event::SLEEPING); + // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + +} + #endif // TESTS_H From 90ece46ee69a91864d674e6a239111d67aa987d1 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 22 Apr 2018 20:09:47 -0300 Subject: [PATCH 075/169] build: Exclude /usr/ folder from make coverage --- build-aux/Makefile.am.coverage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/Makefile.am.coverage b/build-aux/Makefile.am.coverage index 7d5990fdf..021070bfe 100644 --- a/build-aux/Makefile.am.coverage +++ b/build-aux/Makefile.am.coverage @@ -16,7 +16,7 @@ LCOV_DIR= coverage LCOV_INFO= coverage.info -COVERAGE_EXCLUDE= +COVERAGE_EXCLUDE=/usr/include/c++/5/* /usr/include/c++/5/**/* /usr/include/gstreamer-1.0/gst/* lcov_capture_options= --capture --directory $(top_builddir)\ --output-file $(LCOV_INFO) --test-name '$(PACKAGE_NAME)_PERF'\ From cb9e245e89ef21b5ad12a9e09a470e041b016788 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 14:03:12 -0300 Subject: [PATCH 076/169] tests-ncl: Add ncl as lua table tests --- tests-ncl/test-ltab-1.lua | 39 ++++++++++++++++++++++++++++++++++ tests-ncl/test-ltab-2.lua | 34 ++++++++++++++++++++++++++++++ tests-ncl/test-ltab-3.lua | 44 +++++++++++++++++++++++++++++++++++++++ tests-ncl/test-ltab-4.lua | 29 ++++++++++++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 tests-ncl/test-ltab-1.lua create mode 100644 tests-ncl/test-ltab-2.lua create mode 100644 tests-ncl/test-ltab-3.lua create mode 100644 tests-ncl/test-ltab-4.lua diff --git a/tests-ncl/test-ltab-1.lua b/tests-ncl/test-ltab-1.lua new file mode 100644 index 000000000..e5a32b54e --- /dev/null +++ b/tests-ncl/test-ltab-1.lua @@ -0,0 +1,39 @@ +ncl = { + 'context', + 'ncl', + -- list of ports + {'m2@lambda'}, + -- list of children + { + {'media', 'm1', {src = 'samples/clock.ogv'}, {a1 = {'3s'}}}, + {'media', 'm2', {src = 'samples/gnu.png'}} + }, + -- list of links + { + -- link #1 + { + -- list of conditions + { + {'start', 'm1@a1', {true}} + }, + -- list of actions + { + {'stop', 'm1@lambda'}, + {'start', 'm2@lambda', nil, {delay = '0s', duration = '0s'}} + } + }, + -- link #2 + { + -- list of conditions + { + {'stop', 'm2', {true}} + }, + -- list of actions + { + {'stop', 'm2@lambda'}, + {'start', 'm1@lambda'} + } + } + } +} +return ncl diff --git a/tests-ncl/test-ltab-2.lua b/tests-ncl/test-ltab-2.lua new file mode 100644 index 000000000..ed0263072 --- /dev/null +++ b/tests-ncl/test-ltab-2.lua @@ -0,0 +1,34 @@ +ncl = { + 'context', + 'ncl', + -- list of ports + {'m1@lambda'}, + -- list of children + { + {'media', 'm1', {src = 'samples/clock.ogv'}, {a1 = {'3s'}}}, + {'media', 'm2', {src = 'samples/gnu.png'}} + }, + -- list of links + { + -- link #1 + { + -- list of conditions + { + {'start', 'm1@a1', {'or', {'1', '==', '1'}, {true}}}, + {'start', 'm1@a1', {'and', {'1', '==', '1'}, {true}}}, + {'start', 'm1@a1', {'and', {'1', '>=', '1'}, {true}}}, + {'start', 'm1@a1', {'and', {'1', '<=', '1'}, {true}}}, + {'start', 'm1@a1', {'and', {'2', '>=', '1'}, {true}}}, + {'start', 'm1@a1', {'and', {'2', '>', '1'}, {true}}}, + {'start', 'm1@a1', {'and', {'1', '<', '2'}, {true}}}, + {'start', 'm1@a1', {'and', {'2', '!=', '1'}, {true}}} + }, + -- list of actions + { + {'stop', 'm1@lambda'}, + {'start', 'm2@lambda'} + } + } + } +} +return ncl diff --git a/tests-ncl/test-ltab-3.lua b/tests-ncl/test-ltab-3.lua new file mode 100644 index 000000000..3913d3c3f --- /dev/null +++ b/tests-ncl/test-ltab-3.lua @@ -0,0 +1,44 @@ +ncl = { + 'context', + 'ncl', + -- list of ports + {'time@lambda', 's1@lambda'}, + -- list of children + { + {'media', 'settings', + {type = 'application/x-ginga-settings', var = 'm1'} + }, + {'media', 'time', nil, {a1 = {'3s'}}}, + { + 'switch', + 's1', + -- list of components + { + {'media', 'm1', {src = 'samples/clock.ogv'}}, + {'media', 'm2', {src = 'samples/gnu.png'}} + }, + -- list of rules + { + {'m1', {'$settings.var', '==', 'm1'}}, + {'m2', {'$settings.var', '==', 'm2'}} + } + } + }, + -- list of links + { + -- link #1 + { + -- list of conditions + { + {'start', 'time@a1', {true}} + }, + -- list of actions + { + {'stop', 's1@lambda'}, + {'set', 'settings.var', 'm2'}, + {'start', 's1@lambda'} + } + } + } +} +return ncl diff --git a/tests-ncl/test-ltab-4.lua b/tests-ncl/test-ltab-4.lua new file mode 100644 index 000000000..3130192e9 --- /dev/null +++ b/tests-ncl/test-ltab-4.lua @@ -0,0 +1,29 @@ +ncl = { + 'context', + 'ncl', + -- list of ports + {'time@lambda', 'm1@lambda'}, + -- list of children + { + {'media', 'time', nil}, + { + 'media', + 'm1', + { + src = 'samples/gnu.png', + explicitDur = '2s', + transIn = { + type = 'barWipe', + dur = '1s' + }, + transOut = { + type = 'barWipe', + dur = '1s' + } + } + } + }, + -- list of links + {nil} +} +return ncl From a304b92dd6273b560fea69a58cf9b9399dfdbe53 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 14:03:40 -0300 Subject: [PATCH 077/169] tests: Add test-ParserLua-parseFile --- .gitignore | 1 + tests/Makefile.am | 5 +++ tests/test-ParserLua-parseFile.cpp | 70 ++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 tests/test-ParserLua-parseFile.cpp diff --git a/.gitignore b/.gitignore index 1bd37b68b..8bfa0e539 100644 --- a/.gitignore +++ b/.gitignore @@ -164,6 +164,7 @@ /tests/test-Parser-parseBuffer /tests/test-Parser-parseFile /tests/test-ParserLua-parseBuffer +/tests/test-ParserLua-parseFile /tests/test-Predicate-atom /tests/test-Predicate-new /tests/test-Switch-new diff --git a/tests/Makefile.am b/tests/Makefile.am index d32d1f0b4..e503516e7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -318,8 +318,13 @@ test_Parser_parseBuffer_SOURCES= test-Parser-parseBuffer.cpp # lib/ParserLua.h ---------------------------------------------------------- if WITH_LUA + +progs+= test-ParserLua-parseFile +test_ParserLua_parseFile_SOURCES= test-ParserLua-parseFile.cpp + progs+= test-ParserLua-parseBuffer test_ParserLua_parseBuffer_SOURCES= test-ParserLua-parseBuffer.cpp + endif # lib/ginga.h (Ginga Library API) ------------------------------------------ diff --git a/tests/test-ParserLua-parseFile.cpp b/tests/test-ParserLua-parseFile.cpp new file mode 100644 index 000000000..29d8e7bfe --- /dev/null +++ b/tests/test-ParserLua-parseFile.cpp @@ -0,0 +1,70 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" +using namespace ::ginga; + +int +main (void) +{ + string errmsg; + GDir *dir; + string path; + const gchar *entry; + + // Check bad path. + g_assert_null (ParserLua::parseFile ("nonexistent", nullptr)); + + // Sanity checks. + vector nclFolders; + nclFolders.push_back (xpathbuildabs (ABS_TOP_SRCDIR, "tests-ncl")); + nclFolders.push_back ( + xpathbuildabs (ABS_TOP_SRCDIR, "tests-ncl/generated")); + + for (int i = 0; i < nclFolders.size (); i++) + { + dir = g_dir_open (nclFolders[i].c_str (), 0, nullptr); + g_assert_nonnull (dir); + + while ((entry = g_dir_read_name (dir)) != nullptr) + { + string entry_path; + Document *doc; + string errmsg; + + if (!xstrhassuffix (entry, ".lua")) + continue; + entry_path = xpathbuildabs (nclFolders[i], string (entry)); + + errmsg = ""; + doc = ParserLua::parseFile (entry_path, &errmsg); + if (doc == nullptr) + { + g_printerr ("%s: %s\n", entry, errmsg.c_str ()); + g_assert_not_reached (); + } + else + { + g_assert (errmsg == ""); + } + delete doc; + } + + g_dir_close (dir); + } + exit (EXIT_SUCCESS); +} From d30c11b65fb8a31356a7fd8de25ee3c39d4bb47c Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 14:04:51 -0300 Subject: [PATCH 078/169] build: Remove tests/* files from coverage output to focus in lib/* files --- build-aux/Makefile.am.coverage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/Makefile.am.coverage b/build-aux/Makefile.am.coverage index 021070bfe..040199ce8 100644 --- a/build-aux/Makefile.am.coverage +++ b/build-aux/Makefile.am.coverage @@ -16,7 +16,7 @@ LCOV_DIR= coverage LCOV_INFO= coverage.info -COVERAGE_EXCLUDE=/usr/include/c++/5/* /usr/include/c++/5/**/* /usr/include/gstreamer-1.0/gst/* +COVERAGE_EXCLUDE=tests/* /usr/include/c++/5/* /usr/include/c++/5/**/* /usr/include/gstreamer-1.0/gst/* lcov_capture_options= --capture --directory $(top_builddir)\ --output-file $(LCOV_INFO) --test-name '$(PACKAGE_NAME)_PERF'\ From 2d256bf46b088ccd4804034812cb08ac30410a8a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 14:15:18 -0300 Subject: [PATCH 079/169] tests: Increase test-Siggen-new by advance time and create objects --- tests/test-Siggen-new.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-Siggen-new.cpp b/tests/test-Siggen-new.cpp index 8c7786d35..084e687aa 100644 --- a/tests/test-Siggen-new.cpp +++ b/tests/test-Siggen-new.cpp @@ -125,6 +125,7 @@ main (void) g_assert_nonnull (m12); Media *m13 = cast (Media *, body->getChildById ("m13")); g_assert_nonnull (m12); + fmt->sendTick (0, 0, 0); delete fmt; From 6c5e54de8342e1a1a8083cf9f1acc5292110afc2 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 14:56:28 -0300 Subject: [PATCH 080/169] tests: Add test-Media-selection --- .gitignore | 1 + tests/Makefile.am | 3 ++ tests/test-Media-selection.cpp | 97 ++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 tests/test-Media-selection.cpp diff --git a/.gitignore b/.gitignore index 8bfa0e539..2a2127f67 100644 --- a/.gitignore +++ b/.gitignore @@ -149,6 +149,7 @@ /tests/test-GingaInternal-getData /tests/test-GingaInternal-setData /tests/test-Media-new +/tests/test-Media-selection /tests/test-Media-4grid /tests/test-Media-mime /tests/test-Media-focusIndex diff --git a/tests/Makefile.am b/tests/Makefile.am index e503516e7..38548ba55 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -252,6 +252,9 @@ test_Media_4grid_SOURCES= test-Media-4grid.cpp progs+= test-Media-focusIndex test_Media_focusIndex_SOURCES= test-Media-focusIndex.cpp +progs+= test-Media-selection +test_Media_selection_SOURCES= test-Media-selection.cpp + progs+= test-Media-mime test_Media_mime_SOURCES= test-Media-mime.cpp diff --git a/tests/test-Media-selection.cpp b/tests/test-Media-selection.cpp new file mode 100644 index 000000000..93752accf --- /dev/null +++ b/tests/test-Media-selection.cpp @@ -0,0 +1,97 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_selection = m1->getSelectionEvent (""); + g_assert_nonnull (m1_selection); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_selection->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when start document, m1 is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_selection->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // when sendKey, m1_selection and m2_lambda are OCCURRING + fmt->sendKey ("ENTER", true); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_selection->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + exit (EXIT_SUCCESS); +} From 8eea6c3ef9d297b468ba057ebf89f303c09b8e60 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 15:05:27 -0300 Subject: [PATCH 081/169] tests: Rename test-Media-focusIndex to test-Media-focusIndex-changed-by-link --- .gitignore | 2 +- tests/Makefile.am | 4 ++-- ...cusIndex.cpp => test-Media-focusIndex-changed-by-link.cpp} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename tests/{test-Media-focusIndex.cpp => test-Media-focusIndex-changed-by-link.cpp} (100%) diff --git a/.gitignore b/.gitignore index 2a2127f67..416f07dc4 100644 --- a/.gitignore +++ b/.gitignore @@ -152,7 +152,7 @@ /tests/test-Media-selection /tests/test-Media-4grid /tests/test-Media-mime -/tests/test-Media-focusIndex +/tests/test-Media-focusIndex-changed-by-link /tests/test-Media-explicitDur /tests/test-Media-nested-explicitDur /tests/test-Media-anchors-started-from-ports diff --git a/tests/Makefile.am b/tests/Makefile.am index 38548ba55..ef7ae5216 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -249,8 +249,8 @@ test_Media_nested_explicitDur_SOURCES= test-Media-nested-explicitDur.cpp progs+= test-Media-4grid test_Media_4grid_SOURCES= test-Media-4grid.cpp -progs+= test-Media-focusIndex -test_Media_focusIndex_SOURCES= test-Media-focusIndex.cpp +progs+= test-Media-focusIndex-changed-by-link +test_Media_focusIndex_changed_by_link_SOURCES= test-Media-focusIndex-changed-by-link.cpp progs+= test-Media-selection test_Media_selection_SOURCES= test-Media-selection.cpp diff --git a/tests/test-Media-focusIndex.cpp b/tests/test-Media-focusIndex-changed-by-link.cpp similarity index 100% rename from tests/test-Media-focusIndex.cpp rename to tests/test-Media-focusIndex-changed-by-link.cpp From 2acba7694c8172bccbb73c50be1e5c56ce347077 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 15:51:11 -0300 Subject: [PATCH 082/169] tests: Add test-Media-focusIndex-changed-by-sendKey --- .gitignore | 1 + tests/Makefile.am | 3 + ...st-Media-focusIndex-changed-by-sendKey.cpp | 181 ++++++++++++++++++ 3 files changed, 185 insertions(+) create mode 100644 tests/test-Media-focusIndex-changed-by-sendKey.cpp diff --git a/.gitignore b/.gitignore index 416f07dc4..3e2da1007 100644 --- a/.gitignore +++ b/.gitignore @@ -153,6 +153,7 @@ /tests/test-Media-4grid /tests/test-Media-mime /tests/test-Media-focusIndex-changed-by-link +/tests/test-Media-focusIndex-changed-by-sendKey /tests/test-Media-explicitDur /tests/test-Media-nested-explicitDur /tests/test-Media-anchors-started-from-ports diff --git a/tests/Makefile.am b/tests/Makefile.am index ef7ae5216..5ddcc6020 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -252,6 +252,9 @@ test_Media_4grid_SOURCES= test-Media-4grid.cpp progs+= test-Media-focusIndex-changed-by-link test_Media_focusIndex_changed_by_link_SOURCES= test-Media-focusIndex-changed-by-link.cpp +progs+= test-Media-focusIndex-changed-by-sendKey +test_Media_focusIndex_changed_by_sendKey_SOURCES= test-Media-focusIndex-changed-by-sendKey.cpp + progs+= test-Media-selection test_Media_selection_SOURCES= test-Media-selection.cpp diff --git a/tests/test-Media-focusIndex-changed-by-sendKey.cpp b/tests/test-Media-focusIndex-changed-by-sendKey.cpp new file mode 100644 index 000000000..ddf719fbe --- /dev/null +++ b/tests/test-Media-focusIndex-changed-by-sendKey.cpp @@ -0,0 +1,181 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + for (auto sample : samples) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + sample.uri, sample.uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *settings = cast (MediaSettings *, doc->getSettings ()); + g_assert_nonnull (settings); + Event *settings_lambda = settings->getLambda (); + g_assert_nonnull (settings_lambda); + g_assert (settings->getProperty ("service.currentFocus") == "1"); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + g_assert (m1->getProperty ("focusIndex") == "0"); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + g_assert (m2->getProperty ("focusIndex") == "1"); + + Media *m3 = cast (Media *, doc->getObjectById ("m3")); + g_assert_nonnull (m3); + Event *m3_lambda = m3->getLambda (); + g_assert_nonnull (m3_lambda); + g_assert (m3->getProperty ("focusIndex") == ""); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (settings_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (m3_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (settings_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (m3_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + + fmt->sendTick (0, 0, 0); + g_assert (settings->getProperty ("service.currentFocus") == "0"); + g_assert (m1->isFocused ()); + g_assert_false (m2->isFocused ()); + g_assert_false (m3->isFocused ()); + + fmt->sendKey ("CURSOR_UP", true); + fmt->sendTick (0, 0, 0); + g_assert (settings->getProperty ("service.currentFocus") == "1"); + g_assert_false (m1->isFocused ()); + g_assert (m2->isFocused ()); + g_assert_false (m3->isFocused ()); + + fmt->sendKey ("CURSOR_DOWN", true); + fmt->sendTick (0, 0, 0); + g_assert (settings->getProperty ("service.currentFocus") == "0"); + g_assert (m1->isFocused ()); + g_assert_false (m2->isFocused ()); + g_assert_false (m3->isFocused ()); + + fmt->sendKey ("CURSOR_DOWN", true); + fmt->sendTick (0, 0, 0); + g_assert (settings->getProperty ("service.currentFocus") == "1"); + g_assert_false (m1->isFocused ()); + g_assert (m2->isFocused ()); + g_assert_false (m3->isFocused ()); + + fmt->sendKey ("CURSOR_LEFT", true); + fmt->sendTick (0, 0, 0); + g_assert (settings->getProperty ("service.currentFocus") == "0"); + g_assert (m1->isFocused ()); + g_assert_false (m2->isFocused ()); + g_assert_false (m3->isFocused ()); + + fmt->sendKey ("CURSOR_LEFT", true); + fmt->sendTick (0, 0, 0); + g_assert (settings->getProperty ("service.currentFocus") == "1"); + g_assert_false (m1->isFocused ()); + g_assert (m2->isFocused ()); + g_assert_false (m3->isFocused ()); + + fmt->sendKey ("CURSOR_RIGHT", true); + fmt->sendTick (0, 0, 0); + g_assert (settings->getProperty ("service.currentFocus") == "0"); + g_assert (m1->isFocused ()); + g_assert_false (m2->isFocused ()); + g_assert_false (m3->isFocused ()); + + fmt->sendKey ("CURSOR_RIGHT", true); + fmt->sendTick (0, 0, 0); + g_assert (settings->getProperty ("service.currentFocus") == "1"); + g_assert_false (m1->isFocused ()); + g_assert (m2->isFocused ()); + g_assert_false (m3->isFocused ()); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} From cc6f889382a38407a6b4e2947406f197d110b951 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 16:16:33 -0300 Subject: [PATCH 083/169] tests: Add test-Ginga-resize --- .gitignore | 1 + tests/Makefile.am | 3 +++ tests/test-Ginga-resize.cpp | 40 +++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 tests/test-Ginga-resize.cpp diff --git a/.gitignore b/.gitignore index 3e2da1007..2d1f60beb 100644 --- a/.gitignore +++ b/.gitignore @@ -148,6 +148,7 @@ /tests/test-Ginga-version /tests/test-GingaInternal-getData /tests/test-GingaInternal-setData +/tests/test-Ginga-resize /tests/test-Media-new /tests/test-Media-selection /tests/test-Media-4grid diff --git a/tests/Makefile.am b/tests/Makefile.am index 5ddcc6020..79d42a5d6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -364,6 +364,9 @@ test_Ginga_getOptionInt_SOURCES= test-Ginga-getOptionInt.cpp progs+= test-Ginga-setOptionInt test_Ginga_setOptionInt_SOURCES= test-Ginga-setOptionInt.cpp +progs+= test-Ginga-resize +test_Ginga_resize_SOURCES= test-Ginga-resize.cpp + progs+= xfail-test-Ginga-getOptionInt xfail_test_Ginga_getOptionInt_SOURCES= xfail-test-Ginga-getOptionInt.cpp diff --git a/tests/test-Ginga-resize.cpp b/tests/test-Ginga-resize.cpp new file mode 100644 index 000000000..fe5295826 --- /dev/null +++ b/tests/test-Ginga-resize.cpp @@ -0,0 +1,40 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + Ginga *ginga; + string tmp, errmsg; + + ginga = Ginga::create (nullptr); + g_assert_nonnull (ginga); + ginga->setOptionInt ("width", 800); + g_assert (ginga->getOptionInt ("width") == 800); + ginga->setOptionInt ("height", 600); + g_assert (ginga->getOptionInt ("height") == 600); + tmp = tests_write_tmp_file (""); + g_assert_true (ginga->start (tmp, &errmsg)); + ginga->resize (640, 480); + g_assert (ginga->getOptionInt ("width") == 640); + g_assert (ginga->getOptionInt ("height") == 480); + g_remove (tmp.c_str ()); + + exit (EXIT_SUCCESS); +} From d993df01487e815e33b05ddd9c902b156356e876 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Mon, 23 Apr 2018 18:15:52 -0300 Subject: [PATCH 084/169] lib: Fix evalAction over an media that is pointed by an port (closes #121) --- lib/Document.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/Document.cpp b/lib/Document.cpp index 45de0d4d4..aa3a5f5d2 100644 --- a/lib/Document.cpp +++ b/lib/Document.cpp @@ -288,7 +288,7 @@ Document::evalAction (Action init) Event *evt; Object *obj; Composition *comp; - Context *ctx; + Context *ctx_parent, *ctx_grandparent; act = stack.back (); stack.pop_back (); @@ -312,23 +312,28 @@ Document::evalAction (Action init) if (comp != nullptr && instanceof (Context *, comp) && comp->isOccurring ()) { - ctx = cast (Context *, comp); - g_assert_nonnull (ctx); + ctx_parent = cast (Context *, comp); + g_assert_nonnull (ctx_parent); // Trigger links in the parent context - list ret = evalActionInContext (act, ctx); + list ret = evalActionInContext (act, ctx_parent); stack.insert (stack.end (), ret.begin (), ret.end ()); // If the event object is pointed by a port in the parent context, - // trigger links in the parent context ( and ancestors) - for (auto port : *ctx->getPorts ()) + // trigger links in the its grantparent context ( and ancestors) + comp = ctx_parent->getParent (); + if (comp != nullptr && + instanceof (Context *, comp) && comp->isOccurring ()) { - if (port->getObject () == evt->getObject () - && ctx->getParent () != nullptr) + ctx_grandparent = cast (Context *, comp); + for (auto port : *ctx_parent->getPorts ()) { - ctx = cast (Context *, ctx->getParent ()); - list ret = evalActionInContext (act, ctx); - stack.insert (stack.end (), ret.begin (), ret.end ()); + if (port->getObject () == evt->getObject ()) + { + list ret + = evalActionInContext (act, ctx_grandparent); + stack.insert (stack.end (), ret.begin (), ret.end ()); + } } } } @@ -361,9 +366,9 @@ Document::evalAction (Action init) // If event object is a context, trigger the context itself if (instanceof (Context *, obj)) { - ctx = cast (Context *, obj); - g_assert_nonnull (ctx); - list ret = evalActionInContext (act, ctx); + ctx_parent = cast (Context *, obj); + g_assert_nonnull (ctx_parent); + list ret = evalActionInContext (act, ctx_parent); stack.insert (stack.end (), ret.begin (), ret.end ()); } } From db671cc9183e6b0aa48a12ab5c0c824e1c3f95c4 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 24 Apr 2018 17:14:55 -0300 Subject: [PATCH 085/169] tests: Improve test-Media-selection --- tests/test-Media-selection.cpp | 81 ++++++++++++++++++++++++++++++++++ tests/tests.h | 3 +- 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/tests/test-Media-selection.cpp b/tests/test-Media-selection.cpp index 93752accf..9c24a35fa 100644 --- a/tests/test-Media-selection.cpp +++ b/tests/test-Media-selection.cpp @@ -37,6 +37,9 @@ main (void) \n\ \n\ \n\ + \n\ + \n\ + \n\ \n\ \n\ \n\ @@ -93,5 +96,83 @@ main (void) delete fmt; } + + for (int j = 0; j < samples_keys.size (); j++) + { + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri, + samples_keys[j])); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + Event *m1_selection = m1->getSelectionEvent (samples_keys[j]); + g_assert_nonnull (m1_selection); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_selection->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when start document, m1 is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_selection->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // when sendKey, m1_selection and m2_lambda are OCCURRING + fmt->sendKey (samples_keys[j], true); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_selection->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + } exit (EXIT_SUCCESS); } diff --git a/tests/tests.h b/tests/tests.h index 3ebef4c52..c131557e2 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -36,6 +36,8 @@ typedef struct const char *uri; } sample; +vector samples_keys + = { "RED", "GREEN", "YELLOW", "BLUE", "INFO" }; vector samples = { { "application/x-ginga-timer", "" }, { "audio/mp3", ABS_TOP_SRCDIR "/tests-ncl/samples/arcade.mp3" }, @@ -349,7 +351,6 @@ tests_create_document_with_switch_and_start ( g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::OCCURRING); g_assert_cmpint ((*m2_lambda)->getState (), ==, Event::SLEEPING); // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); - } #endif // TESTS_H From 2d11c3aea10491d171c40c9703bb019da4530f55 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 25 Apr 2018 15:02:17 -0300 Subject: [PATCH 086/169] lib: Add time in TRACE of Media transitions --- lib/Media.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/Media.cpp b/lib/Media.cpp index 3f8995de8..b5f0341b7 100644 --- a/lib/Media.cpp +++ b/lib/Media.cpp @@ -345,7 +345,8 @@ Media::afterTransition (Event *evt, Event::Transition transition) this->addDelayedAction (e, Event::STOP, "", end); } } - TRACE ("start %s", evt->getFullId ().c_str ()); + TRACE ("start %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); } else if (evt->hasLabel ()) { @@ -354,11 +355,13 @@ Media::afterTransition (Event *evt, Event::Transition transition) break; case Event::PAUSE: - TRACE ("pause %s", evt->getFullId ().c_str ()); + TRACE ("pause %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); break; // nothing to do case Event::RESUME: - TRACE ("resume %s", evt->getFullId ().c_str ()); + TRACE ("resume %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); break; // nothing to do case Event::STOP: @@ -367,11 +370,13 @@ Media::afterTransition (Event *evt, Event::Transition transition) { // Stop object. g_assert_nonnull (_player); - this->doStop (); if (transition == Event::ABORT) - TRACE ("abort %s", evt->getFullId ().c_str ()); + TRACE ("abort %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); else - TRACE ("stop %s", evt->getFullId ().c_str ()); + TRACE ("stop %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); + this->doStop (); } else if (evt->getLabel () != "") { @@ -423,8 +428,10 @@ Media::afterTransition (Event *evt, Event::Transition transition) } this->setProperty (name, value, dur); this->addDelayedAction (evt, Event::STOP, value, dur); - TRACE ("start %s:='%s' (dur=%s)", evt->getFullId ().c_str (), - value.c_str (), (s != "") ? s.c_str () : "0s"); + TRACE ("start %s:='%s' (dur=%s) at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), value.c_str (), + (s != "") ? s.c_str () : "0s", + GINGA_TIME_ARGS (_time)); break; } From 2b458f0a9c6ee9a207d0b87854f4228aaccb4b3f Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 25 Apr 2018 15:08:36 -0300 Subject: [PATCH 087/169] tests: Add tests for anchor with end after media content duration --- .../test-Media-anchors-started-from-links.cpp | 100 +++++++++++++++++ .../test-Media-anchors-started-from-ports.cpp | 102 ++++++++++++++++++ 2 files changed, 202 insertions(+) diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp index 3aa7b31c2..caaa452e4 100644 --- a/tests/test-Media-anchors-started-from-links.cpp +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -614,5 +614,105 @@ main (void) delete fmt; } + // start in anchor with non-zero end and link waiting an anchor with end + // time the end before to the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 20 * GINGA_SECOND); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 5 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 15 * GINGA_SECOND); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + // when start document, a1 and a2 is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // when advance 5, a1 OCCURRING + fmt->sendTick (5 * GINGA_SECOND, 5 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when advance 5, a2 is OCCURRING + fmt->sendTick (5 * GINGA_SECOND, 5 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::SLEEPING); + // TODO: this should SLEEPING + // g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + exit (EXIT_SUCCESS); } diff --git a/tests/test-Media-anchors-started-from-ports.cpp b/tests/test-Media-anchors-started-from-ports.cpp index 561962652..88bc89089 100644 --- a/tests/test-Media-anchors-started-from-ports.cpp +++ b/tests/test-Media-anchors-started-from-ports.cpp @@ -613,5 +613,107 @@ main (void) delete fmt; } + // start in anchor with non-zero end and link waiting an anchor with end + // time the end before to the first anchor + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Time begin, end; + Event *a1 = m1->getPresentationEvent ("a1"); + a1->getInterval (&begin, &end); + g_assert_nonnull (a1); + g_assert_cmpuint (begin, ==, 10 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 20 * GINGA_SECOND); + Event *a2 = m1->getPresentationEvent ("a2"); + g_assert_nonnull (a2); + a2->getInterval (&begin, &end); + g_assert_cmpuint (begin, ==, 5 * GINGA_SECOND); + g_assert_cmpuint (end, ==, 15 * GINGA_SECOND); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + fmt->sendTick (0, 0, 0); + // when start document, a1 and a2 is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // -------------------------------- + // main check + + // when advance 5, a1 OCCURRING + fmt->sendTick (5 * GINGA_SECOND, 5 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::OCCURRING); + g_assert (a2->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when advance 5, a2 is OCCURRING + fmt->sendTick (5 * GINGA_SECOND, 5 * GINGA_SECOND, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (a1->getState () == Event::SLEEPING); + g_assert (a2->getState () == Event::SLEEPING); + // TODO: this should SLEEPING + // g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + delete fmt; + } + exit (EXIT_SUCCESS); } From 8a939d89c38f3af15876c0f55b6e8a1787985170 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 25 Apr 2018 15:59:44 -0300 Subject: [PATCH 088/169] testes: Use g_assert_cmpint instead of g_assert --- tests/test-Context-new.cpp | 12 +- tests/test-Document-addObject.cpp | 16 +- tests/test-Document-getObjectById.cpp | 2 +- tests/test-Document-getObjectByIdOrAlias.cpp | 2 +- tests/test-Document-new.cpp | 8 +- tests/test-Media-new.cpp | 6 +- tests/test-MediaSettings-new.cpp | 6 +- tests/test-Object-addAlias.cpp | 6 +- tests/test-Object-addEvent.cpp | 14 +- tests/test-Parser-parseBuffer.cpp | 162 +++++++++---------- tests/test-ParserLua-parseBuffer.cpp | 44 ++--- tests/test-Predicate-new.cpp | 18 +-- tests/test-Switch-new.cpp | 2 +- tests/xfail-test-Document-addObject.cpp | 2 +- 14 files changed, 150 insertions(+), 150 deletions(-) diff --git a/tests/test-Context-new.cpp b/tests/test-Context-new.cpp index 2f61a334c..a8d3672b3 100644 --- a/tests/test-Context-new.cpp +++ b/tests/test-Context-new.cpp @@ -29,21 +29,21 @@ main (void) g_assert_null (c->getParent ()); g_assert (c->getObjectTypeAsString () == "Context"); g_assert (c->toString () != ""); - g_assert (c->getAliases ()->size () == 0); - g_assert (c->getEvents ()->size () == 1); + g_assert_cmpint (c->getAliases ()->size (), ==, 0); + g_assert_cmpint (c->getEvents ()->size (), ==, 1); g_assert_nonnull (c->getLambda ()); g_assert_false (c->isOccurring ()); g_assert_false (c->isPaused ()); g_assert_true (c->isSleeping ()); - g_assert (c->getDelayedActions ()->size () == 0); + g_assert_cmpint (c->getDelayedActions ()->size (), ==, 0); g_assert (!c->toString ().empty ()); // Composition-only. - g_assert (c->getChildren ()->size () == 0); + g_assert_cmpint (c->getChildren ()->size (), == ,0); // Context-only. - g_assert (c->getPorts ()->size () == 0); - g_assert (c->getLinks ()->size () == 0); + g_assert_cmpint (c->getPorts ()->size (), ==, 0); + g_assert_cmpint (c->getLinks ()->size (), ==, 0); g_assert (c->getLinksStatus () == true); c->setLinksStatus (false); g_assert (c->getLinksStatus () == false); diff --git a/tests/test-Document-addObject.cpp b/tests/test-Document-addObject.cpp index 8e550b3d2..1175ff3dc 100644 --- a/tests/test-Document-addObject.cpp +++ b/tests/test-Document-addObject.cpp @@ -27,17 +27,17 @@ main (void) tests_create_document (&doc, &root, &settings); g_assert_false (doc->addObject (root)); - g_assert (doc->getObjects ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 2); g_assert_false (doc->addObject (settings)); - g_assert (doc->getObjects ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 2); // Add media. { Media *m = new Media ("m"); g_assert (doc->addObject (m)); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); auto it = doc->getMedias ()->find (m); g_assert (it != doc->getMedias ()->end ()); } @@ -46,8 +46,8 @@ main (void) { Context *c = new Context ("c"); g_assert (doc->addObject (c)); - g_assert (doc->getObjects ()->size () == 4); - g_assert (doc->getContexts ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 4); + g_assert_cmpint (doc->getContexts ()->size (), ==, 2); auto it = doc->getContexts ()->find (c); g_assert (it != doc->getContexts ()->end ()); } @@ -56,8 +56,8 @@ main (void) { Switch *s = new Switch ("s"); g_assert (doc->addObject (s)); - g_assert (doc->getObjects ()->size () == 5); - g_assert (doc->getSwitches ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 5); + g_assert_cmpint (doc->getSwitches ()->size (), ==, 1); auto it = doc->getSwitches ()->find (s); g_assert (it != doc->getSwitches ()->end ()); } diff --git a/tests/test-Document-getObjectById.cpp b/tests/test-Document-getObjectById.cpp index 7ae828155..945294666 100644 --- a/tests/test-Document-getObjectById.cpp +++ b/tests/test-Document-getObjectById.cpp @@ -34,7 +34,7 @@ main (void) m[i] = new Media (xstrbuild ("m%d", (int) i)); doc->addObject (m[i]); } - g_assert (doc->getObjects ()->size () == N + 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, N + 2); for (size_t i = 0; i < N; i++) { diff --git a/tests/test-Document-getObjectByIdOrAlias.cpp b/tests/test-Document-getObjectByIdOrAlias.cpp index daaa58612..87519077c 100644 --- a/tests/test-Document-getObjectByIdOrAlias.cpp +++ b/tests/test-Document-getObjectByIdOrAlias.cpp @@ -52,7 +52,7 @@ main (void) m[i]->addAlias (alias); } } - g_assert (doc->getObjects ()->size () == N + 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, N + 2); for (size_t i = 0; i < N; i++) { diff --git a/tests/test-Document-new.cpp b/tests/test-Document-new.cpp index 824b9f8fa..04cb684e4 100644 --- a/tests/test-Document-new.cpp +++ b/tests/test-Document-new.cpp @@ -26,10 +26,10 @@ main (void) tests_create_document (&doc, &root, &settings); - g_assert (doc->getObjects ()->size () == 2); // root and settings - g_assert (doc->getMedias ()->size () == 1); // settings - g_assert (doc->getContexts ()->size () == 1); // root - g_assert (doc->getSwitches ()->size () == 0); // none + g_assert_cmpint (doc->getObjects ()->size (), ==, 2); // root and settings + g_assert_cmpint (doc->getMedias ()->size (), ==, 1); // settings + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); // root + g_assert_cmpint (doc->getSwitches ()->size (), ==, 0); // none delete doc; diff --git a/tests/test-Media-new.cpp b/tests/test-Media-new.cpp index 914ea4ed7..89cf9e3e7 100644 --- a/tests/test-Media-new.cpp +++ b/tests/test-Media-new.cpp @@ -29,14 +29,14 @@ main (void) g_assert_null (m->getParent ()); g_assert (m->getObjectTypeAsString () == "Media"); g_assert (m->toString () != ""); - g_assert (m->getAliases ()->size () == 0); - g_assert (m->getEvents ()->size () == 1); + g_assert_cmpint (m->getAliases ()->size (), ==, 0); + g_assert_cmpint (m->getEvents ()->size (), ==, 1); g_assert_nonnull (m->getLambda ()); g_assert_false (m->isOccurring ()); g_assert_false (m->isPaused ()); g_assert_true (m->isSleeping ()); g_assert (m->getProperty ("zIndex") == ""); - g_assert (m->getDelayedActions ()->size () == 0); + g_assert_cmpint (m->getDelayedActions ()->size (), ==, 0); g_assert (!m->toString ().empty ()); // Media-only. diff --git a/tests/test-MediaSettings-new.cpp b/tests/test-MediaSettings-new.cpp index 232873d7a..45e5c31f9 100644 --- a/tests/test-MediaSettings-new.cpp +++ b/tests/test-MediaSettings-new.cpp @@ -29,20 +29,20 @@ main (void) g_assert_null (m->getParent ()); g_assert (m->getObjectTypeAsString () == "MediaSettings"); g_assert (m->toString () != ""); - g_assert (m->getAliases ()->size () == 0); + g_assert_cmpint (m->getAliases ()->size (), ==, 0); g_assert_nonnull (m->getLambda ()); g_assert_false (m->isOccurring ()); g_assert_false (m->isPaused ()); g_assert_true (m->isSleeping ()); g_assert (m->getProperty ("zIndex") == ""); - g_assert (m->getDelayedActions ()->size () == 0); + g_assert_cmpint (m->getDelayedActions ()->size (), ==,0); // Media-only. g_assert_false (m->isFocused ()); g_assert_false (m->getZ (nullptr, nullptr)); // MediaSettings-only. - g_assert (m->getEvents ()->size () == 2); + g_assert_cmpint (m->getEvents ()->size (), ==, 2); g_assert_nonnull (m->getAttributionEvent ("service.currentFocus")); delete m; diff --git a/tests/test-Object-addAlias.cpp b/tests/test-Object-addAlias.cpp index 0753bc932..e87a6feea 100644 --- a/tests/test-Object-addAlias.cpp +++ b/tests/test-Object-addAlias.cpp @@ -29,7 +29,7 @@ main (void) for (auto obj : objs) { - g_assert (obj->getAliases ()->size () == 0); + g_assert_cmpint (obj->getAliases ()->size (), ==, 0); g_assert_false (obj->hasAlias ("a1")); obj->addAlias ("a1"); @@ -42,12 +42,12 @@ main (void) g_assert_false (obj->hasAlias ("a3")); obj->addAlias ("a3"); g_assert_true (obj->hasAlias ("a3")); - g_assert (obj->getAliases ()->size () == 3); + g_assert_cmpint (obj->getAliases ()->size (), ==, 3); obj->addAlias ("a1"); obj->addAlias ("a2"); obj->addAlias ("a3"); - g_assert (obj->getAliases ()->size () == 3); + g_assert_cmpint (obj->getAliases ()->size (), ==, 3); g_assert (!obj->toString ().empty ()); delete obj; diff --git a/tests/test-Object-addEvent.cpp b/tests/test-Object-addEvent.cpp index 612fe7c67..63359e48d 100644 --- a/tests/test-Object-addEvent.cpp +++ b/tests/test-Object-addEvent.cpp @@ -34,7 +34,7 @@ main (void) Time begin, end; n = (instanceof (MediaSettings *, obj)) ? 2 : 1; - g_assert (obj->getEvents ()->size () == n); + g_assert_cmpint (obj->getEvents ()->size (), ==, n); // Presentation events. g_assert_null (obj->getPresentationEvent ("p1")); @@ -67,13 +67,13 @@ main (void) evt = obj->getPresentationEvent ("p4"); g_assert_nonnull (evt); - g_assert (obj->getEvents ()->size () == n + 4); + g_assert_cmpint (obj->getEvents ()->size (), ==, n + 4); obj->addPresentationEvent ("p1", 0, 0); obj->addPresentationEvent ("p2", 0, 0); obj->addPresentationEvent ("p3", 0, 0); obj->addPresentationEvent ("p4", "label1"); g_assert_nonnull (obj->getPresentationEventByLabel ("label1")); - g_assert (obj->getEvents ()->size () == n + 4); + g_assert_cmpint (obj->getEvents ()->size (), ==, n + 4); // Attribution events. g_assert_null (obj->getAttributionEvent ("a1")); @@ -88,11 +88,11 @@ main (void) obj->addAttributionEvent ("a3"); g_assert_nonnull (obj->getAttributionEvent ("a3")); - g_assert (obj->getEvents ()->size () == n + 7); + g_assert_cmpint (obj->getEvents ()->size (), ==, n + 7); obj->addAttributionEvent ("a1"); obj->addAttributionEvent ("a2"); obj->addAttributionEvent ("a3"); - g_assert (obj->getEvents ()->size () == n + 7); + g_assert_cmpint (obj->getEvents ()->size (), ==, n + 7); // Selection events. g_assert_null (obj->getSelectionEvent ("s1")); @@ -107,11 +107,11 @@ main (void) obj->addSelectionEvent ("s3"); g_assert_nonnull (obj->getSelectionEvent ("s3")); - g_assert (obj->getEvents ()->size () == n + 10); + g_assert_cmpint (obj->getEvents ()->size (), ==, n + 10); obj->addSelectionEvent ("s1"); obj->addSelectionEvent ("s2"); obj->addSelectionEvent ("s3"); - g_assert (obj->getEvents ()->size () == n + 10); + g_assert_cmpint (obj->getEvents ()->size (), ==, n + 10); delete obj; } diff --git a/tests/test-Parser-parseBuffer.cpp b/tests/test-Parser-parseBuffer.cpp index f0e254b30..a011a81a3 100644 --- a/tests/test-Parser-parseBuffer.cpp +++ b/tests/test-Parser-parseBuffer.cpp @@ -2569,9 +2569,9 @@ main (void) \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 2); - g_assert (doc->getMedias ()->size () == 1); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 2); + g_assert_cmpint (doc->getMedias ()->size (), ==, 1); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); delete doc; } @@ -2623,16 +2623,16 @@ main (void) \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 2); - g_assert (doc->getMedias ()->size () == 1); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 2); + g_assert_cmpint (doc->getMedias ()->size (), ==, 1); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *root = cast (Context *, doc->getRoot ()); g_assert_nonnull (root); Media *m = cast (MediaSettings *, doc->getObjectByIdOrAlias ("m")); g_assert_nonnull (m); - g_assert (m->getEvents ()->size () == 6); + g_assert_cmpint (m->getEvents ()->size (), ==, 6); g_assert (m->getAttributionEvent ("service.currentFocus") != nullptr); g_assert (m->getProperty ("service.currentFocus") == "0"); @@ -2673,13 +2673,13 @@ main (void) \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Media *m = cast (Media *, doc->getObjectById ("m")); g_assert_nonnull (m); - g_assert (m->getEvents ()->size () == 7); + g_assert_cmpint (m->getEvents ()->size (), ==, 7); Time begin, end; Event *evt = m->getPresentationEvent ("a1"); @@ -2734,13 +2734,13 @@ main (void) \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Media *m = cast (Media *, doc->getObjectById ("m")); g_assert_nonnull (m); - g_assert (m->getEvents ()->size () == 10); + g_assert_cmpint (m->getEvents ()->size (), ==, 10); g_assert (m->getAttributionEvent ("x") != nullptr); g_assert (m->getProperty ("x") == "1"); @@ -2792,13 +2792,13 @@ main (void) \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Media *m = cast (Media *, doc->getObjectById ("m")); g_assert_nonnull (m); - g_assert (m->getEvents ()->size () == 3); + g_assert_cmpint (m->getEvents ()->size (), ==, 3); g_assert (m->getAttributionEvent ("transIn") != nullptr); g_assert (m->getProperty ("transIn") == "\ @@ -2907,9 +2907,9 @@ borderWidth='0',borderColor=''}"); ", B0.c_str (), B1.c_str (), B2.c_str ())); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 5); - g_assert (doc->getMedias ()->size () == 4); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 5); + g_assert_cmpint (doc->getMedias ()->size (), ==, 4); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Media *m1 = cast (Media *, doc->getObjectById ("m1")); g_assert_nonnull (m1); @@ -2967,9 +2967,9 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 4); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 4); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 2); Media *m = cast (Media *, doc->getObjectByIdOrAlias ("m")); g_assert_nonnull (m); @@ -3022,9 +3022,9 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 5); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 3); + g_assert_cmpint (doc->getObjects ()->size (), ==, 5); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 3); Context *root = cast (Context *, doc->getRoot ()); g_assert_nonnull (root); @@ -3038,7 +3038,7 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); Media *m = cast (Media *, doc->getObjectById ("m")); g_assert_nonnull (m); - g_assert (root->getPorts ()->size () == 5); + g_assert_cmpint (root->getPorts ()->size (), ==, 5); auto port = root->getPorts ()->begin (); g_assert (*port++ == c1->getLambda ()); g_assert (*port++ == root->getLambda ()); @@ -3081,9 +3081,9 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *root = cast (Context *, doc->getRoot ()); g_assert_nonnull (root); @@ -3092,11 +3092,11 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); g_assert_nonnull (m); auto links = doc->getRoot ()->getLinks (); - g_assert (links->size () == 1); + g_assert_cmpint (links->size (), ==, 1); auto link = links->begin (); - g_assert (link->first.size () == 1); - g_assert (link->second.size () == 1); + g_assert_cmpint (link->first.size (), ==, 1); + g_assert_cmpint (link->second.size (), ==, 1); auto cond = link->first.begin (); g_assert (cond->event == m->getPresentationEvent ("a1")); @@ -3164,9 +3164,9 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *root = cast (Context *, doc->getRoot ()); g_assert_nonnull (root); @@ -3175,11 +3175,11 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); g_assert_nonnull (m); auto links = doc->getRoot ()->getLinks (); - g_assert (links->size () == 1); + g_assert_cmpint (links->size (), ==, 1); auto link = links->begin (); - g_assert (link->first.size () == 1); - g_assert (link->second.size () == 1); + g_assert_cmpint (link->first.size (), ==, 1); + g_assert_cmpint (link->second.size (), ==, 1); auto cond = link->first.begin (); g_assert (cond->event == m->getPresentationEvent ("a1")); @@ -3259,9 +3259,9 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); \n\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *root = doc->getRoot (); g_assert_nonnull (root); @@ -3270,11 +3270,11 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); g_assert_nonnull (m); auto links = doc->getRoot ()->getLinks (); - g_assert (links->size () == 2); + g_assert_cmpint (links->size (), ==, 2); auto link = links->begin (); - g_assert (link->first.size () == 2); - g_assert (link->second.size () == 2); + g_assert_cmpint (link->first.size (), ==, 2); + g_assert_cmpint (link->second.size (), ==, 2); auto cond = link->first.begin (); g_assert (cond->event == m->getPresentationEvent ("a1")); @@ -3403,9 +3403,9 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 7); - g_assert (doc->getMedias ()->size () == 4); - g_assert (doc->getContexts ()->size () == 3); + g_assert_cmpint (doc->getObjects ()->size (), ==, 7); + g_assert_cmpint (doc->getMedias ()->size (), ==, 4); + g_assert_cmpint (doc->getContexts ()->size (), ==, 3); Context *root = doc->getRoot (); g_assert_nonnull (root); @@ -3426,11 +3426,11 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); g_assert_nonnull (c2); auto links = doc->getRoot ()->getLinks (); - g_assert (links->size () == 1); + g_assert_cmpint (links->size (), ==, 1); auto link = links->begin (); - g_assert (link->first.size () == 2); - g_assert (link->second.size () == 4); + g_assert_cmpint (link->first.size (), ==, 2); + g_assert_cmpint (link->second.size (), ==, 4); auto cond = link->first.begin (); g_assert (cond->event == c1->getLambda ()); @@ -3510,19 +3510,19 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 2); - g_assert (doc->getMedias ()->size () == 1); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 2); + g_assert_cmpint (doc->getMedias ()->size (), ==, 1); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *root = doc->getRoot (); g_assert_nonnull (root); auto links = doc->getRoot ()->getLinks (); - g_assert (links->size () == 1); + g_assert_cmpint (links->size (), ==, 1); auto link = links->begin (); - g_assert (link->first.size () == 1); - g_assert (link->second.size () == 1); + g_assert_cmpint (link->first.size (), ==, 1); + g_assert_cmpint (link->second.size (), ==, 1); auto cond = link->first.begin (); g_assert (cond->event == root->getLambda ()); @@ -3587,9 +3587,9 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *root = doc->getRoot (); g_assert_nonnull (root); @@ -3598,12 +3598,12 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); g_assert_nonnull (m); auto links = doc->getRoot ()->getLinks (); - g_assert (links->size () == 2); + g_assert_cmpint (links->size (), ==, 2); // First link. auto link = links->begin (); - g_assert (link->first.size () == 1); - g_assert (link->second.size () == 1); + g_assert_cmpint (link->first.size (), ==, 1); + g_assert_cmpint (link->second.size (), ==, 1); auto cond = link->first.begin (); g_assert (cond->event == root->getLambda ()); @@ -3692,19 +3692,19 @@ horzRepeat='0',vertRepeat='0',borderWidth='0',borderColor=''}"); "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 2); - g_assert (doc->getMedias ()->size () == 1); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 2); + g_assert_cmpint (doc->getMedias ()->size (), ==, 1); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *root = doc->getRoot (); g_assert_nonnull (root); auto links = doc->getRoot ()->getLinks (); - g_assert (links->size () == 1); + g_assert_cmpint (links->size (), ==, 1); auto link = links->begin (); - g_assert (link->first.size () == 1); - g_assert (link->second.size () == 1); + g_assert_cmpint (link->first.size (), ==, 1); + g_assert_cmpint (link->second.size (), ==, 1); auto cond = link->first.begin (); g_assert (cond->event == root->getLambda ()); @@ -3798,9 +3798,9 @@ and($__root__.p<='1',\ "); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 5); - g_assert (doc->getMedias ()->size () == 3); - g_assert (doc->getContexts ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 5); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getContexts ()->size (), ==, 2); Context *root = doc->getRoot (); g_assert_nonnull (root); @@ -3815,11 +3815,11 @@ and($__root__.p<='1',\ g_assert_nonnull (m2); auto links = doc->getRoot ()->getLinks (); - g_assert (links->size () == 1); + g_assert_cmpint (links->size (), ==, 1); auto link = links->begin (); - g_assert (link->first.size () == 3); - g_assert (link->second.size () == 1); + g_assert_cmpint (link->first.size (), ==, 3); + g_assert_cmpint (link->second.size (), ==, 1); auto cond = link->first.begin (); g_assert (cond->event == m->getSelectionEvent ("RED")); @@ -4075,11 +4075,11 @@ and(and('0'!='0', '1'>'1'), not($__root__.q==$c.p), $m.r<'33')"); Context *root = doc->getRoot (); g_assert_nonnull (root); g_assert (root->getId () == "__root__"); - g_assert (root->getPorts ()->size () == 3); - g_assert (root->getChildren ()->size () == 3); - g_assert (root->getLinks ()->size () == 0); + g_assert_cmpint (root->getPorts ()->size (), ==, 3); + g_assert_cmpint (root->getChildren ()->size (), ==, 3); + g_assert_cmpint (root->getLinks ()->size (), ==, 0); - g_assert (doc->getMedias ()->size () == 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); Media *m = cast (Media *, doc->getObjectById ("m")); g_assert_nonnull (m); diff --git a/tests/test-ParserLua-parseBuffer.cpp b/tests/test-ParserLua-parseBuffer.cpp index 360c7c289..469b230bf 100644 --- a/tests/test-ParserLua-parseBuffer.cpp +++ b/tests/test-ParserLua-parseBuffer.cpp @@ -67,9 +67,9 @@ main (void) return ncl"); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 5); - g_assert (doc->getMedias ()->size () == 3); - g_assert (doc->getContexts ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 5); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getContexts ()->size (), ==, 2); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -114,10 +114,10 @@ return ncl"); return ncl"); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 7); - g_assert (doc->getMedias ()->size () == 3); - g_assert (doc->getContexts ()->size () == 2); - g_assert (doc->getSwitches ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 7); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getContexts ()->size (), ==, 2); + g_assert_cmpint (doc->getSwitches ()->size (), ==, 2); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -175,9 +175,9 @@ return ncl"); return ncl"); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 4); - g_assert (doc->getMedias ()->size () == 3); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 4); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); @@ -218,16 +218,16 @@ return ncl"); return ncl"); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); Event *body_lambda = body->getLambda (); g_assert_nonnull (body_lambda); - g_assert (body->getLinks ()->size () == 1); + g_assert_cmpint (body->getLinks ()->size (), ==, 1); Media *m1 = cast (Media *, body->getChildById ("m1")); g_assert_nonnull (m1); @@ -256,16 +256,16 @@ return ncl"); return ncl"); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 3); - g_assert (doc->getMedias ()->size () == 2); - g_assert (doc->getContexts ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); Event *body_lambda = body->getLambda (); g_assert_nonnull (body_lambda); - g_assert (body->getLinks ()->size () == 1); + g_assert_cmpint (body->getLinks ()->size (), ==, 1); Media *m1 = cast (Media *, body->getChildById ("m1")); g_assert_nonnull (m1); @@ -297,10 +297,10 @@ return ncl"); return ncl"); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 5); - g_assert (doc->getMedias ()->size () == 3); - g_assert (doc->getContexts ()->size () == 1); - g_assert (doc->getSwitches ()->size () == 1); + g_assert_cmpint (doc->getObjects ()->size (), ==, 5); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getContexts ()->size (), ==, 1); + g_assert_cmpint (doc->getSwitches ()->size (), ==, 1); Context *body = cast (Context *, doc->getRoot ()); g_assert_nonnull (body); diff --git a/tests/test-Predicate-new.cpp b/tests/test-Predicate-new.cpp index c4a987ecb..7496fdb34 100644 --- a/tests/test-Predicate-new.cpp +++ b/tests/test-Predicate-new.cpp @@ -39,7 +39,7 @@ main (void) pred = new Predicate (Predicate::ATOM); g_assert (pred->getType () == Predicate::ATOM); - g_assert (pred->getChildren ()->size () == 0); + g_assert_cmpint (pred->getChildren ()->size (), ==, 0); g_assert (!pred->toString ().empty ()); CHECK_TEST (pred, "", Predicate::EQ, ""); @@ -82,7 +82,7 @@ main (void) pred = new Predicate (Predicate::VERUM); g_assert (pred->getType () == Predicate::VERUM); - g_assert (pred->getChildren ()->size () == 0); + g_assert_cmpint (pred->getChildren ()->size (), ==, 0); g_assert (!pred->toString ().empty ()); delete pred; @@ -94,7 +94,7 @@ main (void) pred = new Predicate (Predicate::NEGATION); g_assert (pred->getType () == Predicate::NEGATION); - g_assert (pred->getChildren ()->size () == 0); + g_assert_cmpint (pred->getChildren ()->size (), ==, 0); g_assert (!pred->toString ().empty ()); delete pred; @@ -106,18 +106,18 @@ main (void) pred = new Predicate (Predicate::CONJUNCTION); g_assert (pred->getType () == Predicate::CONJUNCTION); - g_assert (pred->getChildren ()->size () == 0); + g_assert_cmpint (pred->getChildren ()->size (), ==, 0); g_assert (!pred->toString ().empty ()); child1 = new Predicate (Predicate::ATOM); child1->setTest ("a", Predicate::EQ, "a"); pred->addChild (child1); - g_assert (pred->getChildren ()->size () == 1); + g_assert_cmpint (pred->getChildren ()->size (), ==, 1); child2 = new Predicate (Predicate::ATOM); child2->setTest ("b", Predicate::EQ, "b"); pred->addChild (child2); - g_assert (pred->getChildren ()->size () == 2); + g_assert_cmpint (pred->getChildren ()->size (), ==, 2); delete pred; } @@ -128,19 +128,19 @@ main (void) pred = new Predicate (Predicate::DISJUNCTION); g_assert (pred->getType () == Predicate::DISJUNCTION); - g_assert (pred->getChildren ()->size () == 0); + g_assert_cmpint (pred->getChildren ()->size (), ==, 0); g_assert (!pred->toString ().empty ()); child1 = new Predicate (Predicate::ATOM); child1->setTest ("a", Predicate::EQ, "a"); pred->addChild (child1); - g_assert (pred->getChildren ()->size () == 1); + g_assert_cmpint (pred->getChildren ()->size (), ==, 1); g_assert (child1->getParent () == pred); child2 = new Predicate (Predicate::ATOM); child2->setTest ("b", Predicate::EQ, "b"); pred->addChild (child2); - g_assert (pred->getChildren ()->size () == 2); + g_assert_cmpint (pred->getChildren ()->size (), ==, 2); g_assert (child2->getParent () == pred); delete pred; diff --git a/tests/test-Switch-new.cpp b/tests/test-Switch-new.cpp index 4c5e14ca3..d47d00acc 100644 --- a/tests/test-Switch-new.cpp +++ b/tests/test-Switch-new.cpp @@ -35,7 +35,7 @@ main (void) g_assert_false (s->isOccurring ()); g_assert_false (s->isPaused ()); g_assert_true (s->isSleeping ()); - g_assert (s->getDelayedActions ()->size () == 0); + g_assert_cmpint (s->getDelayedActions ()->size (), ==, 0); g_assert (!s->toString ().empty ()); // Composition-only. diff --git a/tests/xfail-test-Document-addObject.cpp b/tests/xfail-test-Document-addObject.cpp index acb3394ba..1c22e0bd8 100644 --- a/tests/xfail-test-Document-addObject.cpp +++ b/tests/xfail-test-Document-addObject.cpp @@ -24,7 +24,7 @@ main (void) doc = new Document (); g_assert_nonnull (doc); - g_assert (doc->getObjects ()->size () == 2); + g_assert_cmpint (doc->getObjects ()->size (), ==, 2); doc->addObject (new MediaSettings ("s")); // die delete doc; From f6e9a26657239479e5e82c20e99f2516e31766fe Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 25 Apr 2018 16:09:47 -0300 Subject: [PATCH 089/169] testes: Use g_assert_true/false instead of g_assert --- tests/test-Context-new.cpp | 4 ++-- tests/test-aux-ginga-parse-bool.cpp | 12 ++++++------ tests/test-aux-xpathbuildabs.cpp | 8 ++++---- tests/test-aux-xpathisabs.cpp | 12 ++++++------ tests/test-aux-xpathmakeabs.cpp | 8 ++++---- tests/test-aux-xstrcaseeq.cpp | 10 +++++----- tests/test-aux-xstrhasprefix.cpp | 12 ++++++------ tests/test-aux-xstrhassuffix.cpp | 10 +++++----- tests/test-aux-xstrispercent.cpp | 18 +++++++++--------- tests/test-aux-xstrtodorpercent.cpp | 12 ++++++------ tests/test-aux-xstrtoll.cpp | 14 +++++++------- 11 files changed, 60 insertions(+), 60 deletions(-) diff --git a/tests/test-Context-new.cpp b/tests/test-Context-new.cpp index a8d3672b3..a3906168d 100644 --- a/tests/test-Context-new.cpp +++ b/tests/test-Context-new.cpp @@ -44,9 +44,9 @@ main (void) // Context-only. g_assert_cmpint (c->getPorts ()->size (), ==, 0); g_assert_cmpint (c->getLinks ()->size (), ==, 0); - g_assert (c->getLinksStatus () == true); + g_assert_true (c->getLinksStatus ()); c->setLinksStatus (false); - g_assert (c->getLinksStatus () == false); + g_assert_false (c->getLinksStatus ()); delete c; diff --git a/tests/test-aux-ginga-parse-bool.cpp b/tests/test-aux-ginga-parse-bool.cpp index 8f3262186..f89ab8cb8 100644 --- a/tests/test-aux-ginga-parse-bool.cpp +++ b/tests/test-aux-ginga-parse-bool.cpp @@ -21,11 +21,11 @@ int main (void) { g_assert (!ginga::try_parse_bool ("*** invalid ***", nullptr)); - g_assert (ginga::parse_bool ("true") == true); - g_assert (ginga::parse_bool ("false") == false); - g_assert (ginga::parse_bool ("True") == true); - g_assert (ginga::parse_bool ("False") == false); - g_assert (ginga::parse_bool ("TRUE") == true); - g_assert (ginga::parse_bool ("FALSE") == false); + g_assert_true (ginga::parse_bool ("true")); + g_assert_false (ginga::parse_bool ("false")); + g_assert_true (ginga::parse_bool ("True")); + g_assert_false (ginga::parse_bool ("False")); + g_assert_true (ginga::parse_bool ("TRUE")); + g_assert_false (ginga::parse_bool ("FALSE")); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xpathbuildabs.cpp b/tests/test-aux-xpathbuildabs.cpp index b2f96eff0..4fb05cc85 100644 --- a/tests/test-aux-xpathbuildabs.cpp +++ b/tests/test-aux-xpathbuildabs.cpp @@ -23,16 +23,16 @@ main (void) string s; s = xpathbuildabs ("this/is/", "a/directory/"); - g_assert (xpathisabs (s) == true); + g_assert_true (xpathisabs (s)); s = xpathbuildabs ("this/", ""); - g_assert (xpathisabs (s) == true); + g_assert_true (xpathisabs (s)); s = xpathbuildabs ("./", "this"); - g_assert (xpathisabs (s) == true); + g_assert_true (xpathisabs (s)); s = xpathbuildabs ("/", "this/"); - g_assert (xpathisabs (s) == true); + g_assert_true (xpathisabs (s)); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xpathisabs.cpp b/tests/test-aux-xpathisabs.cpp index 8772bbc37..8a7eddea9 100644 --- a/tests/test-aux-xpathisabs.cpp +++ b/tests/test-aux-xpathisabs.cpp @@ -20,11 +20,11 @@ along with Ginga. If not, see . */ int main (void) { - g_assert (xpathisabs ("this/is/a/directory/") == false); - g_assert (xpathisabs ("this/is/ not a/directory/") == false); - g_assert (xpathisabs ("/this/is/a/directory/") == true); - g_assert (xpathisabs ("./") == false); - g_assert (xpathisabs ("/") == true); - g_assert (xpathisabs ("") == false); + g_assert_false (xpathisabs ("this/is/a/directory/")); + g_assert_false (xpathisabs ("this/is/ not a/directory/")); + g_assert_true (xpathisabs ("/this/is/a/directory/")); + g_assert_false (xpathisabs ("./")); + g_assert_true (xpathisabs ("/")); + g_assert_false (xpathisabs ("")); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xpathmakeabs.cpp b/tests/test-aux-xpathmakeabs.cpp index 94bb1e630..66d0d8e6e 100644 --- a/tests/test-aux-xpathmakeabs.cpp +++ b/tests/test-aux-xpathmakeabs.cpp @@ -23,16 +23,16 @@ main (void) string s; s = xpathmakeabs ("this/is/a/directory/"); - g_assert (xpathisabs (s) == true); + g_assert_true (xpathisabs (s)); s = xpathmakeabs ("this/"); - g_assert (xpathisabs (s) == true); + g_assert_true (xpathisabs (s)); s = xpathmakeabs ("./"); - g_assert (xpathisabs (s) == true); + g_assert_true (xpathisabs (s)); s = xpathmakeabs ("/"); - g_assert (xpathisabs (s) == true); + g_assert_true (xpathisabs (s)); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrcaseeq.cpp b/tests/test-aux-xstrcaseeq.cpp index 959b666b3..029e2a70d 100644 --- a/tests/test-aux-xstrcaseeq.cpp +++ b/tests/test-aux-xstrcaseeq.cpp @@ -20,10 +20,10 @@ along with Ginga. If not, see . */ int main (void) { - g_assert (xstrcaseeq ("", "") == true); - g_assert (xstrcaseeq ("equal", "equal") == true); - g_assert (xstrcaseeq ("equal", "EqUAl") == true); - g_assert (xstrcaseeq ("eq", "equal") == false); - g_assert (xstrcaseeq ("not equal", "not") == false); + g_assert_true (xstrcaseeq ("", "")); + g_assert_true (xstrcaseeq ("equal", "equal")); + g_assert_true (xstrcaseeq ("equal", "EqUAl")); + g_assert_false (xstrcaseeq ("eq", "equal")); + g_assert_false (xstrcaseeq ("not equal", "not")); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrhasprefix.cpp b/tests/test-aux-xstrhasprefix.cpp index 35a449d06..bd043047a 100644 --- a/tests/test-aux-xstrhasprefix.cpp +++ b/tests/test-aux-xstrhasprefix.cpp @@ -20,11 +20,11 @@ along with Ginga. If not, see . */ int main (void) { - g_assert (xstrhasprefix ("", "") == true); - g_assert (xstrhasprefix ("hasprefix", "") == true); - g_assert (xstrhasprefix ("hasprefix", "has") == true); - g_assert (xstrhasprefix ("hasprefix", "hasprefix") == true); - g_assert (xstrhasprefix ("HasPrEfix", "hAs") == false); - g_assert (xstrhasprefix ("", "has") == false); + g_assert_true (xstrhasprefix ("", "")); + g_assert_true (xstrhasprefix ("hasprefix", "")); + g_assert_true (xstrhasprefix ("hasprefix", "has")); + g_assert_true (xstrhasprefix ("hasprefix", "hasprefix")); + g_assert_false (xstrhasprefix ("HasPrEfix", "hAs")); + g_assert_false (xstrhasprefix ("", "has")); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrhassuffix.cpp b/tests/test-aux-xstrhassuffix.cpp index b7c44240b..0bb3d9b4e 100644 --- a/tests/test-aux-xstrhassuffix.cpp +++ b/tests/test-aux-xstrhassuffix.cpp @@ -20,10 +20,10 @@ along with Ginga. If not, see . */ int main (void) { - g_assert (xstrhassuffix ("", "") == true); - g_assert (xstrhassuffix ("hassuffix", "") == true); - g_assert (xstrhassuffix ("hassuffix", "x") == true); - g_assert (xstrhassuffix ("hassuffix", "has") == false); - g_assert (xstrhassuffix ("", "has") == false); + g_assert_true (xstrhassuffix ("", "")); + g_assert_true (xstrhassuffix ("hassuffix", "")); + g_assert_true (xstrhassuffix ("hassuffix", "x")); + g_assert_false (xstrhassuffix ("hassuffix", "has")); + g_assert_false (xstrhassuffix ("", "has")); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrispercent.cpp b/tests/test-aux-xstrispercent.cpp index 827dc5267..a5731bc88 100644 --- a/tests/test-aux-xstrispercent.cpp +++ b/tests/test-aux-xstrispercent.cpp @@ -20,15 +20,15 @@ along with Ginga. If not, see . */ int main (void) { - g_assert (xstrispercent ("") == false); - g_assert (xstrispercent ("%50") == false); - g_assert (xstrispercent ("50") == false); - g_assert (xstrispercent ("50 %") == false); - g_assert (xstrispercent ("a50%") == false); - g_assert (xstrispercent ("50b%") == false); - g_assert (xstrispercent ("c%") == false); + g_assert_false (xstrispercent ("")); + g_assert_false (xstrispercent ("%50")); + g_assert_false (xstrispercent ("50")); + g_assert_false (xstrispercent ("50 %")); + g_assert_false (xstrispercent ("a50%")); + g_assert_false (xstrispercent ("50b%")); + g_assert_false (xstrispercent ("c%")); - g_assert (xstrispercent ("50%") == true); - g_assert (xstrispercent ("1250%") == true); + g_assert_true (xstrispercent ("50%")); + g_assert_true (xstrispercent ("1250%")); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrtodorpercent.cpp b/tests/test-aux-xstrtodorpercent.cpp index 6d37ff940..9b2aac759 100644 --- a/tests/test-aux-xstrtodorpercent.cpp +++ b/tests/test-aux-xstrtodorpercent.cpp @@ -26,22 +26,22 @@ main (void) { bool perc; g_assert (xstrtodorpercent ("", &perc) == 0.); - g_assert (perc == false); + g_assert_false (perc); g_assert (xstrtodorpercent ("0", &perc) == 0.); - g_assert (perc == false); + g_assert_false (perc); g_assert (xstrtodorpercent ("0%", &perc) == 0.); - g_assert (perc == true); + g_assert_true (perc); g_assert (xstrtodorpercent ("50%", &perc) == .5); - g_assert (perc == true); + g_assert_true (perc); g_assert (xstrtodorpercent ("a", &perc) == 0.); - g_assert (perc == false); + g_assert_false (perc); g_assert (xstrtodorpercent ("a%", &perc) == 0.); - g_assert (perc == false); + g_assert_false (perc); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrtoll.cpp b/tests/test-aux-xstrtoll.cpp index 5155865ae..a0ec1ceec 100644 --- a/tests/test-aux-xstrtoll.cpp +++ b/tests/test-aux-xstrtoll.cpp @@ -22,13 +22,13 @@ main (void) { gint64 ip; - g_assert (_xstrtoll ("1", &ip, 10) == true); - g_assert (_xstrtoll (" 1", &ip, 10) == true); - g_assert (_xstrtoll ("50", &ip, 10) == true); - g_assert (_xstrtoll ("1 ", &ip, 10) == true); - g_assert (_xstrtoll ("", &ip, 10) == false); - g_assert (_xstrtoll ("a", &ip, 10) == false); - g_assert (_xstrtoll (" a", &ip, 10) == false); + g_assert_true (_xstrtoll ("1", &ip, 10)); + g_assert_true (_xstrtoll (" 1", &ip, 10)); + g_assert_true (_xstrtoll ("50", &ip, 10)); + g_assert_true (_xstrtoll ("1 ", &ip, 10)); + g_assert_false (_xstrtoll ("", &ip, 10)); + g_assert_false (_xstrtoll ("a", &ip, 10)); + g_assert_false (_xstrtoll (" a", &ip, 10)); exit (EXIT_SUCCESS); } From 488ae0f3be6a21cdd27096c2a568e04018a8c260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Wed, 25 Apr 2018 17:36:10 -0300 Subject: [PATCH 090/169] lib: Fixed wrongly anchor OCCURING #127 * lib/Media.cpp: Likewise * tests/test-Media-anchors-started-from-links.cpp * tests/test-Media-anchors-started-from-ports.cpp --- lib/Media.cpp | 3 ++- tests/test-Media-anchors-started-from-links.cpp | 12 ++++-------- tests/test-Media-anchors-started-from-ports.cpp | 12 ++++-------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/lib/Media.cpp b/lib/Media.cpp index b5f0341b7..fa9d4fcfc 100644 --- a/lib/Media.cpp +++ b/lib/Media.cpp @@ -257,7 +257,8 @@ Media::beforeTransition (Event *evt, Event::Transition transition) { Action act = it->first; Event *evt = act.event; - if (act.transition == Event::START) + if (act.transition == Event::START + && it->second < begin) evt->transition (act.transition); it = _delayed.erase (it); } diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp index caaa452e4..6524942a6 100644 --- a/tests/test-Media-anchors-started-from-links.cpp +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -101,8 +101,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::SLEEPING); g_assert (a2->getState () == Event::OCCURRING); - // TODO: this should SLEEPING - // g_assert (a3->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); // -------------------------------- @@ -114,8 +113,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::OCCURRING); g_assert (a2->getState () == Event::OCCURRING); - // TODO: this should SLEEPING - // g_assert (a3->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); // when advance more 10s, a2 is SLEEPING @@ -124,8 +122,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::OCCURRING); g_assert (a2->getState () == Event::SLEEPING); - // TODO: this should SLEEPING - // g_assert (a3->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::OCCURRING); // when advance more 10s, m1 is SLEEPING and m2 is OCCURRING @@ -337,8 +334,7 @@ main (void) fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - // TODO: this should SLEEPING - // g_assert (a1->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::OCCURRING); g_assert (a2->getState () == Event::OCCURRING); g_assert (a3->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); diff --git a/tests/test-Media-anchors-started-from-ports.cpp b/tests/test-Media-anchors-started-from-ports.cpp index 88bc89089..d74c9f70f 100644 --- a/tests/test-Media-anchors-started-from-ports.cpp +++ b/tests/test-Media-anchors-started-from-ports.cpp @@ -101,8 +101,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::SLEEPING); g_assert (a2->getState () == Event::OCCURRING); - // TODO: this should SLEEPING - // g_assert (a3->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); // -------------------------------- @@ -114,8 +113,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::OCCURRING); g_assert (a2->getState () == Event::OCCURRING); - // TODO: this should SLEEPING - // g_assert (a3->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); // when advance more 10s, a2 is SLEEPING @@ -124,8 +122,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::OCCURRING); g_assert (a2->getState () == Event::SLEEPING); - // TODO: this should SLEEPING - // g_assert (a3->getState () == Event::SLEEPING); + g_assert (a3->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::OCCURRING); // when advance more 10s, m1 is SLEEPING and m2 is OCCURRING @@ -330,8 +327,7 @@ main (void) fmt->sendTick (10 * GINGA_SECOND, 10 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); - // TODO: this should SLEEPING - // g_assert (a1->getState () == Event::SLEEPING); + g_assert (a1->getState () == Event::OCCURRING); g_assert (a2->getState () == Event::OCCURRING); g_assert (a3->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); From 5746ccd18ec966362039925bfa08edf16042486c Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 25 Apr 2018 16:49:47 -0300 Subject: [PATCH 091/169] lib: Refactory ParserState::pushMedia --- lib/Parser.cpp | 106 +++++++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 48 deletions(-) diff --git a/lib/Parser.cpp b/lib/Parser.cpp index 3190e899f..fe4188670 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -540,8 +540,7 @@ static map parser_syntax_table = { nullptr, 0, { "causalConnector" }, - { { "name", ATTR_NONEMPTY_NAME }, - { "type", 0 } } }, + { { "name", ATTR_NONEMPTY_NAME }, { "type", 0 } } }, }, { "compoundCondition", @@ -3845,39 +3844,66 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) string type; string refer; string src; + bool hasType; + bool hasRefer; + bool hasSrc; g_assert (elt->getAttribute ("id", &id)); - if (elt->getAttribute ("type", &type)) + + hasType = elt->getAttribute ("type", &type); + hasRefer = elt->getAttribute ("refer", &refer); + hasSrc = elt->getAttribute ("src", &src); + + if (hasType && hasRefer) + return st->errEltMutuallyExclAttributes (elt->getNode (), "type", + "refer"); + if (hasSrc && hasRefer) + return st->errEltMutuallyExclAttributes (elt->getNode (), "src", + "refer"); + + // case is an already referred Media + if (st->referMapIndex (id, &media)) { - if (unlikely (elt->getAttribute ("refer", &refer))) - { - return st->errEltMutuallyExclAttributes (elt->getNode (), "type", - "refer"); - } - if (type == "application/x-ginga-settings") - { - refer = st->_doc->getSettings ()->getId (); - media = cast (Media *, st->_doc->getObjectByIdOrAlias (refer)); - if (media != nullptr) - goto almost_done; - } + media->setProperty ("uri", src); } - - if (elt->getAttribute ("refer", &refer)) + // case is an MediaSettings + else if (type == "application/x-ginga-settings") + { + refer = st->_doc->getSettings ()->getId (); + media = st->_doc->getSettings (); + media->addAlias (id); + g_assert (st->referMapAdd (id, media)); + } + // case is Media refer instSame + else if (hasRefer) { - if (unlikely (elt->getAttribute ("src", &src))) - { - return st->errEltMutuallyExclAttributes (elt->getNode (), "src", - "refer"); - } - media = cast (Media *, st->_doc->getObjectByIdOrAlias (refer)); + // if referenced Media exist if (media != nullptr) - goto almost_done; + { + media->addAlias (id); + st->referMapAdd (refer, media); + g_assert (st->referMapAdd (id, media)); + } + else + { + // if referenced Media not existing yet, create it + media = new Media (id); + media->setProperty ("uri", src); + media->setProperty ("type", type); + parent = cast (Composition *, st->objStackPeek ()); + g_assert_nonnull (parent); + parent->addChild (media); + + media->addAlias (refer); + st->referMapAdd (refer, media); + g_assert (st->referMapAdd (id, media)); + } } + // case src filled or empty (timer) else { - elt->getAttribute ("src", &src); + // case src filled if (src != "") { // Makes uri based in the main document uri @@ -3892,31 +3918,15 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) xmlFree (s); } - if (st->referMapIndex (id, &media)) - { - media->setProperty ("uri", src); - goto done; - } - } - - media = new Media (id); - media->setProperty ("uri", src); - media->setProperty ("type", type); - - parent = cast (Composition *, st->objStackPeek ()); - g_assert_nonnull (parent); - parent->addChild (media); - -almost_done: - if (refer != "") - { - media->addAlias (id); - media->addAlias (refer); - st->referMapAdd (refer, media); - g_assert (st->referMapAdd (id, media)); + // create new Media + media = new Media (id); + media->setProperty ("uri", src); + media->setProperty ("type", type); + parent = cast (Composition *, st->objStackPeek ()); + g_assert_nonnull (parent); + parent->addChild (media); } -done: st->objStackPush (media); return true; } From 70fbeae654c2dfefd09864301a816a7395bff621 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 24 Apr 2018 12:22:35 -0300 Subject: [PATCH 092/169] lib: Update Object::addAlias to addAlias(const string &alias, Composition * parent) --- lib/Object.cpp | 15 +++++++++------ lib/Object.h | 22 +++++++++++----------- tests/test-Parser-parseBuffer.cpp | 6 +++--- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/lib/Object.cpp b/lib/Object.cpp index 095273daf..fdf437050 100644 --- a/lib/Object.cpp +++ b/lib/Object.cpp @@ -100,9 +100,10 @@ Object::toString () auto it = _aliases.begin (); if (it != _aliases.end ()) { - str += " aliases: " + *it; + str += " aliases: " + (*it).first; while (++it != _aliases.end ()) - str += ", " + *it; + str += ", " + (*it).first + "(at Composition " + + xstrbuild ("%p", (*it).second) + ")"; str += "\n"; } @@ -157,7 +158,7 @@ Object::toString () return str; } -const list * +const list > * Object::getAliases () { return &_aliases; @@ -167,15 +168,17 @@ bool Object::hasAlias (const string &alias) { for (auto curr : _aliases) - if (curr == alias) + if (curr.first == alias) return true; return false; } void -Object::addAlias (const string &alias) +Object::addAlias (const string &alias, Composition * parent) { - tryinsert (alias, _aliases, push_back); + auto alias_pair = make_pair (alias, parent); + // _aliases.push_back (alias_pair); + tryinsert (alias_pair, _aliases, push_back); } const set * diff --git a/lib/Object.h b/lib/Object.h index c6c082319..86d6be76a 100644 --- a/lib/Object.h +++ b/lib/Object.h @@ -43,9 +43,9 @@ class Object virtual string getObjectTypeAsString () = 0; virtual string toString (); - const list *getAliases (); + const list > *getAliases (); bool hasAlias (const string &); - void addAlias (const string &); + void addAlias (const string &, Composition * = nullptr); const set *getEvents (); Event *getEvent (Event::Type, const string &); @@ -106,15 +106,15 @@ class Object virtual bool afterTransition (Event *, Event::Transition) = 0; protected: - string _id; // id - Document *_doc; // parent document - Composition *_parent; // parent object - list _aliases; // aliases - Time _time; // playback time - map _properties; // property map - Event *_lambda; // lambda event - set _events; // all events - list > _delayed; // delayed actions + string _id; // id + Document *_doc; // parent document + Composition *_parent; // parent object + list > _aliases; // aliases + Time _time; // playback time + map _properties; // property map + Event *_lambda; // lambda event + set _events; // all events + list > _delayed; // delayed actions virtual void doStart (); virtual void doStop (); diff --git a/tests/test-Parser-parseBuffer.cpp b/tests/test-Parser-parseBuffer.cpp index a011a81a3..b914789b6 100644 --- a/tests/test-Parser-parseBuffer.cpp +++ b/tests/test-Parser-parseBuffer.cpp @@ -2585,7 +2585,7 @@ main (void) \n\ "); g_assert_nonnull (doc); - g_assert (doc->getRoot ()->getAliases ()->front () == "x"); + g_assert (doc->getRoot ()->getAliases ()->front ().first == "x"); delete doc; PASS (&doc, "Root alias in ", "\ @@ -2596,8 +2596,8 @@ main (void) "); g_assert_nonnull (doc); auto it = doc->getRoot ()->getAliases ()->begin (); - g_assert (*it++ == "x"); - g_assert (*it++ == "y"); + g_assert ((*it++).first == "x"); + g_assert ((*it++).first == "y"); g_assert (it == doc->getRoot ()->getAliases ()->end ()); delete doc; } From d6cb63db08bb21d6d29604f0bc7103735c97b7d2 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 27 Apr 2018 10:19:13 -0300 Subject: [PATCH 093/169] lib: When a referred media trigger, also trigger its refer elements in their contexts --- lib/Document.cpp | 18 ++++++++++++++++++ lib/Parser.cpp | 8 ++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/Document.cpp b/lib/Document.cpp index aa3a5f5d2..e92c3cc68 100644 --- a/lib/Document.cpp +++ b/lib/Document.cpp @@ -296,6 +296,11 @@ Document::evalAction (Action init) evt = act.event; g_assert_nonnull (evt); + TRACE ("next stacked Action: event=%s transtion=%s value=%s", + act.event->getFullId ().c_str (), + Event::getEventTransitionAsString (act.transition).c_str (), + act.value.c_str ()); + evt->setParameter ("duration", act.duration); if (evt->getType () == Event::ATTRIBUTION) evt->setParameter ("value", act.value); @@ -371,6 +376,19 @@ Document::evalAction (Action init) list ret = evalActionInContext (act, ctx_parent); stack.insert (stack.end (), ret.begin (), ret.end ()); } + // If have refer elements, trigger in the contexts + else if (obj->getAliases ()->size ()) + { + for (const auto &alias : *obj->getAliases ()) + { + ctx_parent = cast (Context *, alias.second); + if (ctx_parent) + { + list ret = evalActionInContext (act, ctx_parent); + stack.insert (stack.end (), ret.begin (), ret.end ()); + } + } + } } return n; } diff --git a/lib/Parser.cpp b/lib/Parser.cpp index fe4188670..d2904b15e 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -3871,7 +3871,9 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) { refer = st->_doc->getSettings ()->getId (); media = st->_doc->getSettings (); - media->addAlias (id); + parent = cast (Composition *, st->objStackPeek ()); + g_assert_nonnull (parent); + media->addAlias (id, parent); g_assert (st->referMapAdd (id, media)); } // case is Media refer instSame @@ -3881,7 +3883,9 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) // if referenced Media exist if (media != nullptr) { - media->addAlias (id); + parent = cast (Composition *, st->objStackPeek ()); + g_assert_nonnull (parent); + media->addAlias (id, parent); st->referMapAdd (refer, media); g_assert (st->referMapAdd (id, media)); } From f6709c072011077aca22e4b152c36a22b6eeef18 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 26 Apr 2018 14:38:00 -0300 Subject: [PATCH 094/169] tests: Use more g_assert_cmpint --- tests/test-Ginga-resize.cpp | 8 ++++---- tests/test-Object-addEvent.cpp | 12 ++++++------ tests/test-ParserLua-parseBuffer.cpp | 14 +++++++------- tests/test-Switch-new.cpp | 8 ++++---- tests/test-aux-ginga-parse-list.cpp | 10 +++++----- tests/test-aux-ginga-parse-percent.cpp | 10 +++++----- tests/test-aux-ginga-parse-table.cpp | 6 +++--- tests/test-aux-ginga-parse-time.cpp | 10 +++++----- tests/test-aux-xstrtod.cpp | 8 ++++---- tests/test-aux-xstrtodorpercent.cpp | 12 ++++++------ 10 files changed, 49 insertions(+), 49 deletions(-) diff --git a/tests/test-Ginga-resize.cpp b/tests/test-Ginga-resize.cpp index fe5295826..864d5cdf7 100644 --- a/tests/test-Ginga-resize.cpp +++ b/tests/test-Ginga-resize.cpp @@ -26,14 +26,14 @@ main (void) ginga = Ginga::create (nullptr); g_assert_nonnull (ginga); ginga->setOptionInt ("width", 800); - g_assert (ginga->getOptionInt ("width") == 800); + g_assert_cmpint (ginga->getOptionInt ("width"), ==, 800); ginga->setOptionInt ("height", 600); - g_assert (ginga->getOptionInt ("height") == 600); + g_assert_cmpint (ginga->getOptionInt ("height"), ==, 600); tmp = tests_write_tmp_file (""); g_assert_true (ginga->start (tmp, &errmsg)); ginga->resize (640, 480); - g_assert (ginga->getOptionInt ("width") == 640); - g_assert (ginga->getOptionInt ("height") == 480); + g_assert_cmpint (ginga->getOptionInt ("width"), ==, 640); + g_assert_cmpint (ginga->getOptionInt ("height"), ==, 480); g_remove (tmp.c_str ()); exit (EXIT_SUCCESS); diff --git a/tests/test-Object-addEvent.cpp b/tests/test-Object-addEvent.cpp index 63359e48d..fc3c7a7c3 100644 --- a/tests/test-Object-addEvent.cpp +++ b/tests/test-Object-addEvent.cpp @@ -42,16 +42,16 @@ main (void) evt = obj->getPresentationEvent ("p1"); g_assert_nonnull (evt); evt->getInterval (&begin, &end); - g_assert (begin == 0); - g_assert (end == 0); + g_assert_cmpint (begin, ==, 0); + g_assert_cmpint (end, ==, 0); g_assert_null (obj->getPresentationEvent ("p2")); obj->addPresentationEvent ("p2", 1, 10); evt = obj->getPresentationEvent ("p2"); g_assert_nonnull (evt); evt->getInterval (&begin, &end); - g_assert (begin == 1); - g_assert (end == 10); + g_assert_cmpint (begin, ==, 1); + g_assert_cmpint (end, ==, 10); g_assert_null (obj->getPresentationEvent ("p3")); obj->addPresentationEvent ("p3", GINGA_TIME_NONE, GINGA_TIME_NONE); @@ -59,8 +59,8 @@ main (void) g_assert_null (obj->getPresentationEventByLabel ("label1")); g_assert_nonnull (evt); evt->getInterval (&begin, &end); - g_assert (begin == GINGA_TIME_NONE); - g_assert (end == GINGA_TIME_NONE); + g_assert_cmpint (begin, ==, GINGA_TIME_NONE); + g_assert_cmpint (end, ==, GINGA_TIME_NONE); g_assert_null (obj->getPresentationEvent ("p4")); obj->addPresentationEvent ("p4", "label1"); diff --git a/tests/test-ParserLua-parseBuffer.cpp b/tests/test-ParserLua-parseBuffer.cpp index 469b230bf..8963353c2 100644 --- a/tests/test-ParserLua-parseBuffer.cpp +++ b/tests/test-ParserLua-parseBuffer.cpp @@ -68,7 +68,7 @@ return ncl"); g_assert_nonnull (doc); g_assert_cmpint (doc->getObjects ()->size (), ==, 5); - g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); g_assert_cmpint (doc->getContexts ()->size (), ==, 2); Context *body = cast (Context *, doc->getRoot ()); @@ -115,7 +115,7 @@ return ncl"); g_assert_nonnull (doc); g_assert_cmpint (doc->getObjects ()->size (), ==, 7); - g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); g_assert_cmpint (doc->getContexts ()->size (), ==, 2); g_assert_cmpint (doc->getSwitches ()->size (), ==, 2); @@ -176,7 +176,7 @@ return ncl"); g_assert_nonnull (doc); g_assert_cmpint (doc->getObjects ()->size (), ==, 4); - g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *body = cast (Context *, doc->getRoot ()); @@ -219,7 +219,7 @@ return ncl"); g_assert_nonnull (doc); g_assert_cmpint (doc->getObjects ()->size (), ==, 3); - g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *body = cast (Context *, doc->getRoot ()); @@ -257,7 +257,7 @@ return ncl"); g_assert_nonnull (doc); g_assert_cmpint (doc->getObjects ()->size (), ==, 3); - g_assert_cmpint (doc->getMedias ()->size (), ==, 2); + g_assert_cmpint (doc->getMedias ()->size (), ==, 2); g_assert_cmpint (doc->getContexts ()->size (), ==, 1); Context *body = cast (Context *, doc->getRoot ()); @@ -298,7 +298,7 @@ return ncl"); g_assert_nonnull (doc); g_assert_cmpint (doc->getObjects ()->size (), ==, 5); - g_assert_cmpint (doc->getMedias ()->size (), ==, 3); + g_assert_cmpint (doc->getMedias ()->size (), ==, 3); g_assert_cmpint (doc->getContexts ()->size (), ==, 1); g_assert_cmpint (doc->getSwitches ()->size (), ==, 1); @@ -312,7 +312,7 @@ return ncl"); Event *s1_lambda = s1->getLambda (); g_assert_nonnull (s1_lambda); - g_assert (s1->getRules ()->size () == 1); + g_assert_cmpint (s1->getRules ()->size (), ==, 1); Media *m1 = cast (Media *, s1->getChildById ("m1")); g_assert_nonnull (m1); diff --git a/tests/test-Switch-new.cpp b/tests/test-Switch-new.cpp index d47d00acc..5fb76298d 100644 --- a/tests/test-Switch-new.cpp +++ b/tests/test-Switch-new.cpp @@ -29,8 +29,8 @@ main (void) g_assert_null (s->getParent ()); g_assert (s->getObjectTypeAsString () == "Switch"); g_assert (s->toString () != ""); - g_assert (s->getAliases ()->size () == 0); - g_assert (s->getEvents ()->size () == 1); + g_assert_cmpint (s->getAliases ()->size (), ==, 0); + g_assert_cmpint (s->getEvents ()->size (), ==, 1); g_assert_nonnull (s->getLambda ()); g_assert_false (s->isOccurring ()); g_assert_false (s->isPaused ()); @@ -39,10 +39,10 @@ main (void) g_assert (!s->toString ().empty ()); // Composition-only. - g_assert (s->getChildren ()->size () == 0); + g_assert_cmpint (s->getChildren ()->size (), ==, 0); // Switch-only. - g_assert (s->getRules ()->size () == 0); + g_assert_cmpint (s->getRules ()->size (), ==, 0); delete s; diff --git a/tests/test-aux-ginga-parse-list.cpp b/tests/test-aux-ginga-parse-list.cpp index 35c626a48..9a07e8b48 100644 --- a/tests/test-aux-ginga-parse-list.cpp +++ b/tests/test-aux-ginga-parse-list.cpp @@ -27,7 +27,7 @@ main (void) g_assert (!ginga::try_parse_list ("a,b,c,d", ',', 1, 2, NULL)); lst = ginga::parse_list ("a,b,c", ',', 0, 3); - g_assert (lst.size () == 3); + g_assert_cmpint (lst.size (), ==, 3); auto it = lst.begin (); g_assert (*it++ == "a"); g_assert (*it++ == "b"); @@ -35,16 +35,16 @@ main (void) g_assert (it == lst.end ()); lst = ginga::parse_list ("", ';', 0, 3); - g_assert (lst.size () == 0); + g_assert_cmpint (lst.size (), ==, 0); lst = ginga::parse_list ("x", ';', 0, 3); - g_assert (lst.size () == 1); + g_assert_cmpint (lst.size (), ==, 1); it = lst.begin (); g_assert (*it++ == "x"); g_assert (it == lst.end ()); lst = ginga::parse_list ("x;y;z", ';', 2, 5); - g_assert (lst.size () == 3); + g_assert_cmpint (lst.size (), ==, 3); it = lst.begin (); g_assert (*it++ == "x"); g_assert (*it++ == "y"); @@ -52,7 +52,7 @@ main (void) g_assert (it == lst.end ()); lst = ginga::parse_list (" aa , bb , cc , dd", ',', 0, 10); - g_assert (lst.size () == 4); + g_assert_cmpint (lst.size (), ==, 4); it = lst.begin (); g_assert (*it++ == "aa"); g_assert (*it++ == "bb"); diff --git a/tests/test-aux-ginga-parse-percent.cpp b/tests/test-aux-ginga-parse-percent.cpp index 1800df68c..087f98b7e 100644 --- a/tests/test-aux-ginga-parse-percent.cpp +++ b/tests/test-aux-ginga-parse-percent.cpp @@ -20,10 +20,10 @@ along with Ginga. If not, see . */ int main (void) { - g_assert (ginga::parse_percent ("0", 100, 0, 255) == 0); - g_assert (ginga::parse_percent ("0%", 100, 0, 255) == 0); - g_assert (ginga::parse_percent ("15", 100, 0, 255) == 15); - g_assert (ginga::parse_percent ("15%", 200, 0, 255) == 30); - g_assert (ginga::parse_percent ("15%", 200, 0, 10) == 10); + g_assert_cmpint (ginga::parse_percent ("0", 100, 0, 255), ==, 0); + g_assert_cmpint (ginga::parse_percent ("0%", 100, 0, 255), ==, 0); + g_assert_cmpint (ginga::parse_percent ("15", 100, 0, 255), ==, 15); + g_assert_cmpint (ginga::parse_percent ("15%", 200, 0, 255), ==, 30); + g_assert_cmpint (ginga::parse_percent ("15%", 200, 0, 10), ==, 10); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-ginga-parse-table.cpp b/tests/test-aux-ginga-parse-table.cpp index 9d7e9488c..a64c6252e 100644 --- a/tests/test-aux-ginga-parse-table.cpp +++ b/tests/test-aux-ginga-parse-table.cpp @@ -27,16 +27,16 @@ main (void) g_assert (!ginga::try_parse_table ("{a=x}", NULL)); tab = ginga::parse_table ("{a='1', b='2' , c='3' }"); - g_assert (tab.size () == 3); + g_assert_cmpint (tab.size (), ==, 3); g_assert (tab["a"] == "1"); g_assert (tab["b"] == "2"); g_assert (tab["c"] == "3"); tab = ginga::parse_table ("{}"); - g_assert (tab.size () == 0); + g_assert_cmpint (tab.size (), ==, 0); tab = ginga::parse_table ("{a=' x '}"); - g_assert (tab.size () == 1); + g_assert_cmpint (tab.size (), ==, 1); g_assert (tab["a"] == " x "); exit (EXIT_SUCCESS); diff --git a/tests/test-aux-ginga-parse-time.cpp b/tests/test-aux-ginga-parse-time.cpp index 6289677ae..6845cbacf 100644 --- a/tests/test-aux-ginga-parse-time.cpp +++ b/tests/test-aux-ginga-parse-time.cpp @@ -21,10 +21,10 @@ int main (void) { g_assert (!ginga::try_parse_time ("*** invalid ***", NULL)); - g_assert (ginga::parse_time ("0") == 0 * GINGA_SECOND); - g_assert (ginga::parse_time ("1s") == 1 * GINGA_SECOND); - g_assert (ginga::parse_time ("00:00:50") == 50 * GINGA_SECOND); - g_assert (ginga::parse_time ("00:01:00") == 60 * GINGA_SECOND); - g_assert (ginga::parse_time ("01:00:00") == 3600 * GINGA_SECOND); + g_assert_cmpint (ginga::parse_time ("0"), ==, 0 * GINGA_SECOND); + g_assert_cmpint (ginga::parse_time ("1s"), ==, 1 * GINGA_SECOND); + g_assert_cmpint (ginga::parse_time ("00:00:50"), ==, 50 * GINGA_SECOND); + g_assert_cmpint (ginga::parse_time ("00:01:00"), ==, 60 * GINGA_SECOND); + g_assert_cmpint (ginga::parse_time ("01:00:00"), ==, 3600 * GINGA_SECOND); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrtod.cpp b/tests/test-aux-xstrtod.cpp index 786481ce5..ee08c2ff3 100644 --- a/tests/test-aux-xstrtod.cpp +++ b/tests/test-aux-xstrtod.cpp @@ -24,9 +24,9 @@ GINGA_PRAGMA_DIAG_IGNORE (-Wfloat-equal) int main (void) { - g_assert (xstrtod ("1") == 1.); - g_assert (xstrtod (" 1") == 1.); - g_assert (xstrtod ("50") == 50.); - g_assert (xstrtod ("1 ") == 1.); + g_assert_cmpint (xstrtod ("1"), ==, 1.); + g_assert_cmpint (xstrtod (" 1"), ==, 1.); + g_assert_cmpint (xstrtod ("50"), ==, 50.); + g_assert_cmpint (xstrtod ("1 "), ==, 1.); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrtodorpercent.cpp b/tests/test-aux-xstrtodorpercent.cpp index 9b2aac759..70d469028 100644 --- a/tests/test-aux-xstrtodorpercent.cpp +++ b/tests/test-aux-xstrtodorpercent.cpp @@ -25,22 +25,22 @@ int main (void) { bool perc; - g_assert (xstrtodorpercent ("", &perc) == 0.); + g_assert_cmpint (xstrtodorpercent ("", &perc), ==, 0.); g_assert_false (perc); - g_assert (xstrtodorpercent ("0", &perc) == 0.); + g_assert_cmpint (xstrtodorpercent ("0", &perc), ==, 0.); g_assert_false (perc); - g_assert (xstrtodorpercent ("0%", &perc) == 0.); + g_assert_cmpint (xstrtodorpercent ("0%", &perc), ==, 0.); g_assert_true (perc); - g_assert (xstrtodorpercent ("50%", &perc) == .5); + g_assert_cmpint (xstrtodorpercent ("50%", &perc), ==, .5); g_assert_true (perc); - g_assert (xstrtodorpercent ("a", &perc) == 0.); + g_assert_cmpint (xstrtodorpercent ("a", &perc), ==, 0.); g_assert_false (perc); - g_assert (xstrtodorpercent ("a%", &perc) == 0.); + g_assert_cmpint (xstrtodorpercent ("a%", &perc), ==, 0.); g_assert_false (perc); exit (EXIT_SUCCESS); From 9a342975d410b0c9eec96ddda344d856bb0666aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Fri, 27 Apr 2018 15:38:57 -0300 Subject: [PATCH 095/169] test: Adding test video natural end. * tests-ncl/test-video-natural-end.ncl --- tests-ncl/test-video-natural-end.ncl | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests-ncl/test-video-natural-end.ncl diff --git a/tests-ncl/test-video-natural-end.ncl b/tests-ncl/test-video-natural-end.ncl new file mode 100644 index 000000000..99c39f2a0 --- /dev/null +++ b/tests-ncl/test-video-natural-end.ncl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6d1dd96dabff16f3ddd5846bd2f8381fa2bf59dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Fri, 27 Apr 2018 16:13:19 -0300 Subject: [PATCH 096/169] tests: Fixed use of anchor with end after media content duration #113 * tests/test-Media-anchors-started-from-links.cpp: Likewise * tests/test-Media-anchors-started-from-ports.cpp: Likewise --- tests/test-Media-anchors-started-from-links.cpp | 4 ++-- tests/test-Media-anchors-started-from-ports.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp index 6524942a6..488977582 100644 --- a/tests/test-Media-anchors-started-from-links.cpp +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -699,12 +699,12 @@ main (void) g_assert (m2_lambda->getState () == Event::SLEEPING); // when advance 5, a2 is OCCURRING - fmt->sendTick (5 * GINGA_SECOND, 5 * GINGA_SECOND, 0); + fmt->sendTick (6 * GINGA_SECOND, 6 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::SLEEPING); g_assert (a2->getState () == Event::SLEEPING); // TODO: this should SLEEPING - // g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; diff --git a/tests/test-Media-anchors-started-from-ports.cpp b/tests/test-Media-anchors-started-from-ports.cpp index d74c9f70f..d5dcf4d7c 100644 --- a/tests/test-Media-anchors-started-from-ports.cpp +++ b/tests/test-Media-anchors-started-from-ports.cpp @@ -700,12 +700,12 @@ main (void) g_assert (m2_lambda->getState () == Event::SLEEPING); // when advance 5, a2 is OCCURRING - fmt->sendTick (5 * GINGA_SECOND, 5 * GINGA_SECOND, 0); + fmt->sendTick (6 * GINGA_SECOND, 6 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::SLEEPING); g_assert (a2->getState () == Event::SLEEPING); // TODO: this should SLEEPING - // g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::OCCURRING); delete fmt; From 5b20aaaf646e829a725eb6809f933786037e669b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Fri, 27 Apr 2018 16:31:27 -0300 Subject: [PATCH 097/169] tests: decreasing margin of error on tick over media * tests/test-Media-anchors-started-from-links.cpp: Likewise * tests/test-Media-anchors-started-from-ports.cpp: Likewise --- tests/test-Media-anchors-started-from-links.cpp | 4 ++-- tests/test-Media-anchors-started-from-ports.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp index 488977582..5e8dd37d2 100644 --- a/tests/test-Media-anchors-started-from-links.cpp +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -698,8 +698,8 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // when advance 5, a2 is OCCURRING - fmt->sendTick (6 * GINGA_SECOND, 6 * GINGA_SECOND, 0); + // when advance 5.02, a2 is OCCURRING + fmt->sendTick (5.02 * GINGA_SECOND, 5.02 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::SLEEPING); g_assert (a2->getState () == Event::SLEEPING); diff --git a/tests/test-Media-anchors-started-from-ports.cpp b/tests/test-Media-anchors-started-from-ports.cpp index d5dcf4d7c..2c401c56c 100644 --- a/tests/test-Media-anchors-started-from-ports.cpp +++ b/tests/test-Media-anchors-started-from-ports.cpp @@ -699,8 +699,8 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // when advance 5, a2 is OCCURRING - fmt->sendTick (6 * GINGA_SECOND, 6 * GINGA_SECOND, 0); + // when advance 5.02, a2 is OCCURRING + fmt->sendTick (5.02 * GINGA_SECOND, 5.02 * GINGA_SECOND, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (a1->getState () == Event::SLEEPING); g_assert (a2->getState () == Event::SLEEPING); From 513d68db9b5bb70f5f38e6ad358dddcc67a51e60 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 27 Apr 2018 15:25:07 -0300 Subject: [PATCH 098/169] tests: Improve test-Context-transition-selection --- tests/test-Context-transition-attribution.cpp | 8 +- .../test-Context-transition-presentation.cpp | 160 ++++++++++++------ tests/test-Context-transition-selection.cpp | 133 +++++++++++++++ tests/tests.h | 18 +- 4 files changed, 264 insertions(+), 55 deletions(-) diff --git a/tests/test-Context-transition-attribution.cpp b/tests/test-Context-transition-attribution.cpp index ccd03f4fb..ebaa41c5a 100644 --- a/tests/test-Context-transition-attribution.cpp +++ b/tests/test-Context-transition-attribution.cpp @@ -34,10 +34,12 @@ main (void) // START prop from state SLEEPING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // START AttributionEvent is done and return true g_assert_true (c1_prop->transition (Event::START)); @@ -48,6 +50,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); g_assert (c1_prop->getState () == Event::OCCURRING); + g_assert (c1_sel->getState () == Event::SLEEPING); // when advance time AttributionEvent is SLEEPING fmt->sendTick (0, 0, 0); @@ -56,6 +59,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); delete fmt; } diff --git a/tests/test-Context-transition-presentation.cpp b/tests/test-Context-transition-presentation.cpp index 280746864..8484d55bd 100644 --- a/tests/test-Context-transition-presentation.cpp +++ b/tests/test-Context-transition-presentation.cpp @@ -23,10 +23,12 @@ main (void) // ABORT lambda from state OCCURRING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // ABORT is done and return true g_assert_true (c1_lambda->transition (Event::ABORT)); @@ -37,6 +39,8 @@ main (void) g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); delete fmt; } @@ -44,10 +48,12 @@ main (void) // ABORT lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); @@ -55,9 +61,10 @@ main (void) // after PAUSE, c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - g_assert (c1_prop->getState () == Event::SLEEPING); // ABORT is done and return true g_assert_true (c1_lambda->transition (Event::ABORT)); @@ -66,6 +73,7 @@ main (void) g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); @@ -75,10 +83,12 @@ main (void) // ABORT lambda from state SLEEPING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); @@ -86,9 +96,10 @@ main (void) // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); // ABORT is not done and return false g_assert_false (c1_lambda->transition (Event::ABORT)); @@ -97,6 +108,7 @@ main (void) g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); @@ -106,10 +118,12 @@ main (void) // PAUSE lambda from state OCCURRING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); @@ -117,9 +131,10 @@ main (void) // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -127,28 +142,32 @@ main (void) // PAUSE lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - g_assert (c1_prop->getState () == Event::SLEEPING); // PAUSE is not done and return false g_assert_false (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are still PAUSED g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -157,10 +176,12 @@ main (void) { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); @@ -168,9 +189,10 @@ main (void) // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); // PAUSE is not done and return false g_assert_false (c1_lambda->transition (Event::PAUSE)); @@ -178,9 +200,10 @@ main (void) // after PAUSE c1_lambda, m1_lambda and m2_lambda still SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -188,10 +211,12 @@ main (void) // RESUME lambda from state OCCURRING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // RESUME is done and return true g_assert_false (c1_lambda->transition (Event::RESUME)); @@ -201,6 +226,7 @@ main (void) g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); @@ -210,10 +236,12 @@ main (void) // RESUME lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); @@ -221,9 +249,10 @@ main (void) // after PAUSE, anchors events go to PAUSED // and properties events are SLEEPING g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - g_assert (c1_prop->getState () == Event::SLEEPING); // RESUME is done and return true g_assert_true (c1_lambda->transition (Event::RESUME)); @@ -231,9 +260,10 @@ main (void) // after RESUME, anchors events go to OCCURRING // and properties events are SLEEPING g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -241,10 +271,12 @@ main (void) // RESUME lambda from state SLEEPING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); @@ -252,9 +284,10 @@ main (void) // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); // RESUME is not done and return false g_assert_false (c1_lambda->transition (Event::RESUME)); @@ -262,9 +295,10 @@ main (void) // after PAUSE c1_lambda, m1_lambda and m2_lambda still SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -272,10 +306,12 @@ main (void) // START lambda from state OCCURRING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // START is not done and return false g_assert_false (c1_lambda->transition (Event::START)); @@ -287,6 +323,7 @@ main (void) g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); delete fmt; } @@ -294,19 +331,22 @@ main (void) // START lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - g_assert (c1_prop->getState () == Event::SLEEPING); // START is done and return true g_assert_true (c1_lambda->transition (Event::START)); @@ -315,16 +355,18 @@ main (void) // are OCCURRING, and its properties are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - g_assert (c1_prop->getState () == Event::SLEEPING); fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -332,10 +374,12 @@ main (void) // START lambda from state SLEEPING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // STOP is done and return true g_assert (c1_lambda->transition (Event::STOP)); @@ -343,26 +387,29 @@ main (void) // after STOP, c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); // START is done and return true g_assert_true (c1_lambda->transition (Event::START)); // after START, c1_lambda is SLEEPING g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED // are OCCURRING, and its properties are SLEEPING fmt->sendTick (0, 0, 0); g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::OCCURRING); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -370,10 +417,12 @@ main (void) // STOP c1_lambda from state OCCURRING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); @@ -384,6 +433,7 @@ main (void) g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); delete fmt; } @@ -391,19 +441,22 @@ main (void) // STOP c1_lambda from state PAUSED { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // PAUSE is done and return true g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED g_assert (c1_lambda->getState () == Event::PAUSED); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - g_assert (c1_prop->getState () == Event::SLEEPING); // STOP is done and return true g_assert_true (c1_lambda->transition (Event::STOP)); @@ -411,9 +464,10 @@ main (void) // after STOP c1_lambda, m1_lambda and m2_lambda are still SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } @@ -421,10 +475,12 @@ main (void) // STOP c1_lambda from state SLEEPING { Formatter *fmt; - Event *body_lambda, *c1_lambda, *c1_prop, *m1_lambda, *m2_lambda; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; tests_create_document_with_context_and_start ( - &fmt, &body_lambda, &c1_lambda, &c1_prop, &m1_lambda, &m2_lambda); + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); // STOP is done and return true g_assert (c1_lambda->transition (Event::STOP)); @@ -432,9 +488,10 @@ main (void) // after STOP c1_lambda, m1_lambda and m2_lambda SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); // STOP is not done and return false g_assert_false (c1_lambda->transition (Event::STOP)); @@ -442,9 +499,10 @@ main (void) // after STOP c1_lambda, m1_lambda and m2_lambda still SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::SLEEPING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - g_assert (c1_prop->getState () == Event::SLEEPING); delete fmt; } diff --git a/tests/test-Context-transition-selection.cpp b/tests/test-Context-transition-selection.cpp index 375f59f3e..9e844e279 100644 --- a/tests/test-Context-transition-selection.cpp +++ b/tests/test-Context-transition-selection.cpp @@ -20,5 +20,138 @@ along with Ginga. If not, see . */ int main (void) { + // ABORT selection from state OCCURRING + { + // not applicable + } // ABORT selection from state PAUSED + + { + // not applicable + } // ABORT selection from state SLEEPING + + { + Formatter *fmt; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; + + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); + + // ABORT is not done and return false + g_assert_false (c1_sel->transition (Event::ABORT)); + + // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + + // PAUSE selection from state OCCURRING + { + // not applicable + } + + // PAUSE selection from state PAUSED + { + // not applicable + } + + // PAUSE selection from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; + + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); + + // PAUSE is not done and return false + g_assert_false (c1_sel->transition (Event::PAUSE)); + + // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + // START selection from state OCCURRING + { + // not applicable + } + + // START selection from state PAUSED + { + // not applicable + } + + // START selection from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; + + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); + + // START is not done and return false + g_assert_false (c1_sel->transition (Event::START)); + + // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP selection from state OCCURRING + // STOP selection from state PAUSED + // STOP selection from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, + *m2_lambda; + + tests_create_document_with_context_and_start ( + &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, + &m2_lambda); + + // START is not done and return false + g_assert_false (c1_sel->transition (Event::STOP)); + + // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED + // are OCCURRING, and its properties are SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (c1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + g_assert (c1_prop->getState () == Event::SLEEPING); + g_assert (c1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + exit (EXIT_SUCCESS); } diff --git a/tests/tests.h b/tests/tests.h index c131557e2..f428db318 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -201,7 +201,7 @@ tests_create_document_with_media_and_start (Formatter **fmt, static G_GNUC_UNUSED void tests_create_document_with_context_and_start ( Formatter **fmt, Event **body_lambda, Event **c1_lambda, - Event **c1_prop, Event **m1_lambda, Event **m2_lambda) + Event **c1_prop, Event **c1_sel, Event **m1_lambda, Event **m2_lambda) { Document *doc; Context *body, *c1; @@ -209,7 +209,15 @@ tests_create_document_with_context_and_start ( tests_parse_and_start (fmt, &doc, "\ \n\ -\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ \n\ \n\ \n\ @@ -218,6 +226,10 @@ tests_create_document_with_context_and_start ( \n\ \n\ \n\ + \n\ + \n\ + \n\ + \n\ \n\ "); @@ -232,6 +244,8 @@ tests_create_document_with_context_and_start ( g_assert_nonnull (c1_lambda); *c1_prop = c1->getAttributionEvent ("p1"); g_assert_nonnull (c1_prop); + *c1_sel = c1->getSelectionEvent (""); + g_assert_nonnull (*c1_sel); m1 = cast (Media *, c1->getChildById ("m1")); g_assert_nonnull (m1); From a8524d47b720b163c23c0e5ecfdcc8a1a6aed4ba Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 27 Apr 2018 17:35:11 -0300 Subject: [PATCH 099/169] tests: Add test-Object-getTime and test-Object-sendKey --- .gitignore | 2 ++ tests/Makefile.am | 6 +++++ tests/test-Object-addAlias.cpp | 3 +-- tests/test-Object-addEvent.cpp | 2 +- tests/test-Object-getTime.cpp | 43 ++++++++++++++++++++++++++++++++++ tests/test-Object-sendKey.cpp | 39 ++++++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 tests/test-Object-getTime.cpp create mode 100644 tests/test-Object-sendKey.cpp diff --git a/.gitignore b/.gitignore index 2d1f60beb..13a0686ef 100644 --- a/.gitignore +++ b/.gitignore @@ -162,6 +162,8 @@ /tests/test-MediaSettings-instances /tests/test-MediaSettings-new /tests/test-Siggen-new +/tests/test-Object-getTime +/tests/test-Object-sendKey /tests/test-Object-addAlias /tests/test-Object-addEvent /tests/test-Parser-parseBuffer diff --git a/tests/Makefile.am b/tests/Makefile.am index 79d42a5d6..795f0bf5d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -226,6 +226,12 @@ test_Context_ports_started_from_links_SOURCES=\ test-Context-ports-started-from-links.cpp # lib/Object.h ------------------------------------------------------------- +progs+= test-Object-getTime +test_Object_getTime_SOURCES= test-Object-getTime.cpp + +progs+= test-Object-sendKey +test_Object_sendKey_SOURCES= test-Object-sendKey.cpp + progs+= test-Object-addAlias test_Object_addAlias_SOURCES= test-Object-addAlias.cpp diff --git a/tests/test-Object-addAlias.cpp b/tests/test-Object-addAlias.cpp index e87a6feea..d17b22c97 100644 --- a/tests/test-Object-addAlias.cpp +++ b/tests/test-Object-addAlias.cpp @@ -23,7 +23,7 @@ main (void) list objs; objs.push_back (new Media ("m")); - objs.push_back (new MediaSettings ("m")); + objs.push_back (new MediaSettings ("stgs")); objs.push_back (new Context ("c")); objs.push_back (new Switch ("s")); @@ -48,7 +48,6 @@ main (void) obj->addAlias ("a2"); obj->addAlias ("a3"); g_assert_cmpint (obj->getAliases ()->size (), ==, 3); - g_assert (!obj->toString ().empty ()); delete obj; } diff --git a/tests/test-Object-addEvent.cpp b/tests/test-Object-addEvent.cpp index fc3c7a7c3..421dc2f16 100644 --- a/tests/test-Object-addEvent.cpp +++ b/tests/test-Object-addEvent.cpp @@ -23,7 +23,7 @@ main (void) list objs; objs.push_back (new Media ("m")); - objs.push_back (new MediaSettings ("m")); + objs.push_back (new MediaSettings ("stgs")); objs.push_back (new Context ("c")); objs.push_back (new Switch ("s")); diff --git a/tests/test-Object-getTime.cpp b/tests/test-Object-getTime.cpp new file mode 100644 index 000000000..4f29c4896 --- /dev/null +++ b/tests/test-Object-getTime.cpp @@ -0,0 +1,43 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + list objs; + + objs.push_back (new Media ("m")); + objs.push_back (new MediaSettings ("stgs")); + objs.push_back (new Context ("c")); + objs.push_back (new Switch ("s")); + + for (auto obj : objs) + { + g_assert_cmpint (obj->getTime (), ==, GINGA_TIME_NONE); + + // only advance time after a Object::doStart, which + // is done when start @lambada + obj->sendTick (1 * GINGA_SECOND, 1 * GINGA_SECOND, 0); + g_assert_cmpint (obj->getTime (), ==, GINGA_TIME_NONE); + + delete obj; + } + + exit (EXIT_SUCCESS); +} diff --git a/tests/test-Object-sendKey.cpp b/tests/test-Object-sendKey.cpp new file mode 100644 index 000000000..2bd072e00 --- /dev/null +++ b/tests/test-Object-sendKey.cpp @@ -0,0 +1,39 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + vector objs; + + objs.push_back (new Media ("m")); + objs.push_back (new MediaSettings ("stgs")); + objs.push_back (new Context ("c")); + objs.push_back (new Switch ("s")); + + for (auto obj : objs) + { + for (int j = 0; j < samples_keys.size (); j++) + { + obj->sendKey (samples_keys[j], true); + } + delete obj; + } + exit (EXIT_SUCCESS); +} From 57b035228f643b41f32d091c79076bb5d09f0f92 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 27 Apr 2018 18:30:28 -0300 Subject: [PATCH 100/169] tests: Refactory test-Context-transition-selection test-Media-transition-selection --- tests/test-Context-transition-selection.cpp | 28 +++++--- tests/test-Media-transition-selection.cpp | 78 +++++++++++++++++++++ 2 files changed, 95 insertions(+), 11 deletions(-) diff --git a/tests/test-Context-transition-selection.cpp b/tests/test-Context-transition-selection.cpp index 9e844e279..90b15bcb3 100644 --- a/tests/test-Context-transition-selection.cpp +++ b/tests/test-Context-transition-selection.cpp @@ -23,12 +23,14 @@ main (void) // ABORT selection from state OCCURRING { // not applicable - } // ABORT selection from state PAUSED + } + // ABORT selection from state PAUSED { // not applicable - } // ABORT selection from state SLEEPING + } + // ABORT selection from state SLEEPING { Formatter *fmt; Event *body_lambda, *c1_lambda, *c1_prop, *c1_sel, *m1_lambda, @@ -41,8 +43,7 @@ main (void) // ABORT is not done and return false g_assert_false (c1_sel->transition (Event::ABORT)); - // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED - // are OCCURRING, and its properties are SLEEPING + // after advance time, c1_sel is SLEEPING fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); @@ -77,8 +78,7 @@ main (void) // PAUSE is not done and return false g_assert_false (c1_sel->transition (Event::PAUSE)); - // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED - // are OCCURRING, and its properties are SLEEPING + // after advance time, c1_sel is SLEEPING fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); @@ -112,8 +112,7 @@ main (void) // START is not done and return false g_assert_false (c1_sel->transition (Event::START)); - // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED - // are OCCURRING, and its properties are SLEEPING + // after advance time, c1_sel is SLEEPING fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); @@ -126,7 +125,15 @@ main (void) } // STOP selection from state OCCURRING + { + // not applicable + } + // STOP selection from state PAUSED + { + // not applicable + } + // STOP selection from state SLEEPING { Formatter *fmt; @@ -137,11 +144,10 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // START is not done and return false + // STOP is not done and return false g_assert_false (c1_sel->transition (Event::STOP)); - // after advance time, c1_lambda, m1_lambda and m2_lambda are PAUSED - // are OCCURRING, and its properties are SLEEPING + // after advance time, c1_sel is SLEEPING fmt->sendTick (0, 0, 0); g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (c1_lambda->getState () == Event::OCCURRING); diff --git a/tests/test-Media-transition-selection.cpp b/tests/test-Media-transition-selection.cpp index 06bdbc6cf..42d3cae58 100644 --- a/tests/test-Media-transition-selection.cpp +++ b/tests/test-Media-transition-selection.cpp @@ -23,6 +23,29 @@ main (void) // ABORT selection from state OCCURRING // ABORT selection from state PAUSED // ABORT selection from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, + *m1_sel; + + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, + &m1_sel); + + // ABORT is not done and return true + g_assert_false (m1_sel->transition (Event::ABORT)); + + // when advance time, m1_sel is SLEEPING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () == Event::SLEEPING); + + delete fmt; + } // PAUSE selection from state OCCURRING // PAUSE selection from state PAUSED @@ -99,8 +122,63 @@ main (void) } // STOP selection from state OCCURRING + { + Formatter *fmt; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, + *m1_sel; + + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, + &m1_sel); + + // START is done + g_assert (m1_sel->transition (Event::START)); + + // after START, m1_sel is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () == Event::OCCURRING); + + // STOP is done + g_assert (m1_sel->transition (Event::STOP)); + + // after START, m1_sel is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () == Event::SLEEPING); + + delete fmt; + } // STOP selection from state PAUSED // STOP selection from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, + *m1_sel; + + tests_create_document_with_media_and_start ( + &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, + &m1_sel); + + // STOP is not done + g_assert_false (m1_sel->transition (Event::STOP)); + + // after START, m1_sel is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_label->getState () == Event::SLEEPING); + g_assert (m1_prop->getState () == Event::SLEEPING); + g_assert (m1_sel->getState () == Event::SLEEPING); + + delete fmt; + } exit (EXIT_SUCCESS); } From 6b0d644ce6f8bde631c470a1d51a452cda7808ca Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 27 Apr 2018 18:50:33 -0300 Subject: [PATCH 101/169] tests: Refactory test-Switch-transition-presentation test-Switch-transition-selection --- tests/test-Switch-transition-presentation.cpp | 40 +++++- tests/test-Switch-transition-selection.cpp | 117 ++++++++++++++++++ tests/tests.h | 8 +- 3 files changed, 156 insertions(+), 9 deletions(-) diff --git a/tests/test-Switch-transition-presentation.cpp b/tests/test-Switch-transition-presentation.cpp index ed6998efd..6b002c005 100644 --- a/tests/test-Switch-transition-presentation.cpp +++ b/tests/test-Switch-transition-presentation.cpp @@ -36,7 +36,7 @@ main (void) g_assert_cmpint (swt1_lambda->getState (), ==, Event::SLEEPING); g_assert_cmpint (m1_lambda->getState (), ==, Event::SLEEPING); g_assert_cmpint (m2_lambda->getState (), ==, Event::SLEEPING); - // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); delete fmt; } @@ -60,7 +60,7 @@ main (void) g_assert (swt1_lambda->getState () == Event::PAUSED); g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::SLEEPING); - // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); delete fmt; } @@ -83,7 +83,7 @@ main (void) g_assert (swt1_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); delete fmt; } @@ -107,7 +107,7 @@ main (void) g_assert (swt1_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); delete fmt; } @@ -131,12 +131,42 @@ main (void) g_assert (swt1_lambda->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); delete fmt; } // STOP lambda from state PAUSED // STOP lambda from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; + + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); + + // STOP is done + g_assert (swt1_lambda->transition (Event::STOP)); + + // after STOP, swt1_lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); + + // STOP is not done + g_assert_false (swt1_lambda->transition (Event::STOP)); + + // after STOP, swt1_lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::SLEEPING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); + + delete fmt; + } exit (EXIT_SUCCESS); } diff --git a/tests/test-Switch-transition-selection.cpp b/tests/test-Switch-transition-selection.cpp index 375f59f3e..8eb19c9a0 100644 --- a/tests/test-Switch-transition-selection.cpp +++ b/tests/test-Switch-transition-selection.cpp @@ -20,5 +20,122 @@ along with Ginga. If not, see . */ int main (void) { + // ABORT lambda from state OCCURRING + // ABORT lambda from state PAUSED + // ABORT lambda from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; + + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); + // ABORT is not done + g_assert_false (swt1_sel->transition (Event::ABORT)); + + // after start, swt1_lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state OCCURRING + // START lambda from state PAUSED + // START lambda from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; + + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); + // START is not done + g_assert_false (swt1_lambda->transition (Event::START)); + + // after start, swt1_lambda is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + + // RESUME lambda from state OCCURRING + // RESUME lambda from state PAUSED + // RESUME lambda from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; + + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); + // RESUME is not done + g_assert_false (swt1_sel->transition (Event::RESUME)); + + // after start, swt1_lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + + // START lambda from state OCCURRING + // START lambda from state PAUSED + // START lambda from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; + + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); + + // START is not done + g_assert_false (swt1_lambda->transition (Event::START)); + + // after start, swt1_lambda is OCCURRING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + + // STOP lambda from state OCCURRING + // STOP lambda from state PAUSED + // STOP lambda from state SLEEPING + { + Formatter *fmt; + Event *body_lambda, *swt1_lambda, *swt1_sel, *m1_lambda, *m2_lambda; + + tests_create_document_with_switch_and_start (&fmt, &body_lambda, + &swt1_lambda, &swt1_sel, + &m1_lambda, &m2_lambda); + + // STOP is not done + g_assert_false (swt1_sel->transition (Event::STOP)); + + // after STOP, swt1_lambda is SLEEPING + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (swt1_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + g_assert (swt1_sel->getState () == Event::SLEEPING); + + delete fmt; + } + exit (EXIT_SUCCESS); } diff --git a/tests/tests.h b/tests/tests.h index f428db318..d760d2453 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -335,8 +335,8 @@ tests_create_document_with_switch_and_start ( g_assert_nonnull (swt1); *swt1_lambda = swt1->getLambda (); g_assert_nonnull (swt1_lambda); - // *swt1_sel = swt1->getSelectionEvent (""); - // g_assert_nonnull (*m1_sel); + *swt1_sel = swt1->getSelectionEvent (""); + g_assert_nonnull (*swt1_sel); m1 = cast (Media *, swt1->getChildById ("m1")); g_assert_nonnull (m1); @@ -356,7 +356,7 @@ tests_create_document_with_switch_and_start ( g_assert_cmpint ((*swt1_lambda)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::SLEEPING); g_assert_cmpint ((*m2_lambda)->getState (), ==, Event::SLEEPING); - // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); // when advance time, c1_lambda is OCCURRING (*fmt)->sendTick (0, 0, 0); @@ -364,7 +364,7 @@ tests_create_document_with_switch_and_start ( g_assert_cmpint ((*swt1_lambda)->getState (), ==, Event::OCCURRING); g_assert_cmpint ((*m1_lambda)->getState (), ==, Event::OCCURRING); g_assert_cmpint ((*m2_lambda)->getState (), ==, Event::SLEEPING); - // g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); + g_assert_cmpint ((*swt1_sel)->getState (), ==, Event::SLEEPING); } #endif // TESTS_H From 4da06f07ac854ecea2eb3db4ac246faa338f604e Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 27 Apr 2018 18:56:46 -0300 Subject: [PATCH 102/169] tests: Rename test-Media-selection to test-Media-link-onSelection --- .gitignore | 2 +- tests/Makefile.am | 4 ++-- ...st-Media-selection.cpp => test-Media-link-onSelection.cpp} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename tests/{test-Media-selection.cpp => test-Media-link-onSelection.cpp} (100%) diff --git a/.gitignore b/.gitignore index 13a0686ef..ab471d303 100644 --- a/.gitignore +++ b/.gitignore @@ -150,7 +150,7 @@ /tests/test-GingaInternal-setData /tests/test-Ginga-resize /tests/test-Media-new -/tests/test-Media-selection +/tests/test-Media-link-onSelection /tests/test-Media-4grid /tests/test-Media-mime /tests/test-Media-focusIndex-changed-by-link diff --git a/tests/Makefile.am b/tests/Makefile.am index 795f0bf5d..a8c1dae05 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -261,8 +261,8 @@ test_Media_focusIndex_changed_by_link_SOURCES= test-Media-focusIndex-changed-by- progs+= test-Media-focusIndex-changed-by-sendKey test_Media_focusIndex_changed_by_sendKey_SOURCES= test-Media-focusIndex-changed-by-sendKey.cpp -progs+= test-Media-selection -test_Media_selection_SOURCES= test-Media-selection.cpp +progs+= test-Media-link-onSelection +test_Media_link_onSelection_SOURCES= test-Media-link-onSelection.cpp progs+= test-Media-mime test_Media_mime_SOURCES= test-Media-mime.cpp diff --git a/tests/test-Media-selection.cpp b/tests/test-Media-link-onSelection.cpp similarity index 100% rename from tests/test-Media-selection.cpp rename to tests/test-Media-link-onSelection.cpp From 486ddeef8bec8598d82507c602e843a108705348 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sat, 28 Apr 2018 15:43:01 -0300 Subject: [PATCH 103/169] tests: Improve test-Ginga-getOptions --- tests/test-Ginga-getOptions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test-Ginga-getOptions.cpp b/tests/test-Ginga-getOptions.cpp index 24b67c71a..b2ad90cfe 100644 --- a/tests/test-Ginga-getOptions.cpp +++ b/tests/test-Ginga-getOptions.cpp @@ -21,6 +21,7 @@ int main (void) { const GingaOptions *out; + ignore_unused (out); GingaOptions opts = { 10, // width 20, // height @@ -36,6 +37,8 @@ main (void) g_assert (out->width == opts.width); g_assert (out->height == opts.height); g_assert (out->debug == opts.debug); + g_assert (out->experimental == opts.experimental); + g_assert (out->opengl == opts.opengl); g_assert (out->background == opts.background); exit (EXIT_SUCCESS); From a0639012510befb0d66d009e1e56fcead7cbd26f Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sat, 28 Apr 2018 16:25:47 -0300 Subject: [PATCH 104/169] tests: Add test-Media-getZ --- .gitignore | 1 + tests/Makefile.am | 3 + tests/test-Media-getZ.cpp | 138 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 tests/test-Media-getZ.cpp diff --git a/.gitignore b/.gitignore index ab471d303..30f568fa1 100644 --- a/.gitignore +++ b/.gitignore @@ -150,6 +150,7 @@ /tests/test-GingaInternal-setData /tests/test-Ginga-resize /tests/test-Media-new +/tests/test-Media-getZ /tests/test-Media-link-onSelection /tests/test-Media-4grid /tests/test-Media-mime diff --git a/tests/Makefile.am b/tests/Makefile.am index a8c1dae05..68f9b344f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -246,6 +246,9 @@ test_Siggen_new_SOURCES= test-Siggen-new.cpp progs+= test-Media-new test_Media_new_SOURCES= test-Media-new.cpp +progs+= test-Media-getZ +test_Media_getZ_SOURCES= test-Media-getZ.cpp + progs+= test-Media-explicitDur test_Media_explicitDur_SOURCES= test-Media-explicitDur.cpp diff --git a/tests/test-Media-getZ.cpp b/tests/test-Media-getZ.cpp new file mode 100644 index 000000000..1fb0c508a --- /dev/null +++ b/tests/test-Media-getZ.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + for (int i = 0; i < samples.size (); i++) + { + Formatter *fmt; + Document *doc; + int m1_z, m1_zorder; + int m2_z, m2_zorder; + + tests_parse_and_start (&fmt, &doc, + xstrbuild ("\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + samples[i].uri, samples[i].uri)); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when start document, m1 is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + g_assert (m1->getProperty ("zIndex") == "1"); + g_assert (m2->getProperty ("zIndex") == "2"); + g_assert_true (m1->getZ (&m1_z, &m1_zorder)); + g_assert_cmpint (m1_z, ==, 1); + g_assert_true (m2->getZ (&m2_z, &m2_zorder)); + g_assert_cmpint (m2_z, ==, 2); + + fmt->sendTick (1 * GINGA_SECOND, 1 * GINGA_SECOND, 0); + g_assert (m1->getProperty ("zIndex") == "2"); + g_assert (m2->getProperty ("zIndex") == "1"); + g_assert_true (m1->getZ (&m1_z, &m1_zorder)); + g_assert_true (m2->getZ (&m2_z, &m2_zorder)); + g_assert_true (m1->getZ (&m1_z, &m1_zorder)); + g_assert_cmpint (m1_z, ==, 2); + g_assert_true (m2->getZ (&m2_z, &m2_zorder)); + g_assert_cmpint (m2_z, ==, 1); + + fmt->sendTick (1 * GINGA_SECOND, 1 * GINGA_SECOND, 0); + g_assert (m1->getProperty ("zIndex") == "1"); + g_assert (m2->getProperty ("zIndex") == "1"); + g_assert_true (m1->getZ (&m1_z, &m1_zorder)); + g_assert_true (m2->getZ (&m2_z, &m2_zorder)); + g_assert_true (m1->getZ (&m1_z, &m1_zorder)); + g_assert_cmpint (m1_z, ==, 1); + g_assert_true (m2->getZ (&m2_z, &m2_zorder)); + g_assert_cmpint (m2_z, ==, 1); + + delete fmt; + } + + exit (EXIT_SUCCESS); +} From 2769ee7a7d764e5a206eda6feb42347501da068b Mon Sep 17 00:00:00 2001 From: "Guilherme F. Lima" Date: Wed, 2 May 2018 11:18:20 +0200 Subject: [PATCH 105/169] maint: Fix warnings --- lib/ParserLua.cpp | 2 +- src/ginga.cpp | 5 +++- .../test-Media-anchors-started-from-links.cpp | 14 ++++----- .../test-Media-anchors-started-from-ports.cpp | 14 ++++----- tests/test-Media-getZ.cpp | 2 +- tests/test-Media-link-onSelection.cpp | 6 ++-- tests/test-Media-mime.cpp | 3 +- tests/test-Object-sendKey.cpp | 2 +- tests/test-Parser-parseBuffer.cpp | 30 ++++++++++--------- tests/test-Parser-parseFile.cpp | 2 +- tests/test-ParserLua-parseFile.cpp | 2 +- tests/test-Siggen-new.cpp | 4 +-- tests/test-aux-xstrtod.cpp | 8 ++--- tests/test-aux-xstrtodorpercent.cpp | 12 ++++---- 14 files changed, 55 insertions(+), 51 deletions(-) diff --git a/lib/ParserLua.cpp b/lib/ParserLua.cpp index 2cb95a269..5d085a966 100644 --- a/lib/ParserLua.cpp +++ b/lib/ParserLua.cpp @@ -44,7 +44,7 @@ static int l_parse_link (lua_State *L); static int l_parse_predicate (lua_State *L); // Helper function -Event * +static Event * getEventStringAsEvent (string str, Context *parent) { Object *obj; diff --git a/src/ginga.cpp b/src/ginga.cpp index 8c601e383..d0c9c17ce 100644 --- a/src/ginga.cpp +++ b/src/ginga.cpp @@ -23,6 +23,10 @@ along with Ginga. If not, see . */ #include #include +// clang-format off +PRAGMA_DIAG_IGNORE (-Wunused-macros) +// clang-format on + #include "ginga.h" using namespace ::std; @@ -30,7 +34,6 @@ using namespace ::std; static Ginga *GINGA = nullptr; // Options. - #define OPTION_LINE "FILE..." #define OPTION_DESC \ "Report bugs to: " PACKAGE_BUGREPORT "\n" \ diff --git a/tests/test-Media-anchors-started-from-links.cpp b/tests/test-Media-anchors-started-from-links.cpp index 5e8dd37d2..71c2733b9 100644 --- a/tests/test-Media-anchors-started-from-links.cpp +++ b/tests/test-Media-anchors-started-from-links.cpp @@ -23,7 +23,7 @@ int main (void) { // start in anchor with begin nonzero and link waiting for this anchor end - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -139,7 +139,7 @@ main (void) // start in anchor with begin nonzero and link waiting another anchor with // begin after the begin of the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -246,7 +246,7 @@ main (void) // start in anchor with begin nonzero and link waiting another anchor // begin with time before the begin of the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -344,7 +344,7 @@ main (void) // start in anchor with non-zero end and link waiting // an anchor end with time after the end of the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -433,7 +433,7 @@ main (void) // start in anchor with non-zero end and link waiting an anchor with end // time the end before to the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -522,7 +522,7 @@ main (void) } // start an anchor and start another anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -612,7 +612,7 @@ main (void) // start in anchor with non-zero end and link waiting an anchor with end // time the end before to the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; diff --git a/tests/test-Media-anchors-started-from-ports.cpp b/tests/test-Media-anchors-started-from-ports.cpp index 2c401c56c..b4fe57794 100644 --- a/tests/test-Media-anchors-started-from-ports.cpp +++ b/tests/test-Media-anchors-started-from-ports.cpp @@ -21,7 +21,7 @@ int main (void) { // start in anchor with begin nonzero and link waiting for this anchor end - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -139,7 +139,7 @@ main (void) // start in anchor with begin nonzero and link waiting another anchor with // begin after the begin of the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -237,7 +237,7 @@ main (void) // start in anchor with begin nonzero and link waiting another anchor // begin with time before the begin of the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -337,7 +337,7 @@ main (void) // start in anchor with non-zero end and link waiting // an anchor end with time after the end of the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -428,7 +428,7 @@ main (void) // start in anchor with non-zero end and link waiting an anchor with end // time the end before to the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -519,7 +519,7 @@ main (void) } // start an anchor and start another anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -611,7 +611,7 @@ main (void) // start in anchor with non-zero end and link waiting an anchor with end // time the end before to the first anchor - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; diff --git a/tests/test-Media-getZ.cpp b/tests/test-Media-getZ.cpp index 1fb0c508a..73e0dc688 100644 --- a/tests/test-Media-getZ.cpp +++ b/tests/test-Media-getZ.cpp @@ -20,7 +20,7 @@ along with Ginga. If not, see . */ int main (void) { - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; diff --git a/tests/test-Media-link-onSelection.cpp b/tests/test-Media-link-onSelection.cpp index 9c24a35fa..72a5f9a60 100644 --- a/tests/test-Media-link-onSelection.cpp +++ b/tests/test-Media-link-onSelection.cpp @@ -20,7 +20,7 @@ along with Ginga. If not, see . */ int main (void) { - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; @@ -97,9 +97,9 @@ main (void) delete fmt; } - for (int j = 0; j < samples_keys.size (); j++) + for (guint j = 0; j < samples_keys.size (); j++) { - for (int i = 0; i < samples.size (); i++) + for (guint i = 0; i < samples.size (); i++) { Formatter *fmt; Document *doc; diff --git a/tests/test-Media-mime.cpp b/tests/test-Media-mime.cpp index 6897b822f..86674490c 100644 --- a/tests/test-Media-mime.cpp +++ b/tests/test-Media-mime.cpp @@ -22,11 +22,10 @@ along with Ginga. If not, see . */ int main (void) { - for (int i = 2; i < samples.size (); i++) + for (guint i = 2; i < samples.size (); i++) { Formatter *fmt; Document *doc; - Player *p; tests_parse_and_start (&fmt, &doc, xstrbuild ("\ \n\ \n\ diff --git a/tests/test-Object-sendKey.cpp b/tests/test-Object-sendKey.cpp index 2bd072e00..61a58f2c2 100644 --- a/tests/test-Object-sendKey.cpp +++ b/tests/test-Object-sendKey.cpp @@ -29,7 +29,7 @@ main (void) for (auto obj : objs) { - for (int j = 0; j < samples_keys.size (); j++) + for (guint j = 0; j < samples_keys.size (); j++) { obj->sendKey (samples_keys[j], true); } diff --git a/tests/test-Parser-parseBuffer.cpp b/tests/test-Parser-parseBuffer.cpp index b914789b6..63561c0fd 100644 --- a/tests/test-Parser-parseBuffer.cpp +++ b/tests/test-Parser-parseBuffer.cpp @@ -1794,20 +1794,22 @@ main (void) \n\ "); - // XFAIL ("mapping: Bad component", - // " at line 6: bad value 'x'", - // "\ -//\n\ -// \n\ -// \n\ -// \n\ -// \n\ -// \n\ -// \n\ -// \n\ -// \n\ -//\n\ -// "); +#if 0 + XFAIL ("mapping: Bad component", + " at line 6: bad value 'x'", + "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ + "); +#endif // ------------------------------------------------------------------------- // diff --git a/tests/test-Parser-parseFile.cpp b/tests/test-Parser-parseFile.cpp index 88b844af4..36635e9b2 100644 --- a/tests/test-Parser-parseFile.cpp +++ b/tests/test-Parser-parseFile.cpp @@ -41,7 +41,7 @@ main (void) nclFolders.push_back ( xpathbuildabs (ABS_TOP_SRCDIR, "examples/primeiro-joao/")); - for (int i = 0; i < nclFolders.size (); i++) + for (guint i = 0; i < nclFolders.size (); i++) { dir = g_dir_open (nclFolders[i].c_str (), 0, nullptr); g_assert_nonnull (dir); diff --git a/tests/test-ParserLua-parseFile.cpp b/tests/test-ParserLua-parseFile.cpp index 29d8e7bfe..a7b51ddf6 100644 --- a/tests/test-ParserLua-parseFile.cpp +++ b/tests/test-ParserLua-parseFile.cpp @@ -35,7 +35,7 @@ main (void) nclFolders.push_back ( xpathbuildabs (ABS_TOP_SRCDIR, "tests-ncl/generated")); - for (int i = 0; i < nclFolders.size (); i++) + for (guint i = 0; i < nclFolders.size (); i++) { dir = g_dir_open (nclFolders[i].c_str (), 0, nullptr); g_assert_nonnull (dir); diff --git a/tests/test-Siggen-new.cpp b/tests/test-Siggen-new.cpp index 084e687aa..57cabb665 100644 --- a/tests/test-Siggen-new.cpp +++ b/tests/test-Siggen-new.cpp @@ -23,7 +23,7 @@ main (void) Formatter *fmt; Document *doc; - Player *p; + tests_parse_and_start (&fmt, &doc, "\ \n\ \n\ @@ -124,7 +124,7 @@ main (void) Media *m12 = cast (Media *, body->getChildById ("m12")); g_assert_nonnull (m12); Media *m13 = cast (Media *, body->getChildById ("m13")); - g_assert_nonnull (m12); + g_assert_nonnull (m13); fmt->sendTick (0, 0, 0); delete fmt; diff --git a/tests/test-aux-xstrtod.cpp b/tests/test-aux-xstrtod.cpp index ee08c2ff3..786481ce5 100644 --- a/tests/test-aux-xstrtod.cpp +++ b/tests/test-aux-xstrtod.cpp @@ -24,9 +24,9 @@ GINGA_PRAGMA_DIAG_IGNORE (-Wfloat-equal) int main (void) { - g_assert_cmpint (xstrtod ("1"), ==, 1.); - g_assert_cmpint (xstrtod (" 1"), ==, 1.); - g_assert_cmpint (xstrtod ("50"), ==, 50.); - g_assert_cmpint (xstrtod ("1 "), ==, 1.); + g_assert (xstrtod ("1") == 1.); + g_assert (xstrtod (" 1") == 1.); + g_assert (xstrtod ("50") == 50.); + g_assert (xstrtod ("1 ") == 1.); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrtodorpercent.cpp b/tests/test-aux-xstrtodorpercent.cpp index 70d469028..9b2aac759 100644 --- a/tests/test-aux-xstrtodorpercent.cpp +++ b/tests/test-aux-xstrtodorpercent.cpp @@ -25,22 +25,22 @@ int main (void) { bool perc; - g_assert_cmpint (xstrtodorpercent ("", &perc), ==, 0.); + g_assert (xstrtodorpercent ("", &perc) == 0.); g_assert_false (perc); - g_assert_cmpint (xstrtodorpercent ("0", &perc), ==, 0.); + g_assert (xstrtodorpercent ("0", &perc) == 0.); g_assert_false (perc); - g_assert_cmpint (xstrtodorpercent ("0%", &perc), ==, 0.); + g_assert (xstrtodorpercent ("0%", &perc) == 0.); g_assert_true (perc); - g_assert_cmpint (xstrtodorpercent ("50%", &perc), ==, .5); + g_assert (xstrtodorpercent ("50%", &perc) == .5); g_assert_true (perc); - g_assert_cmpint (xstrtodorpercent ("a", &perc), ==, 0.); + g_assert (xstrtodorpercent ("a", &perc) == 0.); g_assert_false (perc); - g_assert_cmpint (xstrtodorpercent ("a%", &perc), ==, 0.); + g_assert (xstrtodorpercent ("a%", &perc) == 0.); g_assert_false (perc); exit (EXIT_SUCCESS); From 37b6eaacede0738420e221c890e1a4ef9b781e06 Mon Sep 17 00:00:00 2001 From: Antonio Busson Date: Wed, 2 May 2018 14:45:20 -0300 Subject: [PATCH 106/169] src-gui: fullscreen bug fixed src-gui/ginga-gtk.cpp src-gui/ginga_gtk.h src-gui/view/BigPictureWindow.cpp src-gui/view/Draw.cpp src-gui/view/MainWindow.cpp --- src-gui/ginga-gtk.cpp | 50 ++++++------- src-gui/ginga_gtk.h | 2 + src-gui/view/BigPictureWindow.cpp | 67 +++-------------- src-gui/view/Draw.cpp | 13 +++- src-gui/view/MainWindow.cpp | 116 +++++++++++++++++------------- 5 files changed, 119 insertions(+), 129 deletions(-) diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index 5232f0b86..39ec1b7c9 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -27,7 +27,7 @@ using namespace ::std; #include #endif -//Global formatter +// Global formatter Ginga *GINGA = nullptr; gchar *gingaID = nullptr; @@ -68,6 +68,9 @@ main (int argc, char **argv) opts.opengl = false; opts.experimental = true; + GINGA = Ginga::create (&opts); + g_assert_nonnull (GINGA); + gtk_init (&saved_argc, &saved_argv); // Parse command-line options. @@ -76,22 +79,19 @@ main (int argc, char **argv) status = g_option_context_parse (ctx, &saved_argc, &saved_argv, &error); g_option_context_free (ctx); -/* - if (!status) - { - g_assert_nonnull (error); - // usage_error ("%s", error->message); - g_error_free (error); - _exit (0); - } -*/ + /* + if (!status) + { + g_assert_nonnull (error); + // usage_error ("%s", error->message); + g_error_free (error); + _exit (0); + } + */ init_ginga_data (); load_settings (); - GINGA = Ginga::create (&opts); - g_assert_nonnull (GINGA); - setlocale (LC_ALL, "C"); gtk_window_set_default_icon_from_file ( @@ -104,26 +104,28 @@ main (int argc, char **argv) // check for ginga updates send_http_log_message (-1, (gchar *) "Check for Ginga updates"); g_assert (g_setenv ("G_MESSAGES_DEBUG", "all", true)); - + create_main_window (); if (saved_argc > 1) { - printf("saved arg... \n"); - if( strcmp(saved_argv[1], "-b") == 0) - { - printf("create bigpicture window.\n"); + if (strcmp (saved_argv[1], "-b") == 0) + { + create_bigpicture_window (); - } + + // printf ("w: %d - h: %d", presentationAttributes.resolutionWidth, + // presentationAttributes.resolutionHeight); + } else - { + { gchar *filename = saved_argv[1]; gchar *ext = strrchr (filename, '.'); if (!g_strcmp0 (ext, ".ncl")) - { - insert_historicbox (filename); - } - } + { + insert_historicbox (filename); + } + } } gtk_main (); diff --git a/src-gui/ginga_gtk.h b/src-gui/ginga_gtk.h index 8efce6e79..07a161f2d 100644 --- a/src-gui/ginga_gtk.h +++ b/src-gui/ginga_gtk.h @@ -77,6 +77,8 @@ void create_window_components (void); void show_ginga_update_alertbox (void); gchar *get_icon_folder (void); void insert_historicbox (gchar *filename); +void stop_button_callback (void); +void play_pause_button_callback (void); /* View/TvControlWindow */ void create_tvcontrol_window (void); diff --git a/src-gui/view/BigPictureWindow.cpp b/src-gui/view/BigPictureWindow.cpp index cdb92a3c9..dbd065b47 100644 --- a/src-gui/view/BigPictureWindow.cpp +++ b/src-gui/view/BigPictureWindow.cpp @@ -141,8 +141,7 @@ instantiateInAppLibrary (unused (xmlDocPtr doc), xmlNodePtr cur) bool loadApplicationsXML () { - const char *docname - = g_strdup (ABS_TOP_SRCDIR"/src-gui/ncl-apps.xml"); + const char *docname = g_strdup (ABS_TOP_SRCDIR "/src-gui/ncl-apps.xml"); xmlDocPtr doc; xmlNodePtr cur; @@ -177,36 +176,6 @@ loadApplicationsXML () return TRUE; } -void -draw_ginga_surface (GtkWidget *widget, cairo_t *cr, unused (gpointer data)) -{ - int w, h; - w = gtk_widget_get_allocated_width (widget); - h = gtk_widget_get_allocated_height (widget); - - cairo_set_source_rgb (cr, 0., 0., 0.); - cairo_rectangle (cr, 0, 0, w, h); - cairo_fill (cr); - - if (presentationAttributes.aspectRatio == 0) - { - cairo_translate (cr, (w - (w * 0.75)) / 2, 0); - cairo_scale (cr, 0.75, 1.0); - } - else if (presentationAttributes.aspectRatio == 1) - { - cairo_translate (cr, 0, (h - (h * 0.5625)) / 2); - cairo_scale (cr, 1.0, 0.5625); - } - else if (presentationAttributes.aspectRatio == 2) - { - cairo_translate (cr, 0, (h - (h * 0.625)) / 2); - cairo_scale (cr, 1.0, 0.625); - } - - GINGA->redraw (cr); -} - gboolean update_bigpicture_callback (GtkWidget *widget) { @@ -246,11 +215,6 @@ void draw_bigpicture_callback (GtkWidget *widget, cairo_t *cr, unused (gpointer data)) { - if (isPlayingApp) - { - draw_ginga_surface (widget, cr, data); - return; - } int h = gtk_widget_get_allocated_height (widget); @@ -272,8 +236,8 @@ draw_bigpicture_callback (GtkWidget *widget, cairo_t *cr, cairo_rectangle (cr, posX - 10, posY - 10, cardWidth + 20, cardHeight + 20); } - cairo_fill (cr); + cairo_fill (cr); cairo_set_source_surface (cr, card->surface, posX, posY); gdouble b = screen_width - card->position; @@ -341,8 +305,9 @@ play_application_in_bigpicture () if (card->index == 0) { - isPlayingApp = TRUE; GINGA->start (card->src, nullptr); + isPlayingApp = TRUE; + set_fullscreen_mode (); } } } @@ -436,6 +401,7 @@ create_bigpicture_window () G_CALLBACK (keyboard_callback), (void *) "press"); g_signal_connect (bigPictureWindow, "key-release-event", G_CALLBACK (keyboard_callback), (void *) "release"); + gtk_container_set_border_width (GTK_CONTAINER (bigPictureWindow), 0); // Create Drawing area @@ -448,18 +414,10 @@ create_bigpicture_window () gtk_container_add (GTK_CONTAINER (bigPictureWindow), canvas); timeOutTagB = g_timeout_add ( 1000 / 60, (GSourceFunc) update_bigpicture_callback, canvas); - - gtk_window_fullscreen (GTK_WINDOW (bigPictureWindow)); - g_signal_connect (bigPictureWindow, "destroy", G_CALLBACK (destroy_bigpicture_window), NULL); - gtk_widget_show_all (bigPictureWindow); - - GINGA->resize (rect.width, rect.height); - - // carrousel_rotate (-1); - // carrousel_rotate (1); + gtk_window_fullscreen (GTK_WINDOW (bigPictureWindow)); } void @@ -476,10 +434,11 @@ destroy_bigpicture_window () { if (isPlayingApp) { - isPlayingApp = FALSE; - GINGA->stop (); + set_unfullscreen_mode (); + isPlayingApp=FALSE; + GINGA->stop(); return; - }; + } inBigPictureMode = FALSE; g_source_remove (timeOutTagB); @@ -488,9 +447,5 @@ destroy_bigpicture_window () g_list_free_full (cards_list, destroy_card_list); cards_list = NULL; currentCard = 0; - - GINGA->resize (presentationAttributes.resolutionWidth, - presentationAttributes.resolutionHeight); - - exit(1); + exit (1); } diff --git a/src-gui/view/Draw.cpp b/src-gui/view/Draw.cpp index c8f5fbf87..3642d28bf 100644 --- a/src-gui/view/Draw.cpp +++ b/src-gui/view/Draw.cpp @@ -50,7 +50,18 @@ update_draw_callback (GtkWidget *widget) last = time; } - GINGA->sendTick (time - first, time - last, frame); + if (!GINGA->sendTick (time - first, time - last, frame)) + { + if (inBigPictureMode) + { + destroy_bigpicture_window (); + } + // force stop button callback to reset interface + else + { + stop_button_callback (); + } + } last = time; diff --git a/src-gui/view/MainWindow.cpp b/src-gui/view/MainWindow.cpp index 6bb851995..0eb903147 100644 --- a/src-gui/view/MainWindow.cpp +++ b/src-gui/view/MainWindow.cpp @@ -118,7 +118,7 @@ g_log_default_handler (unused (const gchar *log_domain), GLogLevelFlags log_level, const gchar *message, unused (gpointer unused_data)) { - // printf ("%s \n", message); + if (!g_str_has_prefix (message, "ginga::")) return; // is not a ginga message @@ -468,6 +468,16 @@ select_historic_line (GtkListBox *box, GtkListBoxRow *row, gtk_widget_show_all (historicBox); hide_historicbox (); + + if (!inPlayMode) + { + play_pause_button_callback (); + } + else + { + stop_button_callback (); + play_pause_button_callback (); + } } void @@ -479,11 +489,11 @@ keyboard_callback (unused (GtkWidget *widget), GdkEventKey *e, switch (e->keyval) { case GDK_KEY_Escape: /* quit */ - if (isFullScreenMode) - set_unfullscreen_mode (); - else if (inBigPictureMode + if (inBigPictureMode && (g_strcmp0 ((const char *) type, "press") != 0)) - destroy_bigpicture_window (); + destroy_bigpicture_window (); + else if (isFullScreenMode) + set_unfullscreen_mode (); break; case GDK_KEY_Meta_L: case GDK_KEY_Meta_R: @@ -507,8 +517,8 @@ keyboard_callback (unused (GtkWidget *widget), GdkEventKey *e, case GDK_KEY_B: case GDK_KEY_b: if (isCrtlModifierActive) - // create_bigpicture_window (); - break; + // create_bigpicture_window (); + break; case GDK_KEY_D: case GDK_KEY_d: if (isCrtlModifierActive) @@ -532,10 +542,10 @@ keyboard_callback (unused (GtkWidget *widget), GdkEventKey *e, key = "GREEN"; break; case GDK_KEY_F3: - key = "BLUE"; + key = "YELLOW"; break; case GDK_KEY_F4: - key = "YELLOW"; + key = "BLUE"; break; case GDK_KEY_F5: key = "INFO"; @@ -570,6 +580,7 @@ keyboard_callback (unused (GtkWidget *widget), GdkEventKey *e, if (GINGA->getState () == GINGA_STATE_PLAYING) GINGA->sendKey (std::string (key), g_strcmp0 ((const char *) type, "press") == 0); + } void @@ -641,13 +652,13 @@ create_window_components () g_assert_nonnull (playButton); g_signal_connect (playButton, "clicked", G_CALLBACK (play_pause_button_callback), NULL); - gtk_widget_set_can_focus(playButton, FALSE); + gtk_widget_set_can_focus (playButton, FALSE); stopButton = gtk_button_new (); g_assert_nonnull (stopButton); g_signal_connect (stopButton, "clicked", G_CALLBACK (stop_button_callback), NULL); - gtk_widget_set_can_focus(stopButton, FALSE); + gtk_widget_set_can_focus (stopButton, FALSE); fullscreenButton = gtk_button_new (); g_assert_nonnull (fullscreenButton); @@ -655,7 +666,7 @@ create_window_components () gtk_widget_set_tooltip_text (fullscreenButton, "Fullscreen"); g_signal_connect (fullscreenButton, "clicked", G_CALLBACK (set_fullscreen_mode), NULL); - gtk_widget_set_can_focus(fullscreenButton, FALSE); + gtk_widget_set_can_focus (fullscreenButton, FALSE); volumeButton = gtk_volume_button_new (); g_assert_nonnull (volumeButton); @@ -666,7 +677,7 @@ create_window_components () gtk_widget_set_tooltip_text (settingsButton, "Preferences"); g_signal_connect (settingsButton, "clicked", G_CALLBACK (show_optbox), NULL); - gtk_widget_set_can_focus(settingsButton, FALSE); + gtk_widget_set_can_focus (settingsButton, FALSE); remoteButton = gtk_button_new (); g_assert_nonnull (remoteButton); @@ -681,7 +692,7 @@ create_window_components () gtk_widget_set_tooltip_text (toolsButton, "Tools"); g_signal_connect (toolsButton, "clicked", G_CALLBACK (show_toolbox), NULL); - gtk_widget_set_can_focus(toolsButton, FALSE); + gtk_widget_set_can_focus (toolsButton, FALSE); debugButton = gtk_button_new (); g_assert_nonnull (debugButton); @@ -1024,40 +1035,6 @@ enable_disable_debug (void) gtk_widget_hide (GTK_WIDGET (debugView)); } -void -select_ncl_file_callback (unused (GtkWidget *widget), - unused (gpointer data)) -{ - GtkWidget *dialog = gtk_file_chooser_dialog_new ( - "Open File", GTK_WINDOW (mainWindow), GTK_FILE_CHOOSER_ACTION_OPEN, - "_Cancel", GTK_RESPONSE_CANCEL, "_Open", GTK_RESPONSE_ACCEPT, NULL); - - gint res = gtk_dialog_run (GTK_DIALOG (dialog)); - if (res == GTK_RESPONSE_ACCEPT) - { - gchar *filename; - GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog); - filename = gtk_file_chooser_get_filename (chooser); - - gchar *ext = strrchr (filename, '.'); - if (g_strcmp0 (ext, ".ncl")) - { - show_infobar (g_markup_printf_escaped ( - "Error reading \"%s\": %s is a invalid formart file.", - filename, ext)); - } - else - { - insert_historicbox (filename); - save_settings (); - } - - g_free (filename); - } - - gtk_widget_destroy (dialog); -} - void stop_button_callback (void) { @@ -1108,3 +1085,46 @@ play_pause_button_callback (void) gtk_button_set_image (GTK_BUTTON (playButton), play_icon); } + +void select_ncl_file_callback (unused (GtkWidget *widget), + unused (gpointer data)) +{ + GtkWidget *dialog = gtk_file_chooser_dialog_new ( + "Open File", GTK_WINDOW (mainWindow), GTK_FILE_CHOOSER_ACTION_OPEN, + "_Cancel", GTK_RESPONSE_CANCEL, "_Open", GTK_RESPONSE_ACCEPT, NULL); + + gint res = gtk_dialog_run (GTK_DIALOG (dialog)); + if (res == GTK_RESPONSE_ACCEPT) + { + gchar *filename; + GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog); + filename = gtk_file_chooser_get_filename (chooser); + + gchar *ext = strrchr (filename, '.'); + if (g_strcmp0 (ext, ".ncl")) + { + show_infobar (g_markup_printf_escaped ( + "Error reading \"%s\": %s is a invalid formart file.", + filename, ext)); + } + else + { + insert_historicbox (filename); + save_settings (); + + if (!inPlayMode) + { + play_pause_button_callback (); + } + else + { + stop_button_callback (); + play_pause_button_callback (); + } + } + + g_free (filename); + } + + gtk_widget_destroy (dialog); +} From efd399e45bd528d780e20c0416f24c0dc87c5c2f Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 2 May 2018 19:31:21 -0300 Subject: [PATCH 107/169] tests: add test-Ginga-redraw --- .gitignore | 1 + tests/Makefile.am | 3 + tests/test-Ginga-redraw.cpp | 217 ++++++++++++++++++++++++++++++++++++ 3 files changed, 221 insertions(+) create mode 100644 tests/test-Ginga-redraw.cpp diff --git a/.gitignore b/.gitignore index 30f568fa1..77cb1430b 100644 --- a/.gitignore +++ b/.gitignore @@ -149,6 +149,7 @@ /tests/test-GingaInternal-getData /tests/test-GingaInternal-setData /tests/test-Ginga-resize +/tests/test-Ginga-redraw /tests/test-Media-new /tests/test-Media-getZ /tests/test-Media-link-onSelection diff --git a/tests/Makefile.am b/tests/Makefile.am index 68f9b344f..4ecf9aab1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -376,6 +376,9 @@ test_Ginga_setOptionInt_SOURCES= test-Ginga-setOptionInt.cpp progs+= test-Ginga-resize test_Ginga_resize_SOURCES= test-Ginga-resize.cpp +progs+= test-Ginga-redraw +test_Ginga_redraw_SOURCES= test-Ginga-redraw.cpp + progs+= xfail-test-Ginga-getOptionInt xfail_test_Ginga_getOptionInt_SOURCES= xfail-test-Ginga-getOptionInt.cpp diff --git a/tests/test-Ginga-redraw.cpp b/tests/test-Ginga-redraw.cpp new file mode 100644 index 000000000..7b080831e --- /dev/null +++ b/tests/test-Ginga-redraw.cpp @@ -0,0 +1,217 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" +#include + +Formatter *fmt; +Media *m1, *m2; +int tickCounter; +int width = 800, height = 600; + +#if GTK_CHECK_VERSION(3, 8, 0) +static gboolean +tick_callback (GtkWidget *widget, GdkFrameClock *frame_clock, + unused (gpointer data)) +#else +static gboolean +tick_callback (GtkWidget *widget) +#endif +{ + gtk_widget_queue_draw (widget); + return G_SOURCE_CONTINUE; +} + +static gboolean +draw_callback (unused (GtkWidget *widget), cairo_t *cr, + unused (gpointer data)) +{ + int rowstride, n_channels, x, y; + GdkPixbuf *pixbuf; + guchar *pixels, *p; + guchar alpha, red, green, blue; + + // ginga redraw + fmt->redraw (cr); + + // get center pixel + pixbuf = gdk_pixbuf_get_from_surface (cairo_get_target (cr), 0, 0, width, + height); + n_channels = gdk_pixbuf_get_n_channels (pixbuf); + + g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB); + g_assert_cmpint (gdk_pixbuf_get_bits_per_sample (pixbuf), ==, 8); + // g_assert (gdk_pixbuf_get_has_alpha (pixbuf)); + // g_assert (n_channels == 4); + g_assert_cmpint (n_channels, ==, 3); + + width = gdk_pixbuf_get_width (pixbuf); + height = gdk_pixbuf_get_height (pixbuf); + rowstride = gdk_pixbuf_get_rowstride (pixbuf); + pixels = gdk_pixbuf_get_pixels (pixbuf); + + x = width / 2; + y = height / 2; + p = pixels + y * rowstride + x * n_channels; + red = p[0]; + green = p[1]; + blue = p[2]; + alpha = p[3]; + + // printf ("\n--------tickCounter=%d\n", tickCounter); + // printf ("center pixel: red=%d, green=%d, blue=%d, \n", red, green, blue); + // printf ("m1 state=%d, m1.zIndex=%s, m2 state=%d, m2.zIndex=%s\n", + // m1->isOccurring (), m1->getProperty ("zIndex").c_str (), + // m2->isOccurring (), m2->getProperty ("zIndex").c_str ()); + if (tickCounter == 0) + { + g_assert (m1->getProperty ("zIndex") == "1"); + g_assert (m2->getProperty ("zIndex") == "2"); + g_assert_cmpint (red, ==, 0); + g_assert_cmpint (green, ==, 128); + g_assert_cmpint (blue, ==, 0); + } + else if (tickCounter == 1) + { + g_assert (m1->getProperty ("zIndex") == "2"); + g_assert (m2->getProperty ("zIndex") == "1"); + g_assert_cmpint (red, ==, 255); + g_assert_cmpint (green, ==, 0); + g_assert_cmpint (blue, ==, 0); + } + else if (tickCounter == 2) + { + g_assert (m1->getProperty ("zIndex") == "1"); + g_assert (m2->getProperty ("zIndex") == "2"); + g_assert_cmpint (red, ==, 0); + g_assert_cmpint (green, ==, 128); + g_assert_cmpint (blue, ==, 0); + } + else if (tickCounter == 3) + { + gtk_main_quit (); + } + + // advance time and trigger links to change zIndex + fmt->sendTick (1.02 * GINGA_SECOND, 1.02 * GINGA_SECOND, 0); + tickCounter = tickCounter + 1; + + return TRUE; +} + +int +main (void) +{ + gtk_init (nullptr, nullptr); + Document *doc; + GtkWidget *app; + GingaOptions opts; + + app = gtk_window_new (GTK_WINDOW_TOPLEVEL); + g_assert_nonnull (app); + gtk_window_set_default_size (GTK_WINDOW (app), width, height); + gtk_widget_set_app_paintable (app, TRUE); + g_signal_connect (app, "draw", G_CALLBACK (draw_callback), NULL); + gtk_widget_add_tick_callback (app, (GtkTickCallback) tick_callback, NULL, + NULL); + + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when start document, m1 is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + tickCounter = 0; + // gtk_widget_queue_draw (app); + gtk_widget_show_all (app); + gtk_main (); + + delete fmt; + + exit (EXIT_SUCCESS); +} From e116989009216b67a4b27d930328f3f951f64bde Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 2 May 2018 19:53:09 -0300 Subject: [PATCH 108/169] tests: Use g_assert_cmpfloat and g_assert_cmpint --- tests/test-aux-xstrcasecmp.cpp | 12 ++++++------ tests/test-aux-xstrtod.cpp | 8 ++++---- tests/test-aux-xstrtodorpercent.cpp | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/test-aux-xstrcasecmp.cpp b/tests/test-aux-xstrcasecmp.cpp index f2daa2ac5..19ae9c8f9 100644 --- a/tests/test-aux-xstrcasecmp.cpp +++ b/tests/test-aux-xstrcasecmp.cpp @@ -20,11 +20,11 @@ along with Ginga. If not, see . */ int main (void) { - g_assert (xstrcasecmp ("", "") == 0); - g_assert (xstrcasecmp ("testing", "TESTING") == 0); - g_assert (xstrcasecmp ("test", "TeStING") < 0); - g_assert (xstrcasecmp ("testing", "test") > 0); - g_assert (xstrcasecmp ("", "test") < 0); - g_assert (xstrcasecmp ("test ing", "test") > 0); + g_assert_cmpint (xstrcasecmp ("", ""), ==, 0); + g_assert_cmpint (xstrcasecmp ("testing", "TESTING"), ==, 0); + g_assert_cmpint (xstrcasecmp ("test", "TeStING"), <, 0); + g_assert_cmpint (xstrcasecmp ("testing", "test"), >, 0); + g_assert_cmpint (xstrcasecmp ("", "test"), <, 0); + g_assert_cmpint (xstrcasecmp ("test ing", "test"), >, 0); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrtod.cpp b/tests/test-aux-xstrtod.cpp index 786481ce5..10f715f05 100644 --- a/tests/test-aux-xstrtod.cpp +++ b/tests/test-aux-xstrtod.cpp @@ -24,9 +24,9 @@ GINGA_PRAGMA_DIAG_IGNORE (-Wfloat-equal) int main (void) { - g_assert (xstrtod ("1") == 1.); - g_assert (xstrtod (" 1") == 1.); - g_assert (xstrtod ("50") == 50.); - g_assert (xstrtod ("1 ") == 1.); + g_assert_cmpfloat (xstrtod ("1"), ==, 1.); + g_assert_cmpfloat (xstrtod (" 1"), ==, 1.); + g_assert_cmpfloat (xstrtod ("50"), ==, 50.); + g_assert_cmpfloat (xstrtod ("1 "), ==, 1.); exit (EXIT_SUCCESS); } diff --git a/tests/test-aux-xstrtodorpercent.cpp b/tests/test-aux-xstrtodorpercent.cpp index 9b2aac759..3211b4467 100644 --- a/tests/test-aux-xstrtodorpercent.cpp +++ b/tests/test-aux-xstrtodorpercent.cpp @@ -25,22 +25,22 @@ int main (void) { bool perc; - g_assert (xstrtodorpercent ("", &perc) == 0.); + g_assert_cmpfloat (xstrtodorpercent ("", &perc), ==, 0.); g_assert_false (perc); - g_assert (xstrtodorpercent ("0", &perc) == 0.); + g_assert_cmpfloat (xstrtodorpercent ("0", &perc), ==, 0.); g_assert_false (perc); - g_assert (xstrtodorpercent ("0%", &perc) == 0.); + g_assert_cmpfloat (xstrtodorpercent ("0%", &perc), ==, 0.); g_assert_true (perc); - g_assert (xstrtodorpercent ("50%", &perc) == .5); + g_assert_cmpfloat (xstrtodorpercent ("50%", &perc), ==, .5); g_assert_true (perc); - g_assert (xstrtodorpercent ("a", &perc) == 0.); + g_assert_cmpfloat (xstrtodorpercent ("a", &perc), ==, 0.); g_assert_false (perc); - g_assert (xstrtodorpercent ("a%", &perc) == 0.); + g_assert_cmpfloat (xstrtodorpercent ("a%", &perc), ==, 0.); g_assert_false (perc); exit (EXIT_SUCCESS); From 36b5dd8ceca45dc24bad72dfa4af9d942e80609f Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 2 May 2018 19:57:09 -0300 Subject: [PATCH 109/169] tests: fix XFAIL test for switchPort --- tests/test-Parser-parseBuffer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test-Parser-parseBuffer.cpp b/tests/test-Parser-parseBuffer.cpp index 63561c0fd..caa775582 100644 --- a/tests/test-Parser-parseBuffer.cpp +++ b/tests/test-Parser-parseBuffer.cpp @@ -1794,9 +1794,9 @@ main (void) \n\ "); -#if 0 - XFAIL ("mapping: Bad component", - " at line 6: bad value 'x'", + XFAIL ("mapping: Bad component", "Element at line 6: Bad value " + "'x' for attribute 'component' (no such " + "object in scope)", "\ \n\ \n\ @@ -1809,7 +1809,6 @@ main (void) \n\ \n\ "); -#endif // ------------------------------------------------------------------------- // From 9ec0f282a8d7df41f538f45b6e80724315e57499 Mon Sep 17 00:00:00 2001 From: Roberto Azevedo Date: Thu, 3 May 2018 11:58:20 +0200 Subject: [PATCH 110/169] src-gui: Fix warning --- src-gui/ginga-gtk.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index 39ec1b7c9..d7078fa50 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -51,7 +51,6 @@ main (int argc, char **argv) GingaOptions opts; GOptionContext *ctx; - gboolean status; GError *error = NULL; saved_argc = argc; @@ -76,7 +75,12 @@ main (int argc, char **argv) // Parse command-line options. ctx = g_option_context_new (OPTION_LINE); g_assert_nonnull (ctx); - status = g_option_context_parse (ctx, &saved_argc, &saved_argv, &error); + if (!g_option_context_parse (ctx, &saved_argc, &saved_argv, &error)) + { + g_print ("option parsing failed: %s\n", error->message); + exit (1); + } + g_option_context_free (ctx); /* From 0db451173aa596fd494205051fd16de5fb4c030a Mon Sep 17 00:00:00 2001 From: Roberto Azevedo Date: Thu, 3 May 2018 14:16:44 +0200 Subject: [PATCH 111/169] src-gui: Use glib to handle cmd arguments --- src-gui/ginga-gtk.cpp | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index d7078fa50..a1d29c6e7 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -36,6 +36,13 @@ gchar *gingaID = nullptr; "Report bugs to: " PACKAGE_BUGREPORT "\n" \ "Ginga home page: " PACKAGE_URL +static gboolean opt_bigpicture = FALSE; // toggle bigpicture mode + +static GOptionEntry options[] + = { { "bigpicture", 'b', 0, G_OPTION_ARG_NONE, &opt_bigpicture, + "Enable bigpicture mode", NULL }, + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } }; + void init_ginga_data () { @@ -75,6 +82,7 @@ main (int argc, char **argv) // Parse command-line options. ctx = g_option_context_new (OPTION_LINE); g_assert_nonnull (ctx); + g_option_context_add_main_entries (ctx, options, NULL); if (!g_option_context_parse (ctx, &saved_argc, &saved_argv, &error)) { g_print ("option parsing failed: %s\n", error->message); @@ -83,16 +91,6 @@ main (int argc, char **argv) g_option_context_free (ctx); - /* - if (!status) - { - g_assert_nonnull (error); - // usage_error ("%s", error->message); - g_error_free (error); - _exit (0); - } - */ - init_ginga_data (); load_settings (); @@ -111,24 +109,17 @@ main (int argc, char **argv) create_main_window (); - if (saved_argc > 1) + if (opt_bigpicture) { - if (strcmp (saved_argv[1], "-b") == 0) - { - - create_bigpicture_window (); - - // printf ("w: %d - h: %d", presentationAttributes.resolutionWidth, - // presentationAttributes.resolutionHeight); - } - else + create_bigpicture_window (); + } + else + { + gchar *filename = saved_argv [1]; + gchar *ext = strrchr (filename, '.'); + if (!g_strcmp0 (ext, ".ncl")) { - gchar *filename = saved_argv[1]; - gchar *ext = strrchr (filename, '.'); - if (!g_strcmp0 (ext, ".ncl")) - { - insert_historicbox (filename); - } + insert_historicbox (filename); } } From 90d31f8d1c1ab5d8f86262e15f3b43bfcfff4f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Thu, 3 May 2018 12:50:18 -0300 Subject: [PATCH 112/169] Examples: Removing Hackerteen e adding Hrace. * examples/fetch.sh * src-gui/ncl-apps.xml --- examples/fetch.sh | 3 ++- src-gui/ncl-apps.xml | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/fetch.sh b/examples/fetch.sh index 02a8f9b59..5d378689d 100755 --- a/examples/fetch.sh +++ b/examples/fetch.sh @@ -20,6 +20,7 @@ APPS="$APPS africa2010" APPS="$APPS comerciais-proview" APPS="$APPS formula1" APPS="$APPS hackerteen" +APPS="$APPS hrace" APPS="$APPS orchestra" APPS="$APPS pixelation" APPS="$APPS proderj" @@ -31,7 +32,7 @@ APPS="$APPS vivamais-alim" URI=http://www.telemidia.puc-rio.br/~gflima/misc/nclapps URI_PATCHS=https://raw.githubusercontent.com/andrelbd1/ginga_aplications/master/ -PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl comerciais-proview/app_cover.png comerciais-proview/app_thumbnail.png formula1/formula1.ncl formula1/app_cover.png formula1/app_thumbnail.png hackerteen/hackerteen.lua hackerteen/hackerteen.ncl hackerteen/app_cover.png hackerteen/app_thumbnail.png orchestra/orchestra.ncl orchestra/app_cover.png orchestra/app_thumbnail.png pixelation/pixelation.ncl pixelation/app_cover.png pixelation/app_thumbnail.png proderj/proderj.ncl proderj/app_cover.png proderj/app_thumbnail.png roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-do-dia/regionBase.ncl roteiro-do-dia/app_cover.png roteiro-do-dia/app_thumbnail.png velha/connbase.ncl velha/main.ncl velha/app_cover.png velha/app_thumbnail.png vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-alim/app_cover.png vivamais-alim/app_thumbnail.png vivamais-peso/peso.deps vivamais-peso/peso.lua vivamais-peso/app_cover.png vivamais-peso/app_thumbnail.png pacman/app_cover.png pacman/app_thumbnail.png" +PATCHS="comerciais-proview/main.ncl comerciais-proview/connbase.ncl comerciais-proview/app_cover.png comerciais-proview/app_thumbnail.png formula1/formula1.ncl formula1/app_cover.png formula1/app_thumbnail.png hackerteen/hackerteen.lua hackerteen/hackerteen.ncl hackerteen/app_cover.png hackerteen/app_thumbnail.png orchestra/orchestra.ncl orchestra/app_cover.png orchestra/app_thumbnail.png pixelation/pixelation.ncl pixelation/app_cover.png pixelation/app_thumbnail.png proderj/proderj.ncl proderj/app_cover.png proderj/app_thumbnail.png roteiro-do-dia/connectorBase.ncl roteiro-do-dia/descriptorBase.ncl roteiro-do-dia/main.ncl roteiro-do-dia/regionBase.ncl roteiro-do-dia/app_cover.png roteiro-do-dia/app_thumbnail.png velha/connbase.ncl velha/main.ncl velha/app_cover.png velha/app_thumbnail.png vivamais-alim/vivamais.ncl vivamais-alim/vivamais30.conn vivamais-alim/app_cover.png vivamais-alim/app_thumbnail.png vivamais-peso/peso.deps vivamais-peso/peso.lua vivamais-peso/app_cover.png vivamais-peso/app_thumbnail.png pacman/app_cover.png pacman/app_thumbnail.png hrace/app_cover.png hrace/app_thumbnail.png hrace/hrace.lua hrace/hrace.ncl" for app in $APPS; do wget --show-progress -q -r -N -np -nH --cut-dirs 3 \ diff --git a/src-gui/ncl-apps.xml b/src-gui/ncl-apps.xml index edf29d91f..481a1107e 100644 --- a/src-gui/ncl-apps.xml +++ b/src-gui/ncl-apps.xml @@ -10,11 +10,16 @@ cover="../ginga/examples/formula1/app_cover.png" title="Formula 1" description="" /> - + description="Hackerteen Prototype é uma aplicação de t-learning para TV digital interativa. O jogo é composto por um baralho com 25 cartas, com 5 cópias de cada carta numerada de 1 a 5. Personagens representando o telespectador e o computador são apresentados na tela em um tabuleiro com 23 casas. Caso o personagem utilize uma carta que indica a exata distância entre ambos os personagens, ele estará sendo o atacante de um duelo. O atacante mostra todas as cartas que possui com a exata distância de seu adversário. Se possuir mais cartas daquele número que o defensor, ele vence uma partida. Vence o jogo o primeiro personagem que tiver êxito em três partidas. O placar geral é exibido na tela." /> --> + Date: Thu, 3 May 2018 08:49:02 -0300 Subject: [PATCH 113/169] extra/lirc,src-gui,test: minor bug fix and extra --- extra/lirc/startup.sh | 11 +++++++++++ src-gui/view/BigPictureWindow.cpp | 8 -------- src-gui/view/FullscreenWindow.cpp | 3 +++ tests/test-SigGen-transmission.REMOVED.git-id | 1 + 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100755 extra/lirc/startup.sh create mode 100644 tests/test-SigGen-transmission.REMOVED.git-id diff --git a/extra/lirc/startup.sh b/extra/lirc/startup.sh new file mode 100755 index 000000000..4136d2b10 --- /dev/null +++ b/extra/lirc/startup.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +sudo service lirc start + + +sudo killall irexec +sudo irexec & + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR/../../ +./src-gui/gingagui -b diff --git a/src-gui/view/BigPictureWindow.cpp b/src-gui/view/BigPictureWindow.cpp index dbd065b47..a10a89035 100644 --- a/src-gui/view/BigPictureWindow.cpp +++ b/src-gui/view/BigPictureWindow.cpp @@ -432,14 +432,6 @@ destroy_card_list (gpointer data) void destroy_bigpicture_window () { - if (isPlayingApp) - { - set_unfullscreen_mode (); - isPlayingApp=FALSE; - GINGA->stop(); - return; - } - inBigPictureMode = FALSE; g_source_remove (timeOutTagB); gtk_widget_destroy (bigPictureWindow); diff --git a/src-gui/view/FullscreenWindow.cpp b/src-gui/view/FullscreenWindow.cpp index d5db45a4e..d70636099 100644 --- a/src-gui/view/FullscreenWindow.cpp +++ b/src-gui/view/FullscreenWindow.cpp @@ -106,5 +106,8 @@ set_fullscreen_mode (void) void set_unfullscreen_mode (void) { + if(inBigPictureMode) + GINGA->stop(); + destroy_fullscreen_window (); } diff --git a/tests/test-SigGen-transmission.REMOVED.git-id b/tests/test-SigGen-transmission.REMOVED.git-id new file mode 100644 index 000000000..8639e20fe --- /dev/null +++ b/tests/test-SigGen-transmission.REMOVED.git-id @@ -0,0 +1 @@ +b70b55bbec3291980bedd10c6bdaaf4ddd970300 \ No newline at end of file From 6404d29acd7edf725ecc41bf4f4137d61b1d569d Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 12:58:49 -0300 Subject: [PATCH 114/169] Add XFAIL the use of zOrder region attribute --- lib/Parser.cpp | 26 ++++++++++++++------------ tests/test-Parser-parseBuffer.cpp | 13 +++++++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lib/Parser.cpp b/lib/Parser.cpp index d2904b15e..4736b0ca3 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -460,14 +460,14 @@ static map parser_syntax_table = { ELT_CACHE, { "region", "regionBase" }, { { "id", ATTR_ID }, + { "title", 0 }, { "left", 0 }, { "right", 0 }, { "top", 0 }, { "bottom", 0 }, { "height", 0 }, { "width", 0 }, - { "zIndex", 0 }, - { "title", 0 } } }, // unused + { "zIndex", 0 }} }, // unused }, { "descriptorBase", @@ -484,15 +484,9 @@ static map parser_syntax_table = { ELT_CACHE, { "descriptorBase" }, { { "id", ATTR_ID }, - { "left", 0 }, - { "right", 0 }, - { "top", 0 }, - { "bottom", 0 }, - { "height", 0 }, - { "width", 0 }, - { "zIndex", 0 }, - { "region", ATTR_OPT_IDREF }, + { "player", 0 }, // unused { "explicitDur", 0 }, + { "region", ATTR_OPT_IDREF }, { "freeze", 0 }, { "moveLeft", 0 }, { "moveRight", 0 }, @@ -505,9 +499,17 @@ static map parser_syntax_table = { { "focusSrc", 0 }, { "focusSelSrc", 0 }, { "selBorderColor", 0 }, - { "player", 0 }, // unused { "transIn", 0 }, - { "transOut", 0 } } }, + { "transOut", 0 }, + // extra attributes + { "left", 0 }, + { "right", 0 }, + { "top", 0 }, + { "bottom", 0 }, + { "height", 0 }, + { "width", 0 }, + { "zIndex", 0 }, + }}, }, { "descriptorParam", diff --git a/tests/test-Parser-parseBuffer.cpp b/tests/test-Parser-parseBuffer.cpp index caa775582..ec5ead7c5 100644 --- a/tests/test-Parser-parseBuffer.cpp +++ b/tests/test-Parser-parseBuffer.cpp @@ -125,6 +125,19 @@ main (void) \n\ \n\ \n\ +"); + + XFAIL ("Element at line 4:", "Unknown attribute 'zOrder'", + "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n\ "); // ------------------------------------------------------------------------- From 6485583d41bf5bd83ab0aa8dc2fcc12d5350f1cd Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 13:14:27 -0300 Subject: [PATCH 115/169] tests: Improve test-Ginga-redraw --- tests/test-Ginga-redraw.cpp | 222 ++++++++++++++++++++++++++---------- 1 file changed, 164 insertions(+), 58 deletions(-) diff --git a/tests/test-Ginga-redraw.cpp b/tests/test-Ginga-redraw.cpp index 7b080831e..55c013885 100644 --- a/tests/test-Ginga-redraw.cpp +++ b/tests/test-Ginga-redraw.cpp @@ -21,7 +21,7 @@ along with Ginga. If not, see . */ Formatter *fmt; Media *m1, *m2; int tickCounter; -int width = 800, height = 600; +int WIDTH = 800, HEIGHT = 600; #if GTK_CHECK_VERSION(3, 8, 0) static gboolean @@ -49,8 +49,8 @@ draw_callback (unused (GtkWidget *widget), cairo_t *cr, fmt->redraw (cr); // get center pixel - pixbuf = gdk_pixbuf_get_from_surface (cairo_get_target (cr), 0, 0, width, - height); + pixbuf = gdk_pixbuf_get_from_surface (cairo_get_target (cr), 0, 0, WIDTH, + HEIGHT); n_channels = gdk_pixbuf_get_n_channels (pixbuf); g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB); @@ -59,13 +59,13 @@ draw_callback (unused (GtkWidget *widget), cairo_t *cr, // g_assert (n_channels == 4); g_assert_cmpint (n_channels, ==, 3); - width = gdk_pixbuf_get_width (pixbuf); - height = gdk_pixbuf_get_height (pixbuf); + WIDTH = gdk_pixbuf_get_width (pixbuf); + HEIGHT = gdk_pixbuf_get_height (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf); - x = width / 2; - y = height / 2; + x = WIDTH / 2; + y = HEIGHT / 2; p = pixels + y * rowstride + x * n_channels; red = p[0]; green = p[1]; @@ -73,7 +73,8 @@ draw_callback (unused (GtkWidget *widget), cairo_t *cr, alpha = p[3]; // printf ("\n--------tickCounter=%d\n", tickCounter); - // printf ("center pixel: red=%d, green=%d, blue=%d, \n", red, green, blue); + // printf ("center pixel: red=%d, green=%d, blue=%d, \n", red, green, + // blue); // printf ("m1 state=%d, m1.zIndex=%s, m2 state=%d, m2.zIndex=%s\n", // m1->isOccurring (), m1->getProperty ("zIndex").c_str (), // m2->isOccurring (), m2->getProperty ("zIndex").c_str ()); @@ -116,20 +117,21 @@ draw_callback (unused (GtkWidget *widget), cairo_t *cr, int main (void) { - gtk_init (nullptr, nullptr); - Document *doc; - GtkWidget *app; - GingaOptions opts; - - app = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_assert_nonnull (app); - gtk_window_set_default_size (GTK_WINDOW (app), width, height); - gtk_widget_set_app_paintable (app, TRUE); - g_signal_connect (app, "draw", G_CALLBACK (draw_callback), NULL); - gtk_widget_add_tick_callback (app, (GtkTickCallback) tick_callback, NULL, - NULL); - - tests_parse_and_start (&fmt, &doc, "\ + { + gtk_init (nullptr, nullptr); + Document *doc; + GtkWidget *app; + GingaOptions opts; + + app = gtk_window_new (GTK_WINDOW_TOPLEVEL); + g_assert_nonnull (app); + gtk_window_set_default_size (GTK_WINDOW (app), WIDTH, HEIGHT); + gtk_widget_set_app_paintable (app, TRUE); + g_signal_connect (app, "draw", G_CALLBACK (draw_callback), NULL); + gtk_widget_add_tick_callback (app, (GtkTickCallback) tick_callback, + NULL, NULL); + + tests_parse_and_start (&fmt, &doc, "\ \n\ \n\ \n\ @@ -176,42 +178,146 @@ main (void) \n\ \n"); - Context *body = cast (Context *, doc->getRoot ()); - g_assert_nonnull (body); - Event *body_lambda = body->getLambda (); - g_assert_nonnull (body_lambda); - - m1 = cast (Media *, doc->getObjectById ("m1")); - g_assert_nonnull (m1); - Event *m1_lambda = m1->getLambda (); - g_assert_nonnull (m1_lambda); - - m2 = cast (Media *, doc->getObjectById ("m2")); - g_assert_nonnull (m2); - Event *m2_lambda = m2->getLambda (); - g_assert_nonnull (m2_lambda); - - // -------------------------------- - // check start document - - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - - // when start document, m1 is OCCURRING - fmt->sendTick (0, 0, 0); - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m2_lambda->getState () == Event::OCCURRING); - - // -------------------------------- - // main check - tickCounter = 0; - // gtk_widget_queue_draw (app); - gtk_widget_show_all (app); - gtk_main (); - - delete fmt; + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when start document, m1 is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + tickCounter = 0; + gtk_widget_show_all (app); + gtk_main (); + + delete fmt; + } + + { + gtk_init (nullptr, nullptr); + Document *doc; + GtkWidget *app; + GingaOptions opts; + + app = gtk_window_new (GTK_WINDOW_TOPLEVEL); + g_assert_nonnull (app); + gtk_window_set_default_size (GTK_WINDOW (app), WIDTH, HEIGHT); + gtk_widget_set_app_paintable (app, TRUE); + g_signal_connect (app, "draw", G_CALLBACK (draw_callback), NULL); + gtk_widget_add_tick_callback (app, (GtkTickCallback) tick_callback, + NULL, NULL); + + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when start document, m1 is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + tickCounter = 0; + gtk_widget_show_all (app); + gtk_main (); + + delete fmt; + } exit (EXIT_SUCCESS); } From dee0de1641ec167dc25ef9530fd3a1b6685186e9 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 15:10:55 -0300 Subject: [PATCH 116/169] tests: Improve again test-Ginga-redraw --- tests/test-Ginga-redraw.cpp | 107 ++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/tests/test-Ginga-redraw.cpp b/tests/test-Ginga-redraw.cpp index 55c013885..c1737d434 100644 --- a/tests/test-Ginga-redraw.cpp +++ b/tests/test-Ginga-redraw.cpp @@ -117,6 +117,7 @@ draw_callback (unused (GtkWidget *widget), cairo_t *cr, int main (void) { + // zIndex defined by properties { gtk_init (nullptr, nullptr); Document *doc; @@ -215,6 +216,112 @@ main (void) delete fmt; } + // zIndex defined by region + { + gtk_init (nullptr, nullptr); + Document *doc; + GtkWidget *app; + GingaOptions opts; + + app = gtk_window_new (GTK_WINDOW_TOPLEVEL); + g_assert_nonnull (app); + gtk_window_set_default_size (GTK_WINDOW (app), WIDTH, HEIGHT); + gtk_widget_set_app_paintable (app, TRUE); + g_signal_connect (app, "draw", G_CALLBACK (draw_callback), NULL); + gtk_widget_add_tick_callback (app, (GtkTickCallback) tick_callback, + NULL, NULL); + + tests_parse_and_start (&fmt, &doc, "\ +\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m2); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m2_lambda->getState () == Event::SLEEPING); + + // when start document, m1 is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + tickCounter = 0; + gtk_widget_show_all (app); + gtk_main (); + + delete fmt; + } + + // zIndex defined by descriptor { gtk_init (nullptr, nullptr); Document *doc; From 2e88bab0b2cb190b7c21c7ad43551df9361aac01 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 16:21:48 -0300 Subject: [PATCH 117/169] Rename variables/param from z to zindex --- lib/Media.cpp | 6 +++--- lib/MediaSettings.cpp | 2 +- lib/Player.cpp | 8 ++++---- lib/Player.h | 2 +- tests/test-Media-getZ.cpp | 36 ++++++++++++++++++------------------ 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/Media.cpp b/lib/Media.cpp index fa9d4fcfc..e4705e5f1 100644 --- a/lib/Media.cpp +++ b/lib/Media.cpp @@ -257,7 +257,7 @@ Media::beforeTransition (Event *evt, Event::Transition transition) { Action act = it->first; Event *evt = act.event; - if (act.transition == Event::START + if (act.transition == Event::START && it->second < begin) evt->transition (act.transition); it = _delayed.erase (it); @@ -483,12 +483,12 @@ Media::isFocused () } bool -Media::getZ (int *z, int *zorder) +Media::getZ (int *zindex, int *zorder) { if (this->isSleeping () || _player == nullptr) return false; // nothing to do g_assert_nonnull (_player); - _player->getZ (z, zorder); + _player->getZ (zindex, zorder); return true; } diff --git a/lib/MediaSettings.cpp b/lib/MediaSettings.cpp index 748b456da..18eea2e36 100644 --- a/lib/MediaSettings.cpp +++ b/lib/MediaSettings.cpp @@ -73,7 +73,7 @@ MediaSettings::isFocused () } bool -MediaSettings::getZ (unused (int *z), unused (int *zorder)) +MediaSettings::getZ (unused (int *zindex), unused (int *zorder)) { return false; } diff --git a/lib/Player.cpp b/lib/Player.cpp index 137cb72db..8160f7f1d 100644 --- a/lib/Player.cpp +++ b/lib/Player.cpp @@ -192,9 +192,9 @@ Player::getState () } void -Player::getZ (int *z, int *zorder) +Player::getZ (int *zindex, int *zorder) { - tryset (z, _prop.z); + tryset (zindex, _prop.zindex); tryset (zorder, _prop.zorder); } @@ -711,7 +711,7 @@ Player::doSetProperty (Property code, unused (const string &name), } case PROP_Z_INDEX: { - _prop.z = xstrtoint (value, 10); + _prop.zindex = xstrtoint (value, 10); break; } case PROP_Z_ORDER: @@ -786,7 +786,7 @@ Player::redrawDebuggingInfo (cairo_t *cr) str = xstrbuild ("%s:%.1fs\n%dx%d:(%d,%d):%d", id.c_str (), ((double) GINGA_TIME_AS_MSECONDS (_time)) / 1000., _prop.rect.width, _prop.rect.height, _prop.rect.x, - _prop.rect.y, _prop.z); + _prop.rect.y, _prop.zindex); debug = PlayerText::renderSurface ( str, "monospace", "", "", "7", { 1., 0, 0, 1. }, { 0, 0, 0, .75 }, diff --git a/lib/Player.h b/lib/Player.h index 852d790b6..588575dcc 100644 --- a/lib/Player.h +++ b/lib/Player.h @@ -147,7 +147,7 @@ class Player bool debug; // true if debugging mode is on bool visible; // true if visible guint8 alpha; // alpha - int z; // z-index + int zindex; // z-index int zorder; // z-order string focusIndex; // focus index string type; // content mime-type diff --git a/tests/test-Media-getZ.cpp b/tests/test-Media-getZ.cpp index 73e0dc688..62b1061b5 100644 --- a/tests/test-Media-getZ.cpp +++ b/tests/test-Media-getZ.cpp @@ -24,8 +24,8 @@ main (void) { Formatter *fmt; Document *doc; - int m1_z, m1_zorder; - int m2_z, m2_zorder; + int m1_zindex, m1_zorder; + int m2_zindex, m2_zorder; tests_parse_and_start (&fmt, &doc, xstrbuild ("\ @@ -106,30 +106,30 @@ main (void) // main check g_assert (m1->getProperty ("zIndex") == "1"); g_assert (m2->getProperty ("zIndex") == "2"); - g_assert_true (m1->getZ (&m1_z, &m1_zorder)); - g_assert_cmpint (m1_z, ==, 1); - g_assert_true (m2->getZ (&m2_z, &m2_zorder)); - g_assert_cmpint (m2_z, ==, 2); + g_assert_true (m1->getZ (&m1_zindex, &m1_zorder)); + g_assert_cmpint (m1_zindex, ==, 1); + g_assert_true (m2->getZ (&m2_zindex, &m2_zorder)); + g_assert_cmpint (m2_zindex, ==, 2); fmt->sendTick (1 * GINGA_SECOND, 1 * GINGA_SECOND, 0); g_assert (m1->getProperty ("zIndex") == "2"); g_assert (m2->getProperty ("zIndex") == "1"); - g_assert_true (m1->getZ (&m1_z, &m1_zorder)); - g_assert_true (m2->getZ (&m2_z, &m2_zorder)); - g_assert_true (m1->getZ (&m1_z, &m1_zorder)); - g_assert_cmpint (m1_z, ==, 2); - g_assert_true (m2->getZ (&m2_z, &m2_zorder)); - g_assert_cmpint (m2_z, ==, 1); + g_assert_true (m1->getZ (&m1_zindex, &m1_zorder)); + g_assert_true (m2->getZ (&m2_zindex, &m2_zorder)); + g_assert_true (m1->getZ (&m1_zindex, &m1_zorder)); + g_assert_cmpint (m1_zindex, ==, 2); + g_assert_true (m2->getZ (&m2_zindex, &m2_zorder)); + g_assert_cmpint (m2_zindex, ==, 1); fmt->sendTick (1 * GINGA_SECOND, 1 * GINGA_SECOND, 0); g_assert (m1->getProperty ("zIndex") == "1"); g_assert (m2->getProperty ("zIndex") == "1"); - g_assert_true (m1->getZ (&m1_z, &m1_zorder)); - g_assert_true (m2->getZ (&m2_z, &m2_zorder)); - g_assert_true (m1->getZ (&m1_z, &m1_zorder)); - g_assert_cmpint (m1_z, ==, 1); - g_assert_true (m2->getZ (&m2_z, &m2_zorder)); - g_assert_cmpint (m2_z, ==, 1); + g_assert_true (m1->getZ (&m1_zindex, &m1_zorder)); + g_assert_true (m2->getZ (&m2_zindex, &m2_zorder)); + g_assert_true (m1->getZ (&m1_zindex, &m1_zorder)); + g_assert_cmpint (m1_zindex, ==, 1); + g_assert_true (m2->getZ (&m2_zindex, &m2_zorder)); + g_assert_cmpint (m2_zindex, ==, 1); delete fmt; } From 3388f19002712ea6ec65e3b20be4dd129c3a82d6 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 16:27:00 -0300 Subject: [PATCH 118/169] tests: Add test-aux-xstrtoull --- .gitignore | 1 + tests/Makefile.am | 3 +++ tests/test-aux-xstrtoull.cpp | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 tests/test-aux-xstrtoull.cpp diff --git a/.gitignore b/.gitignore index 77cb1430b..454c98db1 100644 --- a/.gitignore +++ b/.gitignore @@ -202,6 +202,7 @@ /tests/test-aux-xstrtod /tests/test-aux-xstrtodorpercent /tests/test-aux-xstrtoll +/tests/test-aux-xstrtoull /tests/test-aux-xstrup /tests/test-aux-xurifromsrc /tests/test-aux-xurigetcontents diff --git a/tests/Makefile.am b/tests/Makefile.am index 4ecf9aab1..d47a8ad92 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -144,6 +144,9 @@ test_aux_xstrtod_SOURCES= test-aux-xstrtod.cpp progs+= test-aux-xstrtoll test_aux_xstrtoll_SOURCES= test-aux-xstrtoll.cpp +progs+= test-aux-xstrtoull +test_aux_xstrtoull_SOURCES= test-aux-xstrtoull.cpp + progs+= test-aux-xstrassign test_aux_xstrassign_SOURCES= test-aux-xstrassign.cpp diff --git a/tests/test-aux-xstrtoull.cpp b/tests/test-aux-xstrtoull.cpp new file mode 100644 index 000000000..54291d782 --- /dev/null +++ b/tests/test-aux-xstrtoull.cpp @@ -0,0 +1,34 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +int +main (void) +{ + guint64 ip; + + g_assert_true (_xstrtoull ("1", &ip, 10)); + g_assert_true (_xstrtoull (" 1", &ip, 10)); + g_assert_true (_xstrtoull ("50", &ip, 10)); + g_assert_true (_xstrtoull ("1 ", &ip, 10)); + g_assert_false (_xstrtoull ("", &ip, 10)); + g_assert_false (_xstrtoull ("a", &ip, 10)); + g_assert_false (_xstrtoull (" a", &ip, 10)); + + exit (EXIT_SUCCESS); +} From c9dc523f9f0832aecbcdeb7b09a6cb79d3a051c5 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 19:08:31 -0300 Subject: [PATCH 119/169] lib: Add evts states to Media::toString and remove duplicated info --- lib/Media.cpp | 6 ------ lib/Object.cpp | 14 ++++++++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Media.cpp b/lib/Media.cpp index e4705e5f1..a3352977c 100644 --- a/lib/Media.cpp +++ b/lib/Media.cpp @@ -54,12 +54,6 @@ Media::toString () string uri; str = Object::toString (); - type = _properties["type"]; - if (type != "") - str += " type: " + type + "\n"; - uri = _properties["uri"]; - if (uri != "") - str += " uri: " + uri + "\n"; str += xstrbuild (" player: %p\n", _player); return str; diff --git a/lib/Object.cpp b/lib/Object.cpp index fdf437050..b383161c9 100644 --- a/lib/Object.cpp +++ b/lib/Object.cpp @@ -121,13 +121,19 @@ Object::toString () switch (evt->getType ()) { case Event::PRESENTATION: - pres.push_back (evt->getId ()); + pres.push_back (evt->getId () + " (" + + Event::getEventStateAsString (evt->getState ()) + + ')'); break; case Event::ATTRIBUTION: - attr.push_back (evt->getId ()); + attr.push_back (evt->getId () + " (" + + Event::getEventStateAsString (evt->getState ()) + + ')'); break; case Event::SELECTION: - sel.push_back (evt->getId ()); + sel.push_back (evt->getId () + " (" + + Event::getEventStateAsString (evt->getState ()) + + ')'); break; default: g_assert_not_reached (); @@ -174,7 +180,7 @@ Object::hasAlias (const string &alias) } void -Object::addAlias (const string &alias, Composition * parent) +Object::addAlias (const string &alias, Composition *parent) { auto alias_pair = make_pair (alias, parent); // _aliases.push_back (alias_pair); From 416922304cf4c7227c3768156ed893b0d573be1e Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 19:20:46 -0300 Subject: [PATCH 120/169] lib: Add time in TRACE inside afterTransition functions --- lib/Context.cpp | 15 ++++++++++----- lib/Document.cpp | 5 ++--- lib/Switch.cpp | 21 +++++++++++++-------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/lib/Context.cpp b/lib/Context.cpp index 9aa132c7d..4f1ca9ee0 100644 --- a/lib/Context.cpp +++ b/lib/Context.cpp @@ -262,21 +262,26 @@ Context::afterTransition (Event *evt, Event::Transition transition) this->addDelayedAction (port, Event::START, "", 0); } evt->setParameter ("fromport", ""); - TRACE ("start %s", evt->getFullId ().c_str ()); + TRACE ("start %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); break; case Event::PAUSE: - TRACE ("pause %s", evt->getFullId ().c_str ()); + TRACE ("pause %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); break; case Event::RESUME: - TRACE ("resume %s", evt->getFullId ().c_str ()); + TRACE ("resume %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); break; case Event::STOP: + TRACE ("stop %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); Object::doStop (); - TRACE ("stop %s", evt->getFullId ().c_str ()); break; case Event::ABORT: + TRACE ("abort %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); Object::doStop (); - TRACE ("abort %s", evt->getFullId ().c_str ()); break; default: g_assert_not_reached (); diff --git a/lib/Document.cpp b/lib/Document.cpp index e92c3cc68..df86a57bc 100644 --- a/lib/Document.cpp +++ b/lib/Document.cpp @@ -296,10 +296,9 @@ Document::evalAction (Action init) evt = act.event; g_assert_nonnull (evt); - TRACE ("next stacked Action: event=%s transtion=%s value=%s", - act.event->getFullId ().c_str (), + TRACE ("trigger stacked action: %s %s", Event::getEventTransitionAsString (act.transition).c_str (), - act.value.c_str ()); + act.event->getFullId ().c_str ()); evt->setParameter ("duration", act.duration); if (evt->getType () == Event::ATTRIBUTION) diff --git a/lib/Switch.cpp b/lib/Switch.cpp index 1f997d8af..aae702160 100644 --- a/lib/Switch.cpp +++ b/lib/Switch.cpp @@ -174,23 +174,28 @@ Switch::afterTransition (Event *evt, Event::Transition transition) { case Event::START: Object::doStart (); - TRACE ("start %s", evt->getFullId ().c_str ()); + TRACE ("start %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); if (_selected == nullptr) _doc->evalAction (evt, Event::STOP); break; - case Event::PAUSE: - TRACE ("pause %s", evt->getFullId ().c_str ()); + TRACE ("pause %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); break; - case Event::RESUME: - TRACE ("resume %s", evt->getFullId ().c_str ()); + TRACE ("resume %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); break; - - case Event::ABORT: case Event::STOP: + TRACE ("stop %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); + Object::doStop (); + break; + case Event::ABORT: + TRACE ("abort %s at %" GINGA_TIME_FORMAT, + evt->getFullId ().c_str (), GINGA_TIME_ARGS (_time)); Object::doStop (); - TRACE ("stop %s", evt->getFullId ().c_str ()); break; default: From a66bf5e8a1159997de846b00182688c508b12833 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 19:43:44 -0300 Subject: [PATCH 121/169] tests-ncl: Refctory test-refer-{1,2,3}.ncl --- tests-ncl/test-refer-1.ncl | 3 +-- tests-ncl/test-refer-2.ncl | 3 +-- tests-ncl/test-refer-3.ncl | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests-ncl/test-refer-1.ncl b/tests-ncl/test-refer-1.ncl index a396788d7..3a87fe45d 100644 --- a/tests-ncl/test-refer-1.ncl +++ b/tests-ncl/test-refer-1.ncl @@ -3,10 +3,9 @@ - - + \ No newline at end of file diff --git a/tests-ncl/test-refer-2.ncl b/tests-ncl/test-refer-2.ncl index 8f41756e4..bda2ec9d7 100644 --- a/tests-ncl/test-refer-2.ncl +++ b/tests-ncl/test-refer-2.ncl @@ -3,10 +3,9 @@ - - + \ No newline at end of file diff --git a/tests-ncl/test-refer-3.ncl b/tests-ncl/test-refer-3.ncl index 36523e53b..70836f43c 100644 --- a/tests-ncl/test-refer-3.ncl +++ b/tests-ncl/test-refer-3.ncl @@ -2,11 +2,10 @@ - + - - + \ No newline at end of file From fd81f6aeefab77713286ff4745319fd1de6add29 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 19:46:01 -0300 Subject: [PATCH 122/169] lib: Fix parsing when an referenced Media not exist and create it --- lib/Parser.cpp | 83 +++++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/lib/Parser.cpp b/lib/Parser.cpp index 4736b0ca3..a599fc9c1 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -467,7 +467,7 @@ static map parser_syntax_table = { { "bottom", 0 }, { "height", 0 }, { "width", 0 }, - { "zIndex", 0 }} }, // unused + { "zIndex", 0 } } }, // unused }, { "descriptorBase", @@ -483,33 +483,34 @@ static map parser_syntax_table = { nullptr, ELT_CACHE, { "descriptorBase" }, - { { "id", ATTR_ID }, - { "player", 0 }, // unused - { "explicitDur", 0 }, - { "region", ATTR_OPT_IDREF }, - { "freeze", 0 }, - { "moveLeft", 0 }, - { "moveRight", 0 }, - { "moveUp", 0 }, - { "moveDown", 0 }, - { "focusIndex", 0 }, - { "focusBorderColor", 0 }, - { "focusBorderWidth", 0 }, - { "focusBorderTransparency", 0 }, - { "focusSrc", 0 }, - { "focusSelSrc", 0 }, - { "selBorderColor", 0 }, - { "transIn", 0 }, - { "transOut", 0 }, - // extra attributes - { "left", 0 }, - { "right", 0 }, - { "top", 0 }, - { "bottom", 0 }, - { "height", 0 }, - { "width", 0 }, - { "zIndex", 0 }, - }}, + { + { "id", ATTR_ID }, + { "player", 0 }, // unused + { "explicitDur", 0 }, + { "region", ATTR_OPT_IDREF }, + { "freeze", 0 }, + { "moveLeft", 0 }, + { "moveRight", 0 }, + { "moveUp", 0 }, + { "moveDown", 0 }, + { "focusIndex", 0 }, + { "focusBorderColor", 0 }, + { "focusBorderWidth", 0 }, + { "focusBorderTransparency", 0 }, + { "focusSrc", 0 }, + { "focusSelSrc", 0 }, + { "selBorderColor", 0 }, + { "transIn", 0 }, + { "transOut", 0 }, + // extra attributes + { "left", 0 }, + { "right", 0 }, + { "top", 0 }, + { "bottom", 0 }, + { "height", 0 }, + { "width", 0 }, + { "zIndex", 0 }, + } }, }, { "descriptorParam", @@ -3866,7 +3867,22 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) // case is an already referred Media if (st->referMapIndex (id, &media)) { + // case src filled + if (src != "") + { + // Makes uri based in the main document uri + xmlChar *s = xmlBuildURI (toXmlChar (src), + toXmlChar (st->getURI ())); + src = toCPPString (s); + // If fails makes the uri based in the current dir + if (!xpathisuri (src) && !xpathisabs (src)) + { + src = xpathmakeabs (src); + } + xmlFree (s); + } media->setProperty ("uri", src); + media->setProperty ("type", type); } // case is an MediaSettings else if (type == "application/x-ginga-settings") @@ -3894,16 +3910,13 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) else { // if referenced Media not existing yet, create it - media = new Media (id); - media->setProperty ("uri", src); - media->setProperty ("type", type); + media = new Media (refer); parent = cast (Composition *, st->objStackPeek ()); g_assert_nonnull (parent); - parent->addChild (media); - media->addAlias (refer); - st->referMapAdd (refer, media); - g_assert (st->referMapAdd (id, media)); + parent->addChild (media); + media->addAlias (id); + g_assert (st->referMapAdd (refer, media)); } } // case src filled or empty (timer) From fc52a88b06d88fb7d16f5720afc25b92928f1d2f Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Thu, 3 May 2018 20:07:39 -0300 Subject: [PATCH 123/169] Add test-Media-refer --- .gitignore | 1 + tests/Makefile.am | 3 + tests/test-Media-refer.cpp | 118 +++++++++++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 tests/test-Media-refer.cpp diff --git a/.gitignore b/.gitignore index 454c98db1..dfe94e6e7 100644 --- a/.gitignore +++ b/.gitignore @@ -152,6 +152,7 @@ /tests/test-Ginga-redraw /tests/test-Media-new /tests/test-Media-getZ +/tests/test-Media-refer /tests/test-Media-link-onSelection /tests/test-Media-4grid /tests/test-Media-mime diff --git a/tests/Makefile.am b/tests/Makefile.am index d47a8ad92..d2b5be1b2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -255,6 +255,9 @@ test_Media_getZ_SOURCES= test-Media-getZ.cpp progs+= test-Media-explicitDur test_Media_explicitDur_SOURCES= test-Media-explicitDur.cpp +progs+= test-Media-refer +test_Media_refer_SOURCES= test-Media-refer.cpp + progs+= test-Media-nested-explicitDur test_Media_nested_explicitDur_SOURCES= test-Media-nested-explicitDur.cpp diff --git a/tests/test-Media-refer.cpp b/tests/test-Media-refer.cpp new file mode 100644 index 000000000..b702c7e04 --- /dev/null +++ b/tests/test-Media-refer.cpp @@ -0,0 +1,118 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +vector ncl_with_refer_samples = { + // media followed by refer and start media + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // media followed by refer and start refer + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // refer followed by media and start media + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // refer followed by media and start refer + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n" +}; + +int +main (void) +{ + for (guint i = 0; i < ncl_with_refer_samples.size (); i++) + { + Formatter *fmt; + Document *doc; + tests_parse_and_start (&fmt, &doc, ncl_with_refer_samples[i]); + + Context *body = cast (Context *, doc->getRoot ()); + g_assert_nonnull (body); + Event *body_lambda = body->getLambda (); + g_assert_nonnull (body_lambda); + + Media *m1 = cast (Media *, doc->getObjectById ("m1")); + g_assert_nonnull (m1); + Event *m1_lambda = m1->getLambda (); + g_assert_nonnull (m1_lambda); + + Media *r1 = cast (Media *, doc->getObjectByIdOrAlias ("r1")); + g_assert_nonnull (r1); + Event *r1_lambda = r1->getLambda (); + g_assert_nonnull (r1_lambda); + + // -------------------------------- + // check start document + + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (r1_lambda->getState () == Event::SLEEPING); + + // when start document, m1 is OCCURRING + fmt->sendTick (0, 0, 0); + g_assert (body_lambda->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::OCCURRING); + g_assert (r1_lambda->getState () == Event::OCCURRING); + + // -------------------------------- + // main check + + g_assert (m1->getProperty ("uri") == r1->getProperty ("uri")); + g_assert (m1->getProperty ("background") + == r1->getProperty ("background")); + delete fmt; + } + + exit (EXIT_SUCCESS); +} From 63b02c502c97008e1f68d7a7ea4fc0e57b880e29 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 4 May 2018 12:43:53 -0300 Subject: [PATCH 124/169] tests: Improve test-Media-refer with context and link tests --- tests/test-Media-refer.cpp | 600 +++++++++++++++++++++++++++++++++++-- 1 file changed, 581 insertions(+), 19 deletions(-) diff --git a/tests/test-Media-refer.cpp b/tests/test-Media-refer.cpp index b702c7e04..b41dcfa87 100644 --- a/tests/test-Media-refer.cpp +++ b/tests/test-Media-refer.cpp @@ -2,7 +2,7 @@ This file is part of Ginga (Ginga-NCL). -Ginga is free software: you can redistribute it and/or modify it +Ginga is free software: you can yistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. @@ -18,52 +18,608 @@ along with Ginga. If not, see . */ #include "tests.h" vector ncl_with_refer_samples = { - // media followed by refer and start media + // referred object: defined first + // reference: defined after + // init document: start referred object + // link on: referred object "\n\ - \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ - \n\ + \n\ \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n", - // media followed by refer and start refer + // referred object: defined first + // reference: defined after + // init document: start referred object + // link on: reference "\n\ - \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first + // reference: defined after + // init document: start reference + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ - \n\ + \n\ \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n", - // refer followed by media and start media + // referred object: defined first + // reference: defined after + // init document: start reference + // link on: reference "\n\ - \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined after + // reference: defined first + // init document: start referred object + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ - \n\ + \n\ \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n", - // refer followed by media and start refer + // referred object: defined after + // reference: defined first + // init document: start referred object + // link on: reference "\n\ - \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined after + // reference: defined first + // init document: start reference + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n\ - \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined after + // reference: defined first + // init document: start reference + // link on: reference + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first + // reference: defined after in nested context + // init document: start referred object + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first + // reference: defined after in nested context + // init document: start referred object + // link on: reference + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first + // reference: defined after in nested context + // init document: start reference + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first + // reference: defined after in nested context + // init document: start reference + // link on: reference + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ - \n\ + \n\ \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first in nested context + // reference: defined after + // init document: start referred object + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first in nested context + // reference: defined after + // init document: start referred object + // link on: reference + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first in nested context + // reference: defined after + // init document: start reference + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first in nested context + // reference: defined after + // init document: start reference + // link on: reference + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first in nested context + // reference: defined after in nested context + // init document: start referred object + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first in nested context + // reference: defined after in nested context + // init document: start referred object + // link on: reference + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first in nested context + // reference: defined after in nested context + // init document: start reference + // link on: referred object + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n", + // referred object: defined first in nested context + // reference: defined after in nested context + // init document: start reference + // link on: reference + "\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ \n\ \n" }; @@ -92,6 +648,11 @@ main (void) Event *r1_lambda = r1->getLambda (); g_assert_nonnull (r1_lambda); + Media *m2 = cast (Media *, doc->getObjectById ("m2")); + g_assert_nonnull (m1); + Event *m2_lambda = m2->getLambda (); + g_assert_nonnull (m2_lambda); + // -------------------------------- // check start document @@ -104,13 +665,14 @@ main (void) g_assert (body_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::OCCURRING); g_assert (r1_lambda->getState () == Event::OCCURRING); + g_assert (m2_lambda->getState () == Event::OCCURRING); // -------------------------------- // main check g_assert (m1->getProperty ("uri") == r1->getProperty ("uri")); - g_assert (m1->getProperty ("background") - == r1->getProperty ("background")); + g_assert (m1->getProperty ("x") == r1->getProperty ("x")); + g_assert (m1->getProperty ("x") == "z"); delete fmt; } From f18e2c9a6e2f5fc69b3dbdc24affe957b69956f3 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 4 May 2018 18:30:26 -0300 Subject: [PATCH 125/169] tests: Refactory test-{Media,Context,Switch}-transition --- tests/test-Context-transition-attribution.cpp | 2 +- .../test-Context-transition-presentation.cpp | 50 ++++++------- tests/test-Context-transition-selection.cpp | 8 +- tests/test-Media-transition-attribution.cpp | 2 +- tests/test-Media-transition-presentation.cpp | 75 ++++++++----------- tests/test-Media-transition-selection.cpp | 14 ++-- tests/test-Switch-transition-presentation.cpp | 10 +-- 7 files changed, 75 insertions(+), 86 deletions(-) diff --git a/tests/test-Context-transition-attribution.cpp b/tests/test-Context-transition-attribution.cpp index ebaa41c5a..c51fec993 100644 --- a/tests/test-Context-transition-attribution.cpp +++ b/tests/test-Context-transition-attribution.cpp @@ -41,7 +41,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // START AttributionEvent is done and return true + // START is done g_assert_true (c1_prop->transition (Event::START)); // after START AttributionEvent is OCCURRING diff --git a/tests/test-Context-transition-presentation.cpp b/tests/test-Context-transition-presentation.cpp index 8484d55bd..bc338db6c 100644 --- a/tests/test-Context-transition-presentation.cpp +++ b/tests/test-Context-transition-presentation.cpp @@ -30,7 +30,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // ABORT is done and return true + // ABORT is done g_assert_true (c1_lambda->transition (Event::ABORT)); // after ABORT c1_lambda, m1_lambda and m2_lambda are SLEEPING @@ -55,7 +55,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // PAUSE is done and return true + // PAUSE is done g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE, c1_lambda, m1_lambda and m2_lambda are PAUSED @@ -66,7 +66,7 @@ main (void) g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - // ABORT is done and return true + // ABORT is done g_assert_true (c1_lambda->transition (Event::ABORT)); // after ABORT c1_lambda, m1_lambda and m2_lambda are SLEEPING @@ -90,7 +90,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // STOP is done and return true + // STOP is done g_assert_true (c1_lambda->transition (Event::STOP)); // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING @@ -101,7 +101,7 @@ main (void) g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // ABORT is not done and return false + // ABORT is not done g_assert_false (c1_lambda->transition (Event::ABORT)); // after ABORT c1_lambda, m1_lambda and m2_lambda are still SLEEPING @@ -125,7 +125,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // PAUSE is done and return true + // PAUSE is done g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED @@ -149,7 +149,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // PAUSE is done and return true + // PAUSE is done g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED @@ -159,7 +159,7 @@ main (void) g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - // PAUSE is not done and return false + // PAUSE is not done g_assert_false (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are still PAUSED @@ -183,7 +183,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // STOP is done and return true + // STOP is done g_assert_true (c1_lambda->transition (Event::STOP)); // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING @@ -194,7 +194,7 @@ main (void) g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // PAUSE is not done and return false + // PAUSE is not done g_assert_false (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda still SLEEPING @@ -218,7 +218,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // RESUME is done and return true + // RESUME is done g_assert_false (c1_lambda->transition (Event::RESUME)); // after RESUME, anchors events go to OCCURRING @@ -243,7 +243,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // PAUSE is done and return true + // PAUSE is done g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE, anchors events go to PAUSED @@ -254,7 +254,7 @@ main (void) g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - // RESUME is done and return true + // RESUME is done g_assert_true (c1_lambda->transition (Event::RESUME)); // after RESUME, anchors events go to OCCURRING @@ -278,7 +278,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // STOP is done and return true + // STOP is done g_assert_true (c1_lambda->transition (Event::STOP)); // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING @@ -289,7 +289,7 @@ main (void) g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // RESUME is not done and return false + // RESUME is not done g_assert_false (c1_lambda->transition (Event::RESUME)); // after PAUSE c1_lambda, m1_lambda and m2_lambda still SLEEPING @@ -313,7 +313,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // START is not done and return false + // START is not done g_assert_false (c1_lambda->transition (Event::START)); // after start, c1_lambda, m1_lambda and m2_lambda are PAUSED @@ -338,7 +338,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // PAUSE is done and return true + // PAUSE is done g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED @@ -348,7 +348,7 @@ main (void) g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - // START is done and return true + // START is done g_assert_true (c1_lambda->transition (Event::START)); // after start, c1_lambda, m1_lambda and m2_lambda are PAUSED @@ -381,7 +381,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // STOP is done and return true + // STOP is done g_assert (c1_lambda->transition (Event::STOP)); // after STOP, c1_lambda, m1_lambda and m2_lambda are PAUSED @@ -392,7 +392,7 @@ main (void) g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // START is done and return true + // START is done g_assert_true (c1_lambda->transition (Event::START)); // after START, c1_lambda is SLEEPING @@ -424,7 +424,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // STOP is done and return true + // STOP is done g_assert_true (c1_lambda->transition (Event::STOP)); // after STOP c1_lambda, m1_lambda and m2_lambda are SLEEPING @@ -448,7 +448,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // PAUSE is done and return true + // PAUSE is done g_assert_true (c1_lambda->transition (Event::PAUSE)); // after PAUSE c1_lambda, m1_lambda and m2_lambda are PAUSED @@ -458,7 +458,7 @@ main (void) g_assert (m1_lambda->getState () == Event::PAUSED); g_assert (m2_lambda->getState () == Event::PAUSED); - // STOP is done and return true + // STOP is done g_assert_true (c1_lambda->transition (Event::STOP)); // after STOP c1_lambda, m1_lambda and m2_lambda are still SLEEPING @@ -482,7 +482,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // STOP is done and return true + // STOP is done g_assert (c1_lambda->transition (Event::STOP)); // after STOP c1_lambda, m1_lambda and m2_lambda SLEEPING @@ -493,7 +493,7 @@ main (void) g_assert (m1_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // STOP is not done and return false + // STOP is not done g_assert_false (c1_lambda->transition (Event::STOP)); // after STOP c1_lambda, m1_lambda and m2_lambda still SLEEPING diff --git a/tests/test-Context-transition-selection.cpp b/tests/test-Context-transition-selection.cpp index 90b15bcb3..47fa74acc 100644 --- a/tests/test-Context-transition-selection.cpp +++ b/tests/test-Context-transition-selection.cpp @@ -40,7 +40,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // ABORT is not done and return false + // ABORT is not done g_assert_false (c1_sel->transition (Event::ABORT)); // after advance time, c1_sel is SLEEPING @@ -75,7 +75,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // PAUSE is not done and return false + // PAUSE is not done g_assert_false (c1_sel->transition (Event::PAUSE)); // after advance time, c1_sel is SLEEPING @@ -109,7 +109,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // START is not done and return false + // START is not done g_assert_false (c1_sel->transition (Event::START)); // after advance time, c1_sel is SLEEPING @@ -144,7 +144,7 @@ main (void) &fmt, &body_lambda, &c1_lambda, &c1_prop, &c1_sel, &m1_lambda, &m2_lambda); - // STOP is not done and return false + // STOP is not done g_assert_false (c1_sel->transition (Event::STOP)); // after advance time, c1_sel is SLEEPING diff --git a/tests/test-Media-transition-attribution.cpp b/tests/test-Media-transition-attribution.cpp index 258dc47d7..8e68ea5d6 100644 --- a/tests/test-Media-transition-attribution.cpp +++ b/tests/test-Media-transition-attribution.cpp @@ -39,7 +39,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // START is done and return true + // START is done g_assert_true (m1_prop->transition (Event::START)); // after START m1_lambada and m1_anchor_0s are OCCURRING diff --git a/tests/test-Media-transition-presentation.cpp b/tests/test-Media-transition-presentation.cpp index 98530022f..2c54df4b2 100644 --- a/tests/test-Media-transition-presentation.cpp +++ b/tests/test-Media-transition-presentation.cpp @@ -28,8 +28,8 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // ABORT is done and return true - g_assert (m1_lambda->transition (Event::ABORT)); + // ABORT is done + g_assert_true (m1_lambda->transition (Event::ABORT)); // after ABORT all events are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); @@ -50,7 +50,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // PAUSE is done and return true + // PAUSE is done g_assert_true (m1_lambda->transition (Event::PAUSE)); // after PAUSE, m1_lambda and m1_anchor0s are PAUSED @@ -61,7 +61,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // PAUSE is done and return true + // PAUSE is done g_assert_true (m1_lambda->transition (Event::ABORT)); // after PAUSE, all events are SLEEPING @@ -83,7 +83,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // STOP is done and return true + // STOP is done g_assert_true (m1_lambda->transition (Event::STOP)); // after STOP all events are SLEEPING @@ -94,7 +94,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // ABORT is not done and return false + // ABORT is not done g_assert_false (m1_lambda->transition (Event::ABORT)); // after ABORT all events are still SLEEPING @@ -118,7 +118,7 @@ main (void) // -------------------------------- // main check - // PAUSE is done and return true + // PAUSE is done g_assert_true (m1_lambda->transition (Event::PAUSE)); // after PAUSE, m1_lambda and m1_anchor0s are PAUSED @@ -140,7 +140,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // PAUSE is done and return true + // PAUSE is done g_assert_true (m1_lambda->transition (Event::PAUSE)); // after PAUSE, m1_lambda and m1_anchor0s are PAUSED @@ -151,7 +151,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // PAUSE is done and return false + // PAUSE is done g_assert_false (m1_lambda->transition (Event::PAUSE)); // after PAUSE, m1_lambda and m1_anchor0s are still PAUSED @@ -173,7 +173,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // STOP is done and return true + // STOP is done g_assert_true (m1_lambda->transition (Event::STOP)); // after STOP all events are SLEEPING @@ -184,7 +184,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // PAUSE is not done and return false + // PAUSE is not done g_assert_false (m1_lambda->transition (Event::PAUSE)); // after PAUSE, m1_lambda and m1_anchor0s are still SLEEPING @@ -206,7 +206,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // RESUME is not done and return false + // RESUME is not done g_assert_false (m1_lambda->transition (Event::RESUME)); // after RESUME m1_lambda and m1_anchor_0s are OCCURRING @@ -228,7 +228,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // PAUSE is done and return true + // PAUSE is done g_assert (m1_lambda->transition (Event::PAUSE)); // after PAUSE, m1_lambda and m1_anchor0s are PAUSED @@ -239,7 +239,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // RESUME is done and return true + // RESUME is done g_assert (m1_lambda->transition (Event::RESUME)); // after RESUME m1_lambda and m1_anchor_0s are OCCURRING @@ -253,7 +253,7 @@ main (void) delete fmt; } - // START lambda from state PAUSED + // START lambda from state SLEEPING { Formatter *fmt; Event *body_lambda, *m1_lambda, *m1_anchor_0s, *m1_label, *m1_prop, *m1_sel; @@ -261,35 +261,24 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // PAUSE is done and return true - g_assert (m1_lambda->transition (Event::PAUSE)); - - // after PAUSE, m1_lambda and m1_anchor0s are PAUSED - g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::PAUSED); - g_assert (m1_anchor_0s->getState () == Event::PAUSED); - g_assert (m1_label->getState () == Event::SLEEPING); - g_assert (m1_prop->getState () == Event::SLEEPING); - g_assert (m1_sel->getState () ==Event::SLEEPING); - - // START is done and return true - g_assert_true (m1_lambda->transition (Event::START)); + // STOP is done + g_assert_true (m1_lambda->transition (Event::STOP)); - // after START m1_lambda is OCCURRING + // after STOP all events are SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_anchor_0s->getState () == Event::PAUSED); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // advance time - fmt->sendTick (0, 0, 0); + // RESUME is not done + g_assert_false (m1_lambda->transition (Event::RESUME)); - // when advance time, m1_anchor_0s is OCCURRING + // after RESUME all events are still SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::OCCURRING); - g_assert (m1_anchor_0s->getState () == Event::OCCURRING); + g_assert (m1_lambda->getState () == Event::SLEEPING); + g_assert (m1_anchor_0s->getState () == Event::SLEEPING); g_assert (m1_label->getState () == Event::SLEEPING); g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); @@ -305,7 +294,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // STOP is done and return true + // STOP is done g_assert_true (m1_lambda->transition (Event::STOP)); // after STOP m1_lambada and m1_anchor_0s are SLEEPING @@ -316,7 +305,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // START is done and return true + // START is done g_assert_true (m1_lambda->transition (Event::START)); // after START m1_lambada and m1_anchor_0s are OCCURRING @@ -349,7 +338,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // STOP is done and return true + // STOP is done g_assert_true (m1_lambda->transition (Event::STOP)); // after STOP all events are SLEEPING @@ -371,7 +360,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // PAUSE is done and return true + // PAUSE is done g_assert_true (m1_lambda->transition (Event::PAUSE)); // after PAUSE, m1_lambda and m1_anchor_0s are PAUSED @@ -382,7 +371,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // STOP is done and return true + // STOP is done g_assert_true (m1_lambda->transition (Event::STOP)); // after STOP all events are SLEEPING @@ -404,7 +393,7 @@ main (void) tests_create_document_with_media_and_start ( &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // STOP is done and return true + // STOP is done g_assert_true (m1_lambda->transition (Event::STOP)); // after STOP, m1_lambda and m1_anchor_0s are SLEEPING @@ -415,7 +404,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () ==Event::SLEEPING); - // STOP is not done and return false + // STOP is not done g_assert_false (m1_lambda->transition (Event::STOP)); // after STOP, m1_lambda and m1_anchor_0s are still SLEEPING diff --git a/tests/test-Media-transition-selection.cpp b/tests/test-Media-transition-selection.cpp index 42d3cae58..db1a36ded 100644 --- a/tests/test-Media-transition-selection.cpp +++ b/tests/test-Media-transition-selection.cpp @@ -32,7 +32,7 @@ main (void) &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // ABORT is not done and return true + // ABORT is not done g_assert_false (m1_sel->transition (Event::ABORT)); // when advance time, m1_sel is SLEEPING @@ -61,8 +61,8 @@ main (void) &fmt, &body_lambda, &m1_lambda, &m1_anchor_0s, &m1_label, &m1_prop, &m1_sel); - // START is done and return true - g_assert (m1_sel->transition (Event::START)); + // START is done + g_assert_true (m1_sel->transition (Event::START)); // after START, m1_sel is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); @@ -72,7 +72,7 @@ main (void) g_assert (m1_prop->getState () == Event::SLEEPING); g_assert (m1_sel->getState () == Event::OCCURRING); - // START is not done and return true + // START is not done g_assert_false (m1_sel->transition (Event::START)); // when advance time, m1_sel is still OCCURRING @@ -99,7 +99,7 @@ main (void) &m1_sel); // START is done - g_assert (m1_sel->transition (Event::START)); + g_assert_true (m1_sel->transition (Event::START)); // after START, m1_sel is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); @@ -132,7 +132,7 @@ main (void) &m1_sel); // START is done - g_assert (m1_sel->transition (Event::START)); + g_assert_true (m1_sel->transition (Event::START)); // after START, m1_sel is OCCURRING g_assert (body_lambda->getState () == Event::OCCURRING); @@ -143,7 +143,7 @@ main (void) g_assert (m1_sel->getState () == Event::OCCURRING); // STOP is done - g_assert (m1_sel->transition (Event::STOP)); + g_assert_true (m1_sel->transition (Event::STOP)); // after START, m1_sel is SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); diff --git a/tests/test-Switch-transition-presentation.cpp b/tests/test-Switch-transition-presentation.cpp index 6b002c005..c1dcb0f09 100644 --- a/tests/test-Switch-transition-presentation.cpp +++ b/tests/test-Switch-transition-presentation.cpp @@ -28,8 +28,8 @@ main (void) tests_create_document_with_switch_and_start (&fmt, &body_lambda, &swt1_lambda, &swt1_sel, &m1_lambda, &m2_lambda); - // ABORT is done and return true - g_assert (swt1_lambda->transition (Event::ABORT)); + // ABORT is done + g_assert_true (swt1_lambda->transition (Event::ABORT)); // after start, swt1_lambda is SLEEPING g_assert_cmpint (body_lambda->getState (), ==, Event::OCCURRING); @@ -53,7 +53,7 @@ main (void) &m1_lambda, &m2_lambda); // PAUSE is done - g_assert (swt1_lambda->transition (Event::PAUSE)); + g_assert_true (swt1_lambda->transition (Event::PAUSE)); // after start, swt1_lambda is PAUSED g_assert (body_lambda->getState () == Event::OCCURRING); @@ -124,7 +124,7 @@ main (void) &m1_lambda, &m2_lambda); // STOP is done - g_assert (swt1_lambda->transition (Event::STOP)); + g_assert_true (swt1_lambda->transition (Event::STOP)); // after STOP, swt1_lambda is SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); @@ -146,7 +146,7 @@ main (void) &m1_lambda, &m2_lambda); // STOP is done - g_assert (swt1_lambda->transition (Event::STOP)); + g_assert_true (swt1_lambda->transition (Event::STOP)); // after STOP, swt1_lambda is SLEEPING g_assert (body_lambda->getState () == Event::OCCURRING); From 2ac19bc1fd738cbfd70dbbbc9587f29fd5a0ad39 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 6 May 2018 15:38:39 -0300 Subject: [PATCH 126/169] lib: Refactory ParseState::mediaPush to if has refer or new Media --- lib/Parser.cpp | 98 ++++++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 59 deletions(-) diff --git a/lib/Parser.cpp b/lib/Parser.cpp index a599fc9c1..a60c3f857 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -3864,86 +3864,66 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) return st->errEltMutuallyExclAttributes (elt->getNode (), "src", "refer"); - // case is an already referred Media - if (st->referMapIndex (id, &media)) + // case is an refer to an Media + if (hasRefer) { - // case src filled - if (src != "") + media = cast (Media *, st->_doc->getObjectByIdOrAlias (refer)); + // if referred Media not existing yet, create it + if (media == nullptr) { - // Makes uri based in the main document uri - xmlChar *s = xmlBuildURI (toXmlChar (src), - toXmlChar (st->getURI ())); - src = toCPPString (s); - // If fails makes the uri based in the current dir - if (!xpathisuri (src) && !xpathisabs (src)) - { - src = xpathmakeabs (src); - } - xmlFree (s); + // only create + // when found, the Parser it will set uri, type and parent + media = new Media (refer); + g_assert (st->referMapAdd (refer, media)); } - media->setProperty ("uri", src); - media->setProperty ("type", type); - } - // case is an MediaSettings - else if (type == "application/x-ginga-settings") - { - refer = st->_doc->getSettings ()->getId (); - media = st->_doc->getSettings (); + // save refer as alias parent = cast (Composition *, st->objStackPeek ()); g_assert_nonnull (parent); media->addAlias (id, parent); g_assert (st->referMapAdd (id, media)); } - // case is Media refer instSame - else if (hasRefer) + // case is a new Media + else { - media = cast (Media *, st->_doc->getObjectByIdOrAlias (refer)); - // if referenced Media exist - if (media != nullptr) + // case is an MediaSettings + if (type == "application/x-ginga-settings") { + refer = st->_doc->getSettings ()->getId (); + media = st->_doc->getSettings (); parent = cast (Composition *, st->objStackPeek ()); g_assert_nonnull (parent); media->addAlias (id, parent); - st->referMapAdd (refer, media); g_assert (st->referMapAdd (id, media)); } + // case os other Media type else { - // if referenced Media not existing yet, create it - media = new Media (refer); + // case src filled + if (src != "") + { + // Makes uri based in the main document uri + xmlChar *s = xmlBuildURI (toXmlChar (src), + toXmlChar (st->getURI ())); + src = toCPPString (s); + // If fails makes the uri based in the current dir + if (!xpathisuri (src) && !xpathisabs (src)) + { + src = xpathmakeabs (src); + } + xmlFree (s); + } + // create Media if not found refer that created the referred Media + if (!st->referMapIndex (id, &media)) + { + media = new Media (id); + } + // create new Media src filled or empty (timer) + media->setProperty ("uri", src); + media->setProperty ("type", type); parent = cast (Composition *, st->objStackPeek ()); g_assert_nonnull (parent); - parent->addChild (media); - media->addAlias (id); - g_assert (st->referMapAdd (refer, media)); - } - } - // case src filled or empty (timer) - else - { - // case src filled - if (src != "") - { - // Makes uri based in the main document uri - xmlChar *s - = xmlBuildURI (toXmlChar (src), toXmlChar (st->getURI ())); - src = toCPPString (s); - // If fails makes the uri based in the current dir - if (!xpathisuri (src) && !xpathisabs (src)) - { - src = xpathmakeabs (src); - } - xmlFree (s); } - - // create new Media - media = new Media (id); - media->setProperty ("uri", src); - media->setProperty ("type", type); - parent = cast (Composition *, st->objStackPeek ()); - g_assert_nonnull (parent); - parent->addChild (media); } st->objStackPush (media); From c8978da0f82fc44af3ac1c6445c0387cf3118376 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 6 May 2018 20:29:23 -0300 Subject: [PATCH 127/169] lib: Fix ParserState::pushMedia for multiple refer to MediaSettings in diferent order --- lib/Parser.cpp | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/lib/Parser.cpp b/lib/Parser.cpp index a60c3f857..dab7f6863 100644 --- a/lib/Parser.cpp +++ b/lib/Parser.cpp @@ -3867,20 +3867,27 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) // case is an refer to an Media if (hasRefer) { + // if referred Media not existing Media yet media = cast (Media *, st->_doc->getObjectByIdOrAlias (refer)); - // if referred Media not existing yet, create it if (media == nullptr) { - // only create - // when found, the Parser it will set uri, type and parent - media = new Media (refer); - g_assert (st->referMapAdd (refer, media)); + // try if is an multiple refer, if not create Media + if (!st->referMapIndex (refer, &media)) + { + // when Parser find the reffered Media + // (a) if an Media, the Parser will set uri, type and parent + // (b) if an MediaSettings, the Parser will replace + media = new Media (refer); + } + + st->referMapAdd (refer, media); } + // if is multiple refer to a not existing Media yet // save refer as alias parent = cast (Composition *, st->objStackPeek ()); g_assert_nonnull (parent); media->addAlias (id, parent); - g_assert (st->referMapAdd (id, media)); + st->referMapAdd (id, media); } // case is a new Media else @@ -3888,12 +3895,32 @@ ParserState::pushMedia (ParserState *st, ParserElt *elt) // case is an MediaSettings if (type == "application/x-ginga-settings") { - refer = st->_doc->getSettings ()->getId (); + Media *tmpMedia = nullptr; + + // there is only one MediaSettings media = st->_doc->getSettings (); + + // if there are refers to this MediaSettings, those refers + // are using a tmp Media, which should be this MediaSettings + st->referMapIndex (id, &tmpMedia); + if (tmpMedia) + { + auto it = st->_referMap.begin (); + while ((*it).second == tmpMedia) + { + st->_referMap[(*it).first] = media; + media->addAlias ((*it).first); + it++; + } + if (it != st->_referMap.begin ()) + delete tmpMedia; + } + + // add this Media as refer to MediaSettings parent = cast (Composition *, st->objStackPeek ()); g_assert_nonnull (parent); media->addAlias (id, parent); - g_assert (st->referMapAdd (id, media)); + st->referMapAdd (id, media); } // case os other Media type else From 60edb847b7c0b01b116d0cd0b3bec2de6d41fdbf Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sun, 6 May 2018 20:54:19 -0300 Subject: [PATCH 128/169] tests: Add test-MediaSettings-refer --- .gitignore | 1 + lib/aux-ginga.h | 1 + tests/Makefile.am | 3 + tests/test-MediaSettings-refer.cpp | 1573 ++++++++++++++++++++++++++++ 4 files changed, 1578 insertions(+) create mode 100644 tests/test-MediaSettings-refer.cpp diff --git a/.gitignore b/.gitignore index dfe94e6e7..11a9fb1ea 100644 --- a/.gitignore +++ b/.gitignore @@ -163,6 +163,7 @@ /tests/test-Media-anchors-started-from-ports /tests/test-Media-anchors-started-from-links /tests/test-MediaSettings-instances +/tests/test-MediaSettings-refer /tests/test-MediaSettings-new /tests/test-Siggen-new /tests/test-Object-getTime diff --git a/lib/aux-ginga.h b/lib/aux-ginga.h index 84a497270..c0d3c3473 100644 --- a/lib/aux-ginga.h +++ b/lib/aux-ginga.h @@ -50,6 +50,7 @@ GINGA_PRAGMA_DIAG_POP () GINGA_END_DECLS // C++ library. +#include #include #include #include diff --git a/tests/Makefile.am b/tests/Makefile.am index d2b5be1b2..01c2c338f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -298,6 +298,9 @@ test_MediaSettings_instances_SOURCES= test-MediaSettings-instances.cpp progs+= test-MediaSettings-new test_MediaSettings_new_SOURCES= test-MediaSettings-new.cpp +progs+= test-MediaSettings-refer +test_MediaSettings_refer_SOURCES= test-MediaSettings-refer.cpp + # lib/Context.h ------------------------------------------------------------ progs+= test-Context-new test_Context_new_SOURCES= test-Context-new.cpp diff --git a/tests/test-MediaSettings-refer.cpp b/tests/test-MediaSettings-refer.cpp new file mode 100644 index 000000000..72305cc50 --- /dev/null +++ b/tests/test-MediaSettings-refer.cpp @@ -0,0 +1,1573 @@ +/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia + +This file is part of Ginga (Ginga-NCL). + +Ginga is free software: you can yistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +Ginga is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details. + +You should have received a copy of the GNU General Public License +along with Ginga. If not, see . */ + +#include "tests.h" + +#define PASS(nclBuffer) \ + G_STMT_START \ + { \ + Formatter *fmt; \ + Document *doc; \ + \ + tests_parse_and_start (&fmt, &doc, nclBuffer); \ + \ + Context *body = cast (Context *, doc->getRoot ()); \ + g_assert_nonnull (body); \ + Event *body_lambda = body->getLambda (); \ + g_assert_nonnull (body_lambda); \ + \ + Media *m1 = cast (Media *, doc->getObjectByIdOrAlias ("m1")); \ + g_assert_nonnull (m1); \ + Event *m1_lambda = m1->getLambda (); \ + g_assert_nonnull (m1_lambda); \ + \ + Media *r1 = cast (Media *, doc->getObjectByIdOrAlias ("r1")); \ + g_assert_nonnull (r1); \ + Event *r1_lambda = r1->getLambda (); \ + g_assert_nonnull (r1_lambda); \ + \ + Media *m2 = cast (Media *, doc->getObjectById ("m2")); \ + g_assert_nonnull (m1); \ + Event *m2_lambda = m2->getLambda (); \ + g_assert_nonnull (m2_lambda); \ + \ + /* -------------------------------- */ \ + /* check start document */ \ + g_assert (body_lambda->getState () == Event::OCCURRING); \ + g_assert (m1_lambda->getState () == Event::OCCURRING); \ + g_assert (r1_lambda->getState () == Event::OCCURRING); \ + g_assert (m2_lambda->getState () == Event::SLEEPING); \ + \ + g_assert (m1->getProperty ("uri") == r1->getProperty ("uri")); \ + g_assert (m1->getProperty ("x") == r1->getProperty ("x")); \ + g_assert (m1->getProperty ("x") == "z"); \ + /* -------------------------------- */ \ + /* main check */ \ + \ + /* when start document, m1 is OCCURRING */ \ + fmt->sendTick (0 * GINGA_SECOND, 0 * GINGA_SECOND, 0); \ + fmt->sendTick (0 * GINGA_SECOND, 0 * GINGA_SECOND, 0); \ + g_assert (body_lambda->getState () == Event::OCCURRING); \ + g_assert (m1_lambda->getState () == Event::OCCURRING); \ + g_assert (r1_lambda->getState () == Event::OCCURRING); \ + g_assert (m2_lambda->getState () == Event::OCCURRING); \ + \ + g_assert (m1->getProperty ("x") == r1->getProperty ("x")); \ + g_assert (m1->getProperty ("x") == "k"); \ + \ + delete fmt; \ + } \ + G_STMT_END + +int +main (void) +{ + + // referred object: defined first + // reference: defined after + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after + // action set over: referred object + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after + // action set over: reference + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined after + // reference: defined first + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined after + // reference: defined first + // action set over: referred object + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined after + // reference: defined first + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined after + // reference: defined first + // action set over: reference + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after in nested context + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after in nested context + // action set over: referred object + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after in nested context + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after in nested context + // action set over: reference + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after + // action set over: referred object + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after + // action set over: reference + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after in nested context + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after in nested context + // action set over: referred object + // link onEndAttribution over: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after in nested context + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // // referred object: defined first in nested context + // // reference: defined after in nested context + // // action set over: reference + // // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // reference: defined first + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined after + // reference: defined first + // action set over: referred object + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined after + // reference: defined first + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined after + // reference: defined first + // action set over: reference + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after in nested context + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after in nested context + // action set over: referred object + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after in nested context + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first + // reference: defined after in nested context + // action set over: reference + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after + // action set over: referred object + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after + // action set over: reference + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after in nested context + // action set over: referred object + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after in nested context + // action set over: referred object + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after in nested context + // action set over: reference + // link onEndAttribution: referred object + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + // referred object: defined first in nested context + // reference: defined after in nested context + // action set over: reference + // link onEndAttribution: reference + PASS ("\n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ + \n\ +\n"); + + exit (EXIT_SUCCESS); +} From 8891cec039c51a1f10c2e98665fccb975e070a6a Mon Sep 17 00:00:00 2001 From: Antonio Busson Date: Thu, 10 May 2018 17:42:48 -0300 Subject: [PATCH 129/169] src-gui: fixed segmentation fault bug --- src-gui/ginga-gtk.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index a1d29c6e7..fa1561c23 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -79,34 +79,36 @@ main (int argc, char **argv) gtk_init (&saved_argc, &saved_argv); + // Parse command-line options. ctx = g_option_context_new (OPTION_LINE); g_assert_nonnull (ctx); g_option_context_add_main_entries (ctx, options, NULL); if (!g_option_context_parse (ctx, &saved_argc, &saved_argv, &error)) - { - g_print ("option parsing failed: %s\n", error->message); - exit (1); - } - + { + g_print ("option parsing failed: %s\n", error->message); + exit (1); + } g_option_context_free (ctx); - + init_ginga_data (); + load_settings (); - + setlocale (LC_ALL, "C"); gtk_window_set_default_icon_from_file ( g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", "common", "ginga_icon.png", NULL), &error); - + + // send log message to server send_http_log_message (0, (gchar *) "Open Ginga"); // check for ginga updates send_http_log_message (-1, (gchar *) "Check for Ginga updates"); g_assert (g_setenv ("G_MESSAGES_DEBUG", "all", true)); - + create_main_window (); if (opt_bigpicture) @@ -114,13 +116,13 @@ main (int argc, char **argv) create_bigpicture_window (); } else - { - gchar *filename = saved_argv [1]; - gchar *ext = strrchr (filename, '.'); - if (!g_strcmp0 (ext, ".ncl")) - { + { + if(saved_argc > 1){ + gchar *filename = saved_argv [1]; + gchar *ext = strrchr (filename, '.'); + if (!g_strcmp0 (ext, ".ncl")) insert_historicbox (filename); - } + } } gtk_main (); From df674526bf9ce2692b51b76be832341083a6a069 Mon Sep 17 00:00:00 2001 From: Antonio Busson Date: Thu, 10 May 2018 18:08:32 -0300 Subject: [PATCH 130/169] src-gui: initial resolution fixed --- src-gui/view/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-gui/view/MainWindow.cpp b/src-gui/view/MainWindow.cpp index 0eb903147..bc2ef8aa1 100644 --- a/src-gui/view/MainWindow.cpp +++ b/src-gui/view/MainWindow.cpp @@ -986,7 +986,7 @@ create_main_window () gtk_window_set_title (GTK_WINDOW (mainWindow), "Ginga"); gtk_window_set_default_size (GTK_WINDOW (mainWindow), presentationAttributes.resolutionWidth, - presentationAttributes.resolutionHeight); + presentationAttributes.resolutionHeight+ (BUTTON_SIZE*2)) ; gtk_window_set_position (GTK_WINDOW (mainWindow), GTK_WIN_POS_CENTER); gtk_window_set_resizable (GTK_WINDOW (mainWindow), true); gtk_container_set_border_width (GTK_CONTAINER (mainWindow), 5); From 8b295fd3ebb9622f583abfef8b99de51b9dd93c3 Mon Sep 17 00:00:00 2001 From: Antonio Busson Date: Thu, 10 May 2018 18:28:23 -0300 Subject: [PATCH 131/169] src-gui: removing pause button from ginga-gui --- src-gui/view/MainWindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src-gui/view/MainWindow.cpp b/src-gui/view/MainWindow.cpp index bc2ef8aa1..32aec56c3 100644 --- a/src-gui/view/MainWindow.cpp +++ b/src-gui/view/MainWindow.cpp @@ -1046,6 +1046,7 @@ stop_button_callback (void) gtk_widget_set_sensitive (fileEntry, true); gtk_widget_set_sensitive (openButton, true); gtk_widget_set_sensitive (histButton, true); + gtk_widget_set_sensitive (playButton, true); GINGA->stop (); } @@ -1054,9 +1055,9 @@ void play_pause_button_callback (void) { inPlayMode = !inPlayMode; - GtkWidget *play_icon = gtk_image_new_from_file ( +/* GtkWidget *play_icon = gtk_image_new_from_file ( g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", - get_icon_folder (), "play-icon.png", NULL)); + get_icon_folder (), "play-icon.png", NULL)); */ if (inPlayMode) { const gchar *file = gtk_entry_get_text (GTK_ENTRY (fileEntry)); @@ -1069,12 +1070,13 @@ play_pause_button_callback (void) return; } - play_icon = gtk_image_new_from_file ( + /* play_icon = gtk_image_new_from_file ( g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", - get_icon_folder (), "pause-icon.png", NULL)); + get_icon_folder (), "pause-icon.png", NULL)); */ gtk_widget_set_sensitive (fileEntry, false); gtk_widget_set_sensitive (openButton, false); gtk_widget_set_sensitive (histButton, false); + gtk_widget_set_sensitive (playButton, !inPlayMode); // Start Ginga. GINGA->start (file, nullptr); @@ -1083,7 +1085,7 @@ play_pause_button_callback (void) gtk_text_buffer_set_text (consoleTxtBuffer, "", 0); } - gtk_button_set_image (GTK_BUTTON (playButton), play_icon); +// gtk_button_set_image (GTK_BUTTON (playButton), play_icon); } void select_ncl_file_callback (unused (GtkWidget *widget), From 48191e2cf2ab1d941b63b7074451bd0983f16ef4 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Sat, 12 May 2018 00:01:32 -0300 Subject: [PATCH 132/169] windows: Fix location of nclua required files in inno setup --- extra/windows/ginga_win_deploy_script.iss | 364 +++++++++++----------- 1 file changed, 182 insertions(+), 182 deletions(-) diff --git a/extra/windows/ginga_win_deploy_script.iss b/extra/windows/ginga_win_deploy_script.iss index df356ac01..97f7e625f 100644 --- a/extra/windows/ginga_win_deploy_script.iss +++ b/extra/windows/ginga_win_deploy_script.iss @@ -1,8 +1,8 @@ ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! -#define MyAppName "Ginga" -#define MyAppVersion "1.5" +#define MyAppName "Ginga-1.0-beta" +;#define MyAppVersion "1.0" #define MyAppPublisher "Telemidia" #define MyAppURL "www.telemidia.puc-rio.br" #define MyAppExeName "gingagui.exe" @@ -15,8 +15,8 @@ Root: HKCR; Subkey: ".ncl"; ValueData: "{#MyAppName}"; Flags: uninsdeletevalue; ValueType: string; ValueName: "" Root: HKCR; Subkey: "{#MyAppName}"; ValueData: "Program {#MyAppName}"; Flags: uninsdeletekey; ValueType: string; ValueName: "" -Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon"; ValueData: "{app}\{#MyAppExeName},0"; ValueType: string; ValueName: "" -Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; ValueType: string; ValueName: "" +Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon"; ValueData: "{app}\ginga\\{#MyAppExeName},0"; ValueType: string; ValueName: "" +Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\ginga\\{#MyAppExeName}"" ""%1"""; ValueType: string; ValueName: "" [Setup] ; NOTE: The value of AppId uniquely identifies this application. @@ -24,8 +24,8 @@ Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\{#My ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{FD94E7C2-B90C-4869-B6C2-FB5DD69279B5} AppName={#MyAppName} -AppVersion={#MyAppVersion} -;AppVerName={#MyAppName} {#MyAppVersion} +;AppVersion={#MyAppVersion} +AppVerName={#MyAppName} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} @@ -52,196 +52,196 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ [Files] ; Ginga -Source: "C:\msys64\mingw64\bin\ginga.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\gingagui.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\ginga.exe"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\gingagui.exe"; DestDir: "{app}\ginga\"; Flags: ignoreversion ; Ginga-gui GTK icons & depends -Source: "C:\msys64\mingw64\share\icons\Adwaita\16x16\*"; DestDir: "{app}\share\icons\Adwaita\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\icons\hicolor\16x16\*"; DestDir: "{app}\share\icons\hicolor\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\icons\hicolor\index.theme"; DestDir: "{app}\share\icons\hicolor"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\glib-2.0\schemas\*"; DestDir: "{app}\share\glib-2.0\schemas"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\icons\Adwaita\16x16\*"; DestDir: "{app}\ginga\\share\icons\Adwaita\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\icons\hicolor\16x16\*"; DestDir: "{app}\ginga\\share\icons\hicolor\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\icons\hicolor\index.theme"; DestDir: "{app}\ginga\\share\icons\hicolor"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\glib-2.0\schemas\*"; DestDir: "{app}\ginga\\share\glib-2.0\schemas"; Flags: ignoreversion recursesubdirs createallsubdirs ; Nclua deps -Source: "C:\msys64\mingw64\lib\lua\*"; DestDir: "{app}\lib\lua"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\lua\*"; DestDir: "{app}\share\lua"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\lib\lua\*"; DestDir: "{app}\\lib\lua"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\lua\*"; DestDir: "{app}\\share\lua"; Flags: ignoreversion recursesubdirs createallsubdirs ; Ginga deps -Source: "C:\msys64\mingw64\bin\libatk-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libbz2-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libcairo-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libcairo-gobject-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libcroco-0.6-3.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libcurl-4.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libeay32.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libepoxy-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libexpat-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libffi-6.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libfontconfig-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libfreetype-6.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgcc_s_seh-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgdk_pixbuf-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgdk-3-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgio-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libglib-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgmodule-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgobject-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgraphite2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstapp-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstbase-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstreamer-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstvideo-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgtk-3-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libharfbuzz-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libiconv-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libicudt58.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libicuuc58.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libidn2-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libintl-8.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\liblzma-5.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libnclua-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libnghttp2-14.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\liborc-0.4-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libpango-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libpangocairo-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libpangoft2-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libpangowin32-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libpcre-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libpixman-1-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libpng16-16.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\librsvg-2-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libssh2-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libstdc++-6.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libunistring-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libwinpthread-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libxml2-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\lua53.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\ssleay32.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libatk-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libbz2-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libcairo-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libcairo-gobject-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libcroco-0.6-3.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libcurl-4.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libeay32.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libepoxy-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libexpat-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libffi-6.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libfontconfig-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libfreetype-6.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgcc_s_seh-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgdk_pixbuf-2.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgdk-3-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgio-2.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libglib-2.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgmodule-2.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgobject-2.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgraphite2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstapp-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstbase-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstreamer-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstvideo-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgtk-3-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libharfbuzz-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libiconv-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libicudt58.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libicuuc58.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libidn2-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libintl-8.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\liblzma-5.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libnclua-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libnghttp2-14.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\liborc-0.4-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libpango-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libpangocairo-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libpangoft2-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libpangowin32-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libpcre-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libpixman-1-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libpng16-16.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\librsvg-2-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libssh2-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libstdc++-6.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libunistring-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libwinpthread-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libxml2-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\lua53.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\ssleay32.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\zlib1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion ; Gstreamer plugin libs -Source: "C:\msys64\mingw64\lib\gstreamer-1.0\*"; DestDir: "{app}\lib\gstreamer-1.0"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\lib\gstreamer-1.0\*"; DestDir: "{app}\ginga\\lib\gstreamer-1.0"; Flags: ignoreversion recursesubdirs createallsubdirs ; Gstreamer plugin bin -Source: "C:\msys64\mingw64\bin\avcodec-57.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\avfilter-6.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\avformat-57.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\avresample-3.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\avutil-55.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\liba52-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libass-9.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libbluray-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libcaca-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libcdio-18.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libcelt0-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libchromaprint.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libdaalabase-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libdaaladec-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libdaalaenc-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libdca-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libdvdcss-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libdvdnav-4.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libdvdread-4.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libfaac-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libfaad-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libFLAC-8.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libfluidsynth-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libfribidi-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgfortran-4.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgme.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgmp-10.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgnutls-30.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgsm.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstadaptivedemux-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstaudio-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstbadaudio-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstbadbase-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstbadvideo-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstbasecamerabinsrc-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstcodecparsers-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstcontroller-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstfft-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstgl-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstmpegts-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstnet-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstopencv-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstpbutils-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstphotography-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstriff-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstrtp-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstrtsp-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgstsdp-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgsttag-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libgsturidownloader-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libHalf-2_2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libhogweed-4.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libIex-2_2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libIlmImf-2_2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libIlmThread-2_2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libImath-2_2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libjasper-4.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libjpeg-8.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libmodplug-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libmp3lame-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libmpeg2-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libmpg123-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libnettle-6.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libogg-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopenal-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopenblas.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencore-amrnb-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencore-amrwb-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencv_bgsegm340.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencv_calib3d340.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencv_core340.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencv_flann340.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencv_imgcodecs340.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencv_imgproc340.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencv_objdetect340.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopencv_video340.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopenh264.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopenjp2-7.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libopus-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libp11-kit-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libportaudio-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libquadmath-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libreadline7.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\librtmp-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libschroedinger-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libshout-3.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libsndfile-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libSoundTouch-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libsoup-2.4-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libspeex-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libsqlite3-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libsrtp.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libtag.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libtasn1-6.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libtermcap-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libtheora-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libtheoradec-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libtheoraenc-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libtiff-5.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libtwolame-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libvorbis-0.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libvorbisenc-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libvorbisidec-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libvpx-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libwavpack-1.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libwebp-7.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libwebpmux-3.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libx264-155.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\libx265.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\postproc-54.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\swresample-2.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\swscale-4.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\tbb.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "C:\msys64\mingw64\bin\xvidcore.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\avcodec-57.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\avfilter-6.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\avformat-57.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\avresample-3.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\avutil-55.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\liba52-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libass-9.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libbluray-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libcaca-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libcdio-18.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libcelt0-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libchromaprint.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libdaalabase-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libdaaladec-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libdaalaenc-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libdca-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libdvdcss-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libdvdnav-4.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libdvdread-4.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libfaac-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libfaad-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libFLAC-8.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libfluidsynth-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libfribidi-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgfortran-4.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgme.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgmp-10.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgnutls-30.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgsm.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstadaptivedemux-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstaudio-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstbadaudio-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstbadbase-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstbadvideo-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstbasecamerabinsrc-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstcodecparsers-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstcontroller-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstfft-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstgl-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstmpegts-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstnet-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstopencv-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstpbutils-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstphotography-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstriff-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstrtp-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstrtsp-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgstsdp-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgsttag-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libgsturidownloader-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libHalf-2_2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libhogweed-4.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libIex-2_2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libIlmImf-2_2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libIlmThread-2_2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libImath-2_2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libjasper-4.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libjpeg-8.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libmodplug-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libmp3lame-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libmpeg2-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libmpg123-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libnettle-6.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libogg-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopenal-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopenblas.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencore-amrnb-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencore-amrwb-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencv_bgsegm340.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencv_calib3d340.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencv_core340.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencv_flann340.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencv_imgcodecs340.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencv_imgproc340.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencv_objdetect340.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopencv_video340.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopenh264.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopenjp2-7.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libopus-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libp11-kit-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libportaudio-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libquadmath-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libreadline7.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\librtmp-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libschroedinger-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libshout-3.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libsndfile-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libSoundTouch-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libsoup-2.4-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libspeex-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libsqlite3-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libsrtp.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libtag.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libtasn1-6.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libtermcap-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libtheora-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libtheoradec-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libtheoraenc-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libtiff-5.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libtwolame-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libvorbis-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libvorbisenc-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libvorbisidec-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libvpx-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libwavpack-1.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libwebp-7.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libwebpmux-3.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libx264-155.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\libx265.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\postproc-54.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\swresample-2.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\swscale-4.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\tbb.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion +Source: "C:\msys64\mingw64\bin\xvidcore.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] -Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" -Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon +Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\ginga\\{#MyAppExeName}" +Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\ginga\\{#MyAppExeName}"; Tasks: desktopicon From 1d635f3a7e4b7434c382ca68eabf8cf774d33509 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 15 May 2018 16:04:55 -0300 Subject: [PATCH 133/169] windows: Install mingw64\share files by inno setup --- extra/windows/ginga_win_deploy_script.iss | 28 ++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/extra/windows/ginga_win_deploy_script.iss b/extra/windows/ginga_win_deploy_script.iss index 97f7e625f..0e3b668e5 100644 --- a/extra/windows/ginga_win_deploy_script.iss +++ b/extra/windows/ginga_win_deploy_script.iss @@ -15,8 +15,8 @@ Root: HKCR; Subkey: ".ncl"; ValueData: "{#MyAppName}"; Flags: uninsdeletevalue; ValueType: string; ValueName: "" Root: HKCR; Subkey: "{#MyAppName}"; ValueData: "Program {#MyAppName}"; Flags: uninsdeletekey; ValueType: string; ValueName: "" -Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon"; ValueData: "{app}\ginga\\{#MyAppExeName},0"; ValueType: string; ValueName: "" -Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\ginga\\{#MyAppExeName}"" ""%1"""; ValueType: string; ValueName: "" +Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon"; ValueData: "{app}\ginga\{#MyAppExeName},0"; ValueType: string; ValueName: "" +Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\ginga\{#MyAppExeName}"" ""%1"""; ValueType: string; ValueName: "" [Setup] ; NOTE: The value of AppId uniquely identifies this application. @@ -52,18 +52,20 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ [Files] ; Ginga -Source: "C:\msys64\mingw64\bin\ginga.exe"; DestDir: "{app}\ginga\"; Flags: ignoreversion +;Source: "C:\msys64\mingw64\bin\ginga.exe"; DestDir: "{app}\ginga\"; Flags: ignoreversion Source: "C:\msys64\mingw64\bin\gingagui.exe"; DestDir: "{app}\ginga\"; Flags: ignoreversion ; Ginga-gui GTK icons & depends -Source: "C:\msys64\mingw64\share\icons\Adwaita\16x16\*"; DestDir: "{app}\ginga\\share\icons\Adwaita\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\icons\hicolor\16x16\*"; DestDir: "{app}\ginga\\share\icons\hicolor\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\icons\hicolor\index.theme"; DestDir: "{app}\ginga\\share\icons\hicolor"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\glib-2.0\schemas\*"; DestDir: "{app}\ginga\\share\glib-2.0\schemas"; Flags: ignoreversion recursesubdirs createallsubdirs - +;Source: "C:\msys64\mingw64\share\icons\Adwaita\16x16\*"; DestDir: "{app}\ginga\share\icons\Adwaita\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs +;Source: "C:\msys64\mingw64\share\icons\hicolor\16x16\*"; DestDir: "{app}\ginga\share\icons\hicolor\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs +;Source: "C:\msys64\mingw64\share\icons\hicolor\index.theme"; DestDir: "{app}\ginga\share\icons\hicolor"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\glib-2.0\*"; DestDir: "{app}\ginga\share\glib-2.0"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\icons\*"; DestDir: "{app}\ginga\share\icons"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\ginga\*"; DestDir: "{app}\ginga\share\ginga"; Flags: ignoreversion recursesubdirs createallsubdirs + ; Nclua deps -Source: "C:\msys64\mingw64\lib\lua\*"; DestDir: "{app}\\lib\lua"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\lua\*"; DestDir: "{app}\\share\lua"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\lib\lua\*"; DestDir: "{app}\lib\lua"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\lua\*"; DestDir: "{app}\share\lua"; Flags: ignoreversion recursesubdirs createallsubdirs ; Ginga deps Source: "C:\msys64\mingw64\bin\libatk-1.0-0.dll"; DestDir: "{app}\ginga\"; Flags: ignoreversion @@ -120,7 +122,7 @@ Source: "C:\msys64\mingw64\bin\zlib1.dll"; DestDir: "{app}\ginga\"; Flags: ignor ; Gstreamer plugin libs -Source: "C:\msys64\mingw64\lib\gstreamer-1.0\*"; DestDir: "{app}\ginga\\lib\gstreamer-1.0"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\lib\gstreamer-1.0\*"; DestDir: "{app}\ginga\lib\gstreamer-1.0"; Flags: ignoreversion recursesubdirs createallsubdirs ; Gstreamer plugin bin @@ -242,6 +244,6 @@ Source: "C:\msys64\mingw64\bin\xvidcore.dll"; DestDir: "{app}\ginga\"; Flags: ig ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] -Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\ginga\\{#MyAppExeName}" -Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\ginga\\{#MyAppExeName}"; Tasks: desktopicon +Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\ginga\{#MyAppExeName}" +Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\ginga\{#MyAppExeName}"; Tasks: desktopicon From 2948ca5649f9f40151e721d391b9fa8bc409e0bf Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 15 May 2018 16:08:05 -0300 Subject: [PATCH 134/169] gui: Use get_installation_directory to get installed location --- src-gui/ginga-gtk.cpp | 75 ++++++++++++++++++++++++++----- src-gui/ginga_gtk.h | 3 ++ src-gui/view/BigPictureWindow.cpp | 6 +-- src-gui/view/MainWindow.cpp | 44 +++++++++--------- src-gui/view/TvControlWindow.cpp | 60 ++++++++++++------------- 5 files changed, 123 insertions(+), 65 deletions(-) diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index fa1561c23..6484607d6 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -50,6 +50,63 @@ init_ginga_data () gingaID = g_strdup_printf ("%li", g_get_real_time ()); } +#if defined(G_OS_WIN32) + +static HMODULE libgimpbase_dll = NULL; + +BOOL WINAPI /* Avoid silly "no previous prototype" gcc warning */ +DllMain (HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpvReserved); + +BOOL WINAPI +DllMain (HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + libgimpbase_dll = hinstDLL; + break; + } + + return TRUE; +} +#endif + +const gchar * +get_installation_directory (void) +{ + static gchar *dir = NULL; + + if (dir) + return dir; + +#ifdef PLATFORM_OSX + NSAutoreleasePool *pool; + NSArray *path; + NSString *library_dir; + + pool = [[NSAutoreleasePool alloc] init]; + path = NSSearchPathForDirectoriesInDomains (NSApplicationSupportDirectory, + NSUserDomainMask, YES); + library_dir = [path objectAtIndex:0]; + dir = g_build_filename ([library_dir UTF8String], + GIMPDIR, GIMP_USER_VERSION, NULL); + [pool drain]; + +#elif defined G_OS_WIN32 + gchar * tmpdir = g_win32_get_package_installation_directory_of_module (libgimpbase_dll); + if (! tmpdir) + g_error ("g_win32_get_package_installation_directory_of_module() failed"); + dir = g_build_filename (tmpdir, "share", "ginga", NULL); +#else + dir = GINGADATADIR; +#endif + return dir; +} + int main (int argc, char **argv) { @@ -79,7 +136,6 @@ main (int argc, char **argv) gtk_init (&saved_argc, &saved_argv); - // Parse command-line options. ctx = g_option_context_new (OPTION_LINE); g_assert_nonnull (ctx); @@ -90,25 +146,24 @@ main (int argc, char **argv) exit (1); } g_option_context_free (ctx); - + init_ginga_data (); - + load_settings (); - + setlocale (LC_ALL, "C"); gtk_window_set_default_icon_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", "common", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", "common", "ginga_icon.png", NULL), &error); - - + // send log message to server send_http_log_message (0, (gchar *) "Open Ginga"); // check for ginga updates send_http_log_message (-1, (gchar *) "Check for Ginga updates"); g_assert (g_setenv ("G_MESSAGES_DEBUG", "all", true)); - + create_main_window (); if (opt_bigpicture) @@ -116,8 +171,8 @@ main (int argc, char **argv) create_bigpicture_window (); } else - { - if(saved_argc > 1){ + { + if(saved_argc > 1){ gchar *filename = saved_argv [1]; gchar *ext = strrchr (filename, '.'); if (!g_strcmp0 (ext, ".ncl")) diff --git a/src-gui/ginga_gtk.h b/src-gui/ginga_gtk.h index 07a161f2d..80599de69 100644 --- a/src-gui/ginga_gtk.h +++ b/src-gui/ginga_gtk.h @@ -125,4 +125,7 @@ void load_settings (void); /* Model/HttpMessages */ void send_http_log_message (gint, const gchar *); +/* util */ +const gchar * get_installation_directory(); + #endif /* GINGA_GTK_H */ diff --git a/src-gui/view/BigPictureWindow.cpp b/src-gui/view/BigPictureWindow.cpp index a10a89035..fd25daef9 100644 --- a/src-gui/view/BigPictureWindow.cpp +++ b/src-gui/view/BigPictureWindow.cpp @@ -94,7 +94,7 @@ instantiateInAppLibrary (unused (xmlDocPtr doc), xmlNodePtr cur) = cairo_image_surface_create_from_png ((gchar *) thumbnail); else bigPictureCard->surface = cairo_image_surface_create_from_png ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", "common", "app_thumbnail.png", NULL)); if (g_file_test ((gchar *) cover, G_FILE_TEST_EXISTS)) @@ -103,7 +103,7 @@ instantiateInAppLibrary (unused (xmlDocPtr doc), xmlNodePtr cur) else bigPictureCard->print_surface = cairo_image_surface_create_from_png ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", "common", "app_cover.png", NULL)); bigPictureCard->src = g_strdup ((gchar *) src); @@ -381,7 +381,7 @@ create_bigpicture_window () return; cairo_surface_t *image_p = cairo_image_surface_create_from_png ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", "common", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", "common", "background_pattern.png", NULL)); g_assert_nonnull (image_p); diff --git a/src-gui/view/MainWindow.cpp b/src-gui/view/MainWindow.cpp index 32aec56c3..6ec8eb932 100644 --- a/src-gui/view/MainWindow.cpp +++ b/src-gui/view/MainWindow.cpp @@ -206,10 +206,10 @@ apply_theme () gchar *filename; if (presentationAttributes.guiTheme == 0) - filename = g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "style", + filename = g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "style", "light.css", NULL); else - filename = g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "style", + filename = g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "style", "dark.css", NULL); GFile *file = g_file_new_for_path (filename); @@ -226,82 +226,82 @@ apply_theme () } GtkWidget *img_icon = gtk_image_new_from_file (g_build_path ( - G_DIR_SEPARATOR_S, GINGADATADIR, "icons", get_icon_folder (), + G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), (inPlayMode ? "pause-icon.png" : "play-icon.png"), NULL)); gtk_button_set_image (GTK_BUTTON (playButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "stop-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (stopButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "fullscreen-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (fullscreenButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "settings-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (settingsButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "remote-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (remoteButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "debug-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (debugButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "openfile-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (openButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "history-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (histButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "tools-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (toolsButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "info-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (aboutButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "question-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (helpButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "question-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (helpButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "screen-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (bigpictureButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "bottomhide-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (consoleHideButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "rightride-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (sidebarHideButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "window-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (sidebarWinButton), img_icon); @@ -580,7 +580,7 @@ keyboard_callback (unused (GtkWidget *widget), GdkEventKey *e, if (GINGA->getState () == GINGA_STATE_PLAYING) GINGA->sendKey (std::string (key), g_strcmp0 ((const char *) type, "press") == 0); - + } void @@ -1040,7 +1040,7 @@ stop_button_callback (void) { inPlayMode = false; GtkWidget *play_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "play-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (playButton), play_icon); gtk_widget_set_sensitive (fileEntry, true); @@ -1056,7 +1056,7 @@ play_pause_button_callback (void) { inPlayMode = !inPlayMode; /* GtkWidget *play_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "play-icon.png", NULL)); */ if (inPlayMode) { @@ -1071,7 +1071,7 @@ play_pause_button_callback (void) } /* play_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "pause-icon.png", NULL)); */ gtk_widget_set_sensitive (fileEntry, false); gtk_widget_set_sensitive (openButton, false); diff --git a/src-gui/view/TvControlWindow.cpp b/src-gui/view/TvControlWindow.cpp index a0e6f32a5..2a9c23e90 100644 --- a/src-gui/view/TvControlWindow.cpp +++ b/src-gui/view/TvControlWindow.cpp @@ -39,7 +39,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) g_assert_nonnull (fixed_layout); GtkWidget *button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_one.png", NULL)); GtkWidget *button_1 = gtk_button_new (); g_assert_nonnull (button_1); @@ -51,7 +51,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos - BUTTON_SIZE, offSetY + 0); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_two.png", NULL)); GtkWidget *button_2 = gtk_button_new (); g_assert_nonnull (button_2); @@ -63,7 +63,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos, offSetY + 0); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_three.png", NULL)); GtkWidget *button_3 = gtk_button_new (); g_assert_nonnull (button_3); @@ -77,7 +77,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_four.png", NULL)); GtkWidget *button_4 = gtk_button_new (); g_assert_nonnull (button_4); @@ -90,7 +90,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + BUTTON_SIZE); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_five.png", NULL)); GtkWidget *button_5 = gtk_button_new (); g_assert_nonnull (button_5); @@ -102,7 +102,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos, offSetY + BUTTON_SIZE); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_six.png", NULL)); GtkWidget *button_6 = gtk_button_new (); g_assert_nonnull (button_6); @@ -117,7 +117,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_seven.png", NULL)); GtkWidget *button_7 = gtk_button_new (); g_assert_nonnull (button_7); @@ -130,7 +130,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + (BUTTON_SIZE * 2)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_eight.png", NULL)); GtkWidget *button_8 = gtk_button_new (); g_assert_nonnull (button_8); @@ -142,7 +142,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos, offSetY + (BUTTON_SIZE * 2)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_nine.png", NULL)); GtkWidget *button_9 = gtk_button_new (); g_assert_nonnull (button_9); @@ -157,7 +157,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "back_arrow.png", NULL)); GtkWidget *button_back = gtk_button_new (); g_assert_nonnull (button_back); @@ -170,7 +170,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + (BUTTON_SIZE * 3)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "number_zero.png", NULL)); GtkWidget *button_0 = gtk_button_new (); g_assert_nonnull (button_0); @@ -182,7 +182,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos, offSetY + (BUTTON_SIZE * 3)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "info-icon.png", NULL)); GtkWidget *button_info = gtk_button_new (); g_assert_nonnull (button_info); @@ -197,7 +197,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "uparrow-icon.png", NULL)); GtkWidget *button_up = gtk_button_new (); g_assert_nonnull (button_up); @@ -212,7 +212,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "leftarrow-icon.png", NULL)); GtkWidget *button_left = gtk_button_new (); g_assert_nonnull (button_left); @@ -225,7 +225,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 10 + (BUTTON_SIZE * 5)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "ok-icon.png", NULL)); GtkWidget *button_ok = gtk_button_new (); g_assert_nonnull (button_ok); @@ -238,7 +238,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 10 + (BUTTON_SIZE * 5)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "rightarrow-icon.png", NULL)); GtkWidget *button_right = gtk_button_new (); g_assert_nonnull (button_right); @@ -253,7 +253,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "downarrow-icon.png", NULL)); GtkWidget *button_down = gtk_button_new (); g_assert_nonnull (button_down); @@ -268,7 +268,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "volup-icon.png", NULL)); GtkWidget *button_vol_up = gtk_button_new (); g_assert_nonnull (button_vol_up); @@ -280,7 +280,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 7)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "menu-icon.png", NULL)); GtkWidget *button_menu = gtk_button_new (); g_assert_nonnull (button_menu); @@ -292,7 +292,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + BUTTON_SIZE, offSetY + 20 + (BUTTON_SIZE * 7)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "close-icon.png", NULL)); GtkWidget *button_close = gtk_button_new (); g_assert_nonnull (button_close); @@ -305,7 +305,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 7)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "chup-icon.png", NULL)); GtkWidget *button_ch_up = gtk_button_new (); g_assert_nonnull (button_ch_up); @@ -320,7 +320,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "voldown-icon.png", NULL)); GtkWidget *button_vol_down = gtk_button_new (); g_assert_nonnull (button_vol_down); @@ -332,7 +332,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 8)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "settings-icon.png", NULL)); GtkWidget *button_menu2 = gtk_button_new (); g_assert_nonnull (button_menu2); @@ -344,7 +344,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + BUTTON_SIZE, offSetY + 20 + (BUTTON_SIZE * 8)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "settings-icon.png", NULL)); GtkWidget *button_info2 = gtk_button_new (); g_assert_nonnull (button_info2); @@ -357,7 +357,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 8)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "chdown-icon.png", NULL)); GtkWidget *button_ch_down = gtk_button_new (); g_assert_nonnull (button_ch_down); @@ -372,7 +372,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file (g_build_path ( - G_DIR_SEPARATOR_S, GINGADATADIR, "icons/common/red-icon.png", NULL)); + G_DIR_SEPARATOR_S, get_installation_directory (), "icons/common/red-icon.png", NULL)); GtkWidget *button_red = gtk_button_new (); g_assert_nonnull (button_red); gtk_button_set_image (GTK_BUTTON (button_red), button_icon); @@ -383,7 +383,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 9)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons/common/green-icon.png", NULL)); GtkWidget *button_green = gtk_button_new (); g_assert_nonnull (button_green); @@ -395,7 +395,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + BUTTON_SIZE, offSetY + 20 + (BUTTON_SIZE * 9)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons/common/yellow-icon.png", NULL)); GtkWidget *button_yellow = gtk_button_new (); g_assert_nonnull (button_yellow); @@ -408,7 +408,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 9)); button_icon = gtk_image_new_from_file (g_build_path ( - G_DIR_SEPARATOR_S, GINGADATADIR, "icons/common/blue-icon.png", NULL)); + G_DIR_SEPARATOR_S, get_installation_directory (), "icons/common/blue-icon.png", NULL)); GtkWidget *button_blue = gtk_button_new (); g_assert_nonnull (button_blue); gtk_button_set_image (GTK_BUTTON (button_blue), button_icon); @@ -484,7 +484,7 @@ create_tvcontrol_window (void) gtk_header_bar_set_title (GTK_HEADER_BAR (header_bar), "Control"); GtkWidget *button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, GINGADATADIR, "icons", + g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), "sidebar-icon.png", NULL)); g_assert_nonnull (button_icon); From e6e6e3ae6ff2e9f096d227855b2b5ad9924a257a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 15 May 2018 16:30:58 -0300 Subject: [PATCH 135/169] windows: Install only Adwaita icons in inno setup --- extra/windows/ginga_win_deploy_script.iss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/windows/ginga_win_deploy_script.iss b/extra/windows/ginga_win_deploy_script.iss index 0e3b668e5..74cedd3af 100644 --- a/extra/windows/ginga_win_deploy_script.iss +++ b/extra/windows/ginga_win_deploy_script.iss @@ -18,7 +18,7 @@ Root: HKCR; Subkey: "{#MyAppName}"; ValueData: "Program {#My Root: HKCR; Subkey: "{#MyAppName}\DefaultIcon"; ValueData: "{app}\ginga\{#MyAppExeName},0"; ValueType: string; ValueName: "" Root: HKCR; Subkey: "{#MyAppName}\shell\open\command"; ValueData: """{app}\ginga\{#MyAppExeName}"" ""%1"""; ValueType: string; ValueName: "" -[Setup] +[Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) @@ -56,11 +56,11 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{ Source: "C:\msys64\mingw64\bin\gingagui.exe"; DestDir: "{app}\ginga\"; Flags: ignoreversion ; Ginga-gui GTK icons & depends -;Source: "C:\msys64\mingw64\share\icons\Adwaita\16x16\*"; DestDir: "{app}\ginga\share\icons\Adwaita\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs -;Source: "C:\msys64\mingw64\share\icons\hicolor\16x16\*"; DestDir: "{app}\ginga\share\icons\hicolor\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs -;Source: "C:\msys64\mingw64\share\icons\hicolor\index.theme"; DestDir: "{app}\ginga\share\icons\hicolor"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\icons\Adwaita\16x16\*"; DestDir: "{app}\ginga\share\icons\Adwaita\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\icons\hicolor\16x16\*"; DestDir: "{app}\ginga\share\icons\hicolor\16x16"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "C:\msys64\mingw64\share\icons\hicolor\index.theme"; DestDir: "{app}\ginga\share\icons\hicolor"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "C:\msys64\mingw64\share\glib-2.0\*"; DestDir: "{app}\ginga\share\glib-2.0"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "C:\msys64\mingw64\share\icons\*"; DestDir: "{app}\ginga\share\icons"; Flags: ignoreversion recursesubdirs createallsubdirs +;Source: "C:\msys64\mingw64\share\icons\hicolor\*"; DestDir: "{app}\ginga\share\icons"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "C:\msys64\mingw64\share\ginga\*"; DestDir: "{app}\ginga\share\ginga"; Flags: ignoreversion recursesubdirs createallsubdirs ; Nclua deps From e30c5f72622dc86cc2d135bdc46e0c4107602c64 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 15 May 2018 16:33:13 -0300 Subject: [PATCH 136/169] gui: Add env_init function to configure GST_PLUGIN_PATH variable --- src-gui/ginga-gtk.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index 6484607d6..6651b9a5e 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -107,6 +107,38 @@ get_installation_directory (void) return dir; } + + +void +env_init () +{ + static gboolean env_initialized = FALSE; + + if(env_initialized) + g_error ("env_init() must only be called once!"); + env_initialized = TRUE; + +#ifdef PLATFORM_OSX + const gchar *ldpath = g_getenv ("GST_PLUGIN_PATH"); + gchar *libdir = g_build_filename (gimp_installation_directory (), + "lib", + NULL); + + if (ldpath && *ldpath) + { + gchar *tmp = g_strconcat (libdir, ":", ldpath, NULL); + g_setenv ("GST_PLUGIN_PATH", tmp, TRUE); + g_free (tmp); + } + else + { + g_setenv ("GST_PLUGIN_PATH", libdir, TRUE); + } + g_free (libdir); +#endif + +} + int main (int argc, char **argv) { @@ -134,6 +166,7 @@ main (int argc, char **argv) GINGA = Ginga::create (&opts); g_assert_nonnull (GINGA); + env_init (); gtk_init (&saved_argc, &saved_argv); // Parse command-line options. From ce82668c477ec292e6313b396f19cd5e73cfb34a Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 15 May 2018 17:03:28 -0300 Subject: [PATCH 137/169] autotools: Set PLATFORM_OSX if in Mac OS X, because this is not handled by glib --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 7ef040289..a6d409c1d 100644 --- a/configure.ac +++ b/configure.ac @@ -131,6 +131,21 @@ AC_LANG_PUSH([C]) AU_ARG_ENABLE_WARNINGS([$nw]) AC_LANG_POP +# Check for MacOS X +platform_osx=no +AC_MSG_CHECKING([if compiling for Mac OS X]) +case "$host_os" in + darwin*) + AC_MSG_RESULT(yes) + AC_DEFINE(PLATFORM_OSX, 1, [define to 1 if compiling for Mac OS X]) + platform_osx=yes + ;; + *) + ;; +esac +AC_MSG_RESULT($platform_osx) +AM_CONDITIONAL(PLATFORM_OSX, test "x$platform_osx" = xyes) + # Required dependencies. AU_VERSION_BREAK([cairo], cairo_required_version) AU_CHECK_PKG([CAIRO], [cairo >= cairo_required_version], From 1c58937199076b651f115ce13bea008d8e27daa0 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 15 May 2018 17:46:26 -0300 Subject: [PATCH 138/169] gui: Add get_data_dir and fix get_installation_dir --- src-gui/Makefile.am | 11 +++++- src-gui/ginga-gtk.cpp | 58 +++++++++++++++++++----------- src-gui/ginga_gtk.h | 2 +- src-gui/view/BigPictureWindow.cpp | 6 ++-- src-gui/view/MainWindow.cpp | 42 +++++++++++----------- src-gui/view/TvControlWindow.cpp | 60 +++++++++++++++---------------- 6 files changed, 103 insertions(+), 76 deletions(-) diff --git a/src-gui/Makefile.am b/src-gui/Makefile.am index bd5579d73..325c98538 100644 --- a/src-gui/Makefile.am +++ b/src-gui/Makefile.am @@ -23,8 +23,17 @@ SUBDIRS= icons style AM_CPPFLAGS= -I$(top_srcdir)/lib -I$(top_builddir)/lib\ -DABS_TOP_SRCDIR=\"$(abs_top_srcdir)\"\ -DGINGADATADIR=\"$(gingadatadir)\" + -DGINGABINDIR=\"$(bindir)\" + +if PLATFORM_OSX + xobjective_c = "-xobjective-c" + xobjective_cxx = "-xobjective-c++" + xnone = "-xnone" + FRAMEWORK_COCOA = -framework Cocoa +endif + AM_CXXFLAGS= $(CAIRO_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(SOUP_CFLAGS) -AM_LDFLAGS= $(CAIRO_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(SOUP_LIBS) +AM_LDFLAGS= $(CAIRO_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(SOUP_LIBS) $(FRAMEWORK_COCOA) bin_PROGRAMS= gingagui gingagui_CXXFLAGS= $(AM_CXXFLAGS) diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index 6651b9a5e..397462799 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -27,6 +27,10 @@ using namespace ::std; #include #endif +#ifdef PLATFORM_OSX +#include +#endif + // Global formatter Ginga *GINGA = nullptr; gchar *gingaID = nullptr; @@ -52,7 +56,7 @@ init_ginga_data () #if defined(G_OS_WIN32) -static HMODULE libgimpbase_dll = NULL; +static HMODULE libbase_dll = NULL; BOOL WINAPI /* Avoid silly "no previous prototype" gcc warning */ DllMain (HINSTANCE hinstDLL, @@ -67,7 +71,7 @@ DllMain (HINSTANCE hinstDLL, switch (fdwReason) { case DLL_PROCESS_ATTACH: - libgimpbase_dll = hinstDLL; + libbase_dll = hinstDLL; break; } @@ -76,12 +80,12 @@ DllMain (HINSTANCE hinstDLL, #endif const gchar * -get_installation_directory (void) +get_installation_dir (void) { - static gchar *dir = NULL; + static gchar *instalationdir = NULL; - if (dir) - return dir; + if (instalationdir) + return instalationdir; #ifdef PLATFORM_OSX NSAutoreleasePool *pool; @@ -92,22 +96,35 @@ get_installation_directory (void) path = NSSearchPathForDirectoriesInDomains (NSApplicationSupportDirectory, NSUserDomainMask, YES); library_dir = [path objectAtIndex:0]; - dir = g_build_filename ([library_dir UTF8String], - GIMPDIR, GIMP_USER_VERSION, NULL); + instalationdir = [library_dir UTF8String]; [pool drain]; #elif defined G_OS_WIN32 - gchar * tmpdir = g_win32_get_package_installation_directory_of_module (libgimpbase_dll); - if (! tmpdir) + instalationdir = g_win32_get_package_installation_directory_of_module (libbase_dll); + if (! instalationdir) g_error ("g_win32_get_package_installation_directory_of_module() failed"); - dir = g_build_filename (tmpdir, "share", "ginga", NULL); #else - dir = GINGADATADIR; + instalationdir = GINGABINDIR; #endif - return dir; + return instalationdir; } +const gchar * +get_data_dir (void) +{ + static gchar *datadir = NULL; + if (datadir) + return datadir; + +#if defined PLATFORM_OSX || defined G_OS_WIN32 + datadir = g_build_filename (get_installation_dir (), "share", "ginga", NULL); +#else + datadir = GINGADATADIR; +#endif + + return datadir; +} void env_init () @@ -120,8 +137,7 @@ env_init () #ifdef PLATFORM_OSX const gchar *ldpath = g_getenv ("GST_PLUGIN_PATH"); - gchar *libdir = g_build_filename (gimp_installation_directory (), - "lib", + gchar *libdir = g_build_filename (get_installation_dir (),"lib", NULL); if (ldpath && *ldpath) @@ -152,10 +168,10 @@ main (int argc, char **argv) saved_argc = argc; saved_argv = g_strdupv (argv); -#ifdef G_OS_WIN32 - HWND var = GetConsoleWindow (); - ShowWindow (var, SW_HIDE); -#endif +// #ifdef G_OS_WIN32 +// HWND var = GetConsoleWindow (); +// ShowWindow (var, SW_HIDE); +// #endif opts.width = presentationAttributes.resolutionWidth; opts.height = presentationAttributes.resolutionHeight; @@ -186,8 +202,10 @@ main (int argc, char **argv) setlocale (LC_ALL, "C"); + puts(get_data_dir ()); + gtk_window_set_default_icon_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", "common", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", "common", "ginga_icon.png", NULL), &error); diff --git a/src-gui/ginga_gtk.h b/src-gui/ginga_gtk.h index 80599de69..377b9db95 100644 --- a/src-gui/ginga_gtk.h +++ b/src-gui/ginga_gtk.h @@ -126,6 +126,6 @@ void load_settings (void); void send_http_log_message (gint, const gchar *); /* util */ -const gchar * get_installation_directory(); +const gchar * get_data_dir(); #endif /* GINGA_GTK_H */ diff --git a/src-gui/view/BigPictureWindow.cpp b/src-gui/view/BigPictureWindow.cpp index fd25daef9..9f3547309 100644 --- a/src-gui/view/BigPictureWindow.cpp +++ b/src-gui/view/BigPictureWindow.cpp @@ -94,7 +94,7 @@ instantiateInAppLibrary (unused (xmlDocPtr doc), xmlNodePtr cur) = cairo_image_surface_create_from_png ((gchar *) thumbnail); else bigPictureCard->surface = cairo_image_surface_create_from_png ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", "common", "app_thumbnail.png", NULL)); if (g_file_test ((gchar *) cover, G_FILE_TEST_EXISTS)) @@ -103,7 +103,7 @@ instantiateInAppLibrary (unused (xmlDocPtr doc), xmlNodePtr cur) else bigPictureCard->print_surface = cairo_image_surface_create_from_png ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", "common", "app_cover.png", NULL)); bigPictureCard->src = g_strdup ((gchar *) src); @@ -381,7 +381,7 @@ create_bigpicture_window () return; cairo_surface_t *image_p = cairo_image_surface_create_from_png ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", "common", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", "common", "background_pattern.png", NULL)); g_assert_nonnull (image_p); diff --git a/src-gui/view/MainWindow.cpp b/src-gui/view/MainWindow.cpp index 6ec8eb932..319fcd54a 100644 --- a/src-gui/view/MainWindow.cpp +++ b/src-gui/view/MainWindow.cpp @@ -206,10 +206,10 @@ apply_theme () gchar *filename; if (presentationAttributes.guiTheme == 0) - filename = g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "style", + filename = g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "style", "light.css", NULL); else - filename = g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "style", + filename = g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "style", "dark.css", NULL); GFile *file = g_file_new_for_path (filename); @@ -226,82 +226,82 @@ apply_theme () } GtkWidget *img_icon = gtk_image_new_from_file (g_build_path ( - G_DIR_SEPARATOR_S, get_installation_directory (), "icons", get_icon_folder (), + G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), (inPlayMode ? "pause-icon.png" : "play-icon.png"), NULL)); gtk_button_set_image (GTK_BUTTON (playButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "stop-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (stopButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "fullscreen-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (fullscreenButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "settings-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (settingsButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "remote-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (remoteButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "debug-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (debugButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "openfile-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (openButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "history-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (histButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "tools-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (toolsButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "info-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (aboutButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "question-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (helpButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "question-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (helpButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "screen-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (bigpictureButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "bottomhide-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (consoleHideButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "rightride-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (sidebarHideButton), img_icon); img_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "window-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (sidebarWinButton), img_icon); @@ -1040,7 +1040,7 @@ stop_button_callback (void) { inPlayMode = false; GtkWidget *play_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "play-icon.png", NULL)); gtk_button_set_image (GTK_BUTTON (playButton), play_icon); gtk_widget_set_sensitive (fileEntry, true); @@ -1056,7 +1056,7 @@ play_pause_button_callback (void) { inPlayMode = !inPlayMode; /* GtkWidget *play_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "play-icon.png", NULL)); */ if (inPlayMode) { @@ -1071,7 +1071,7 @@ play_pause_button_callback (void) } /* play_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "pause-icon.png", NULL)); */ gtk_widget_set_sensitive (fileEntry, false); gtk_widget_set_sensitive (openButton, false); diff --git a/src-gui/view/TvControlWindow.cpp b/src-gui/view/TvControlWindow.cpp index 2a9c23e90..3104b667e 100644 --- a/src-gui/view/TvControlWindow.cpp +++ b/src-gui/view/TvControlWindow.cpp @@ -39,7 +39,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) g_assert_nonnull (fixed_layout); GtkWidget *button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_one.png", NULL)); GtkWidget *button_1 = gtk_button_new (); g_assert_nonnull (button_1); @@ -51,7 +51,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos - BUTTON_SIZE, offSetY + 0); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_two.png", NULL)); GtkWidget *button_2 = gtk_button_new (); g_assert_nonnull (button_2); @@ -63,7 +63,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos, offSetY + 0); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_three.png", NULL)); GtkWidget *button_3 = gtk_button_new (); g_assert_nonnull (button_3); @@ -77,7 +77,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_four.png", NULL)); GtkWidget *button_4 = gtk_button_new (); g_assert_nonnull (button_4); @@ -90,7 +90,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + BUTTON_SIZE); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_five.png", NULL)); GtkWidget *button_5 = gtk_button_new (); g_assert_nonnull (button_5); @@ -102,7 +102,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos, offSetY + BUTTON_SIZE); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_six.png", NULL)); GtkWidget *button_6 = gtk_button_new (); g_assert_nonnull (button_6); @@ -117,7 +117,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_seven.png", NULL)); GtkWidget *button_7 = gtk_button_new (); g_assert_nonnull (button_7); @@ -130,7 +130,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + (BUTTON_SIZE * 2)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_eight.png", NULL)); GtkWidget *button_8 = gtk_button_new (); g_assert_nonnull (button_8); @@ -142,7 +142,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos, offSetY + (BUTTON_SIZE * 2)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_nine.png", NULL)); GtkWidget *button_9 = gtk_button_new (); g_assert_nonnull (button_9); @@ -157,7 +157,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "back_arrow.png", NULL)); GtkWidget *button_back = gtk_button_new (); g_assert_nonnull (button_back); @@ -170,7 +170,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + (BUTTON_SIZE * 3)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "number_zero.png", NULL)); GtkWidget *button_0 = gtk_button_new (); g_assert_nonnull (button_0); @@ -182,7 +182,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + middle_button_pos, offSetY + (BUTTON_SIZE * 3)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "info-icon.png", NULL)); GtkWidget *button_info = gtk_button_new (); g_assert_nonnull (button_info); @@ -197,7 +197,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "uparrow-icon.png", NULL)); GtkWidget *button_up = gtk_button_new (); g_assert_nonnull (button_up); @@ -212,7 +212,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "leftarrow-icon.png", NULL)); GtkWidget *button_left = gtk_button_new (); g_assert_nonnull (button_left); @@ -225,7 +225,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 10 + (BUTTON_SIZE * 5)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "ok-icon.png", NULL)); GtkWidget *button_ok = gtk_button_new (); g_assert_nonnull (button_ok); @@ -238,7 +238,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 10 + (BUTTON_SIZE * 5)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "rightarrow-icon.png", NULL)); GtkWidget *button_right = gtk_button_new (); g_assert_nonnull (button_right); @@ -253,7 +253,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "downarrow-icon.png", NULL)); GtkWidget *button_down = gtk_button_new (); g_assert_nonnull (button_down); @@ -268,7 +268,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "volup-icon.png", NULL)); GtkWidget *button_vol_up = gtk_button_new (); g_assert_nonnull (button_vol_up); @@ -280,7 +280,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 7)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "menu-icon.png", NULL)); GtkWidget *button_menu = gtk_button_new (); g_assert_nonnull (button_menu); @@ -292,7 +292,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + BUTTON_SIZE, offSetY + 20 + (BUTTON_SIZE * 7)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "close-icon.png", NULL)); GtkWidget *button_close = gtk_button_new (); g_assert_nonnull (button_close); @@ -305,7 +305,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 7)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "chup-icon.png", NULL)); GtkWidget *button_ch_up = gtk_button_new (); g_assert_nonnull (button_ch_up); @@ -320,7 +320,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "voldown-icon.png", NULL)); GtkWidget *button_vol_down = gtk_button_new (); g_assert_nonnull (button_vol_down); @@ -332,7 +332,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 8)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "settings-icon.png", NULL)); GtkWidget *button_menu2 = gtk_button_new (); g_assert_nonnull (button_menu2); @@ -344,7 +344,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + BUTTON_SIZE, offSetY + 20 + (BUTTON_SIZE * 8)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "settings-icon.png", NULL)); GtkWidget *button_info2 = gtk_button_new (); g_assert_nonnull (button_info2); @@ -357,7 +357,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 8)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "chdown-icon.png", NULL)); GtkWidget *button_ch_down = gtk_button_new (); g_assert_nonnull (button_ch_down); @@ -372,7 +372,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) // button_icon = gtk_image_new_from_file (g_build_path ( - G_DIR_SEPARATOR_S, get_installation_directory (), "icons/common/red-icon.png", NULL)); + G_DIR_SEPARATOR_S, get_data_dir (), "icons/common/red-icon.png", NULL)); GtkWidget *button_red = gtk_button_new (); g_assert_nonnull (button_red); gtk_button_set_image (GTK_BUTTON (button_red), button_icon); @@ -383,7 +383,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 9)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons/common/green-icon.png", NULL)); GtkWidget *button_green = gtk_button_new (); g_assert_nonnull (button_green); @@ -395,7 +395,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetX + BUTTON_SIZE, offSetY + 20 + (BUTTON_SIZE * 9)); button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons/common/yellow-icon.png", NULL)); GtkWidget *button_yellow = gtk_button_new (); g_assert_nonnull (button_yellow); @@ -408,7 +408,7 @@ create_tvremote_buttons (guint offSetX, guint offSetY) offSetY + 20 + (BUTTON_SIZE * 9)); button_icon = gtk_image_new_from_file (g_build_path ( - G_DIR_SEPARATOR_S, get_installation_directory (), "icons/common/blue-icon.png", NULL)); + G_DIR_SEPARATOR_S, get_data_dir (), "icons/common/blue-icon.png", NULL)); GtkWidget *button_blue = gtk_button_new (); g_assert_nonnull (button_blue); gtk_button_set_image (GTK_BUTTON (button_blue), button_icon); @@ -484,7 +484,7 @@ create_tvcontrol_window (void) gtk_header_bar_set_title (GTK_HEADER_BAR (header_bar), "Control"); GtkWidget *button_icon = gtk_image_new_from_file ( - g_build_path (G_DIR_SEPARATOR_S, get_installation_directory (), "icons", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", get_icon_folder (), "sidebar-icon.png", NULL)); g_assert_nonnull (button_icon); From 64d53eb2aae52797b9d6d1b3edb6346ecf4c75a4 Mon Sep 17 00:00:00 2001 From: Antonio Busson Date: Tue, 15 May 2018 17:59:04 -0300 Subject: [PATCH 139/169] macos: new bundle gen --- extra/macos/osx_bundle_gen.py | 61 ++++++++++++++++++++++++++++------ extra/macos/pkg_pos_install.sh | 3 +- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/extra/macos/osx_bundle_gen.py b/extra/macos/osx_bundle_gen.py index 02db7ac72..8c7afb5b7 100644 --- a/extra/macos/osx_bundle_gen.py +++ b/extra/macos/osx_bundle_gen.py @@ -24,6 +24,17 @@ DYLIBS_COUNT = 0 processed_dylibs = [] +dylibs_list = [] + +def get_dylib_path(ori_path): + ori_path = ori_path.split("/") + new_path = "" + for i, folder in enumerate(ori_path): + if i == 0 or i == (len(ori_path)-1): + continue + new_path+="/"+folder + return new_path + def process_dylib(line_index, otool_line, binary_path): global DYLIBS_COUNT if otool_line == "" : @@ -39,27 +50,56 @@ def process_dylib(line_index, otool_line, binary_path): #print("ERRO: ", dylib_path, "is system reserved! Next!") return - if not pathlib.Path('Ginga.app/Contents/Frameworks/'+dylib_name).is_file(): - subprocess.call('cp '+dylib_path+' Ginga.app/Contents/Frameworks/', shell=True) - print(DYLIBS_COUNT, dylib_path) + cur_path = get_dylib_path(dylib_path) + + if '/usr/lib' == cur_path: + if not pathlib.Path('Ginga.app/Contents/Frameworks/'+dylib_name).is_file(): + print(DYLIBS_COUNT, dylib_path, "->" , 'Ginga.app/Contents/Frameworks/'+dylib_name) + subprocess.call('cp '+dylib_path+' Ginga.app/Contents/Frameworks/', shell=True) + dylibs_list.append('Ginga.app/Contents/Frameworks/'+dylib_name) + subprocess.call('install_name_tool -change '+dylib_path+' @executable_path/../Frameworks/'+dylib_name+' '+binary_path, shell=True) + return + + if not pathlib.Path('Ginga.app/Contents/Frameworks'+cur_path+'/'+dylib_name).is_file(): + subprocess.call('mkdir -p Ginga.app/Contents/Frameworks'+cur_path+'/', shell=True) + subprocess.call('cp '+dylib_path+' Ginga.app/Contents/Frameworks'+cur_path+'/', shell=True) + dylibs_list.append('Ginga.app/Contents/Frameworks'+cur_path+'/'+dylib_name) + print(DYLIBS_COUNT, dylib_path, "->" , 'Ginga.app/Contents/Frameworks'+cur_path+'/'+dylib_name) + #print('install_name_tool -change '+dylib_path+' @executable_path/../Frameworks/'+dylib_name+' '+binary_path) DYLIBS_COUNT = DYLIBS_COUNT + 1 - subprocess.call('install_name_tool -change '+dylib_path+' @executable_path/../Frameworks/'+dylib_name+' '+binary_path, shell=True) + #subprocess.call('install_name_tool -change '+dylib_path+' @executable_path/../Frameworks/'+dylib_name+' '+binary_path, shell=True) def process_binary(binary_path): binary_dependencies = subprocess.Popen('otool -L '+binary_path, shell=True, stdout=subprocess.PIPE ).communicate()[0].decode("utf-8") binary_dependencies = binary_dependencies.split('\n') for index,dependency in enumerate(binary_dependencies): - process_dylib(index, dependency, binary_path) + if "/usr/lib/system/" not in binary_dependencies[index]: + process_dylib(index, dependency, binary_path) -subprocess.call('mkdir -p Ginga.app/Contents/{MacOS,Resources,Frameworks,Resources/share}', shell=True) -subprocess.call('cp ../../src-gui/.libs/gingagui Ginga.app/Contents/MacOS/Ginga', shell=True) +subprocess.call('mkdir -p Ginga.app/Contents/{MacOS,Resources,Frameworks,Frameworks/usr,Frameworks/usr/local,Frameworks/usr/local/share,Frameworks/usr/local/lib,Frameworks/usr/local/Cellar,Frameworks/usr/local/opt}', shell=True) +subprocess.call('cp ../../src-gui/gingagui Ginga.app/Contents/MacOS/Ginga', shell=True) subprocess.call('cp Icon.icns Ginga.app/Contents/Resources/', shell=True) subprocess.call('cp Info.plist Ginga.app/Contents/', shell=True) -subprocess.call('cp -r /usr/local/share/ginga* Ginga.app/Contents/Resources/share', shell=True) -subprocess.call('cp -r /usr/local/share/glib-2.0* Ginga.app/Contents/Resources/share', shell=True) -subprocess.call('cp -r /usr/local/share/icons* Ginga.app/Contents/Resources/share', shell=True) +subprocess.call('cp -r /usr/local/share/ginga* Ginga.app/Contents/Frameworks/usr/local/share', shell=True) +subprocess.call('cp -r /usr/local/share/glib-2.0* Ginga.app/Contents/Frameworks/usr/local/share', shell=True) +subprocess.call('cp -r /usr/local/share/icons* Ginga.app/Contents/Frameworks/usr/local/share', shell=True) +subprocess.call('cp -r /usr/local/share/lua* Ginga.app/Contents/Frameworks/usr/local/share', shell=True) +subprocess.call('cp -r /usr/local/lib/lua* Ginga.app/Contents/Frameworks/usr/local/lib', shell=True) +subprocess.call('cp -r /usr/local/lib/gdk-pixbuf-2.0* Ginga.app/Contents/Frameworks/usr/local/lib', shell=True) +subprocess.call('cp -r /usr/local/Cellar/gdk-pixbuf* Ginga.app/Contents/Frameworks/usr/local/Cellar', shell=True) +subprocess.call('cp -r /usr/local/Cellar/gst-plugins-ugly* Ginga.app/Contents/Frameworks/usr/local/Cellar', shell=True) +subprocess.call('cp -r /usr/local/Cellar/gst-plugins-bad* Ginga.app/Contents/Frameworks/usr/local/Cellar', shell=True) +subprocess.call('cp -r /usr/local/Cellar/gst-plugins-good* Ginga.app/Contents/Frameworks/usr/local/Cellar', shell=True) +subprocess.call('cp -r /usr/local/Cellar/gst-plugins-base* Ginga.app/Contents/Frameworks/usr/local/Cellar', shell=True) +subprocess.call('cp -r /usr/local/Cellar/gstreamer* Ginga.app/Contents/Frameworks/usr/local/Cellar', shell=True) +subprocess.call('cp -r /usr/local/opt/gst-plugins-ugly* Ginga.app/Contents/Frameworks/usr/local/opt', shell=True) +subprocess.call('cp -r /usr/local/opt/gst-plugins-bad* Ginga.app/Contents/Frameworks/usr/local/opt', shell=True) +subprocess.call('cp -r /usr/local/opt/gst-plugins-good* Ginga.app/Contents/Frameworks/usr/local/opt', shell=True) +subprocess.call('cp -r /usr/local/opt/gst-plugins-base* Ginga.app/Contents/Frameworks/usr/local/opt', shell=True) + + #process main binary process_binary('Ginga.app/Contents/MacOS/Ginga') @@ -67,7 +107,6 @@ def process_binary(binary_path): #process dylibs dependences while(True): need_iterate = False - dylibs_list = glob.glob("Ginga.app/Contents/Frameworks/*.dylib") for dylib in dylibs_list: if dylib not in processed_dylibs: processed_dylibs.append(dylib) diff --git a/extra/macos/pkg_pos_install.sh b/extra/macos/pkg_pos_install.sh index d68843346..ae2588838 100644 --- a/extra/macos/pkg_pos_install.sh +++ b/extra/macos/pkg_pos_install.sh @@ -16,5 +16,4 @@ # You should have received a copy of the GNU General Public License # along with Ginga. If not, see . -cp -r /Applications/Ginga.app/Contents/Resources/share/glib-2.0* /usr/local/share -cp -r /Applications/Ginga.app/Contents/Resources/share/icons* /usr/local/share +cp -r /Applications/Ginga.app/Contents/Frameworks/usr/local* /usr/ \ No newline at end of file From 4ac8baebc6baba2ace93767de8384dc2b50499b9 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Fri, 11 May 2018 21:06:15 -0300 Subject: [PATCH 140/169] macos: Fix macos README.md --- extra/macos/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/macos/README.md b/extra/macos/README.md index cb17c296c..3b156519e 100644 --- a/extra/macos/README.md +++ b/extra/macos/README.md @@ -1,6 +1,6 @@ ## Building the repository on macOS -Download [brew](). +Download [brew](). To install the dependencies run on macOS terminal: From 2c4a66a9ef2ffa8d65346ab84f75dec5c79f84bb Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Wed, 16 May 2018 17:40:54 -0300 Subject: [PATCH 141/169] build: Fix src-gui/Makefile.am --- src-gui/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-gui/Makefile.am b/src-gui/Makefile.am index 325c98538..86c1b0588 100644 --- a/src-gui/Makefile.am +++ b/src-gui/Makefile.am @@ -22,7 +22,7 @@ SUBDIRS= icons style AM_CPPFLAGS= -I$(top_srcdir)/lib -I$(top_builddir)/lib\ -DABS_TOP_SRCDIR=\"$(abs_top_srcdir)\"\ - -DGINGADATADIR=\"$(gingadatadir)\" + -DGINGADATADIR=\"$(gingadatadir)\"\ -DGINGABINDIR=\"$(bindir)\" if PLATFORM_OSX From 07bdd349cfc1eece3165d59d4e75650f22953193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Fri, 18 May 2018 16:53:29 -0300 Subject: [PATCH 142/169] build: Adding icon-gingagui.ico and files to launchpad build * debian/application-x-ncl-NCL.xml * debian/ginga.desktop * debian/postinst.ex * src-gui/icons/Makefile.am * src-gui/icons/common/icon-gingagui.ico --- debian/application-x-ncl-NCL.xml | 10 ++++++++++ debian/ginga.desktop | 13 +++++++++++++ debian/postinst.ex | 24 ++++++++++++++++++++++++ src-gui/icons/Makefile.am | 1 + src-gui/icons/common/icon-gingagui.ico | Bin 0 -> 353118 bytes 5 files changed, 48 insertions(+) create mode 100644 debian/application-x-ncl-NCL.xml create mode 100644 debian/ginga.desktop create mode 100644 debian/postinst.ex create mode 100644 src-gui/icons/common/icon-gingagui.ico diff --git a/debian/application-x-ncl-NCL.xml b/debian/application-x-ncl-NCL.xml new file mode 100644 index 000000000..1c86fe9a3 --- /dev/null +++ b/debian/application-x-ncl-NCL.xml @@ -0,0 +1,10 @@ + + + + Applicação NCL + NCL Application + + + + + diff --git a/debian/ginga.desktop b/debian/ginga.desktop new file mode 100644 index 000000000..b0bb71bf6 --- /dev/null +++ b/debian/ginga.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Name=Ginga +Exec=/usr/bin/ginga +Comment=Ginga Player +Icon=/usr/share/pixmaps/icon-gingagui.ico +StartupNotify=false +Encoding=UTF-8 +Categories=AudioVideo; +MimeType=application/x-ncl-NCL +Keywords=Player;Audio;Video; diff --git a/debian/postinst.ex b/debian/postinst.ex new file mode 100644 index 000000000..d0021fd49 --- /dev/null +++ b/debian/postinst.ex @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + xdg-mime install application-x-ncl-NCL.xml + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/src-gui/icons/Makefile.am b/src-gui/icons/Makefile.am index 790096566..4a38550cd 100644 --- a/src-gui/icons/Makefile.am +++ b/src-gui/icons/Makefile.am @@ -29,6 +29,7 @@ icons_DATA=\ common_DATA=\ common/blue-icon.png\ common/ginga_icon.png\ + common/icon-gingagui.ico\ common/green-icon.png\ common/red-icon.png\ common/yellow-icon.png\ diff --git a/src-gui/icons/common/icon-gingagui.ico b/src-gui/icons/common/icon-gingagui.ico new file mode 100644 index 0000000000000000000000000000000000000000..1f398cb39d6f93108deee8f49954895ab08e6751 GIT binary patch literal 353118 zcmeFa2b@$@(*ED?@4vpTtbq)YhnzElA_mNHO>4rO^RDS#!*Gwc1JaDr_OCN}jpO0lD#`kz&*540& zdD(8aeDbX#?f74=NZ_IGe%gHh(M$I3bnlFNwN~$I&3@Jzu63NVwsmfvV71h0-!$H8 zs%<^Eux&YboW-qr%OI)`=m&a&zMwa58&Y;*jr8jWafjvN3;#UmG}u^z>FjT^@q?YC+PVL!B+CtBi`NtPHo)e^T)Q=4vy z;WOe^Eo7jz9;P)PrnMhB#S*tpwgmbh-T2Lod*@l=xpyrw z;cH9G{mBwb*2FEALGe1UXtgC~|7eLfzp%v9(i`*#A0gXNLk<1HCb&I_@&oDRf0a{u zMLC51;iZ+0k*avV^XGorO0n0C&2FFa2{9SCN9K6`V2s!;TvpGx^^C=wH|V&xP|oYbkl%+i2*d zAEUk=*>35We`t{~FFwCeT+P?4I6N=V8pkb`L3wnbINfsH<2vrkWUO%0gmjDmM}@1p z9q4lZ%sc-y@6%TKj?;}X{t;h(zoq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 Subject: [PATCH 143/169] build: Fixing link icon * debian/ginga.desktop --- debian/ginga.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/ginga.desktop b/debian/ginga.desktop index b0bb71bf6..406e5c2e8 100644 --- a/debian/ginga.desktop +++ b/debian/ginga.desktop @@ -3,7 +3,7 @@ Version=1.0 Type=Application Terminal=false Name=Ginga -Exec=/usr/bin/ginga +Exec=/usr/bin/gingagui Comment=Ginga Player Icon=/usr/share/pixmaps/icon-gingagui.ico StartupNotify=false From 8001e2582c5c647b485c3afd330c872262e1449a Mon Sep 17 00:00:00 2001 From: Antonio Busson Date: Sun, 20 May 2018 17:23:10 -0300 Subject: [PATCH 144/169] extra/macos: bundler generator for macos fixed --- configure.ac | 2 + extra/macos/osx_bundle_gen.py | 12 ++-- src-gui/Makefile.am | 10 ++-- src-gui/ginga-gtk.cpp | 109 +++++++++++++++++++--------------- 4 files changed, 74 insertions(+), 59 deletions(-) diff --git a/configure.ac b/configure.ac index a6d409c1d..272732ef7 100644 --- a/configure.ac +++ b/configure.ac @@ -321,8 +321,10 @@ AC_SUBST([GINGA_ALL_LDFLAGS]) # Directories. gingadatadir="$datadir/$PACKAGE" gingasysconfdir="$sysconfdir/$PACKAGE" +gingabindir="$bindir" AC_SUBST([gingadatadir]) AC_SUBST([gingasysconfdir]) +AC_SUBST([gingabindir]) # Epilogue. AC_CONFIG_FILES([ diff --git a/extra/macos/osx_bundle_gen.py b/extra/macos/osx_bundle_gen.py index 8c7afb5b7..28a4b2bd5 100644 --- a/extra/macos/osx_bundle_gen.py +++ b/extra/macos/osx_bundle_gen.py @@ -58,6 +58,7 @@ def process_dylib(line_index, otool_line, binary_path): subprocess.call('cp '+dylib_path+' Ginga.app/Contents/Frameworks/', shell=True) dylibs_list.append('Ginga.app/Contents/Frameworks/'+dylib_name) subprocess.call('install_name_tool -change '+dylib_path+' @executable_path/../Frameworks/'+dylib_name+' '+binary_path, shell=True) + DYLIBS_COUNT = DYLIBS_COUNT + 1 return if not pathlib.Path('Ginga.app/Contents/Frameworks'+cur_path+'/'+dylib_name).is_file(): @@ -79,10 +80,12 @@ def process_binary(binary_path): process_dylib(index, dependency, binary_path) subprocess.call('mkdir -p Ginga.app/Contents/{MacOS,Resources,Frameworks,Frameworks/usr,Frameworks/usr/local,Frameworks/usr/local/share,Frameworks/usr/local/lib,Frameworks/usr/local/Cellar,Frameworks/usr/local/opt}', shell=True) -subprocess.call('cp ../../src-gui/gingagui Ginga.app/Contents/MacOS/Ginga', shell=True) +subprocess.call('cp /usr/local/bin/gingagui Ginga.app/Contents/MacOS/Ginga', shell=True) subprocess.call('cp Icon.icns Ginga.app/Contents/Resources/', shell=True) subprocess.call('cp Info.plist Ginga.app/Contents/', shell=True) -subprocess.call('cp -r /usr/local/share/ginga* Ginga.app/Contents/Frameworks/usr/local/share', shell=True) +subprocess.call('cp -r ../../src-gui/icons* Ginga.app/Contents/', shell=True) +subprocess.call('cp -r ../../src-gui/style* Ginga.app/Contents/', shell=True) + subprocess.call('cp -r /usr/local/share/glib-2.0* Ginga.app/Contents/Frameworks/usr/local/share', shell=True) subprocess.call('cp -r /usr/local/share/icons* Ginga.app/Contents/Frameworks/usr/local/share', shell=True) subprocess.call('cp -r /usr/local/share/lua* Ginga.app/Contents/Frameworks/usr/local/share', shell=True) @@ -98,7 +101,7 @@ def process_binary(binary_path): subprocess.call('cp -r /usr/local/opt/gst-plugins-bad* Ginga.app/Contents/Frameworks/usr/local/opt', shell=True) subprocess.call('cp -r /usr/local/opt/gst-plugins-good* Ginga.app/Contents/Frameworks/usr/local/opt', shell=True) subprocess.call('cp -r /usr/local/opt/gst-plugins-base* Ginga.app/Contents/Frameworks/usr/local/opt', shell=True) - +subprocess.call('cp -r /usr/local/opt/orc* Ginga.app/Contents/Frameworks/usr/local/opt', shell=True) #process main binary @@ -116,6 +119,3 @@ def process_binary(binary_path): break if not need_iterate: break - - - diff --git a/src-gui/Makefile.am b/src-gui/Makefile.am index 325c98538..4762b6a55 100644 --- a/src-gui/Makefile.am +++ b/src-gui/Makefile.am @@ -22,17 +22,15 @@ SUBDIRS= icons style AM_CPPFLAGS= -I$(top_srcdir)/lib -I$(top_builddir)/lib\ -DABS_TOP_SRCDIR=\"$(abs_top_srcdir)\"\ - -DGINGADATADIR=\"$(gingadatadir)\" - -DGINGABINDIR=\"$(bindir)\" + -DGINGADATADIR=\"$(gingadatadir)\"\ + -DGINGABINDIR=\"$(gingabindir)\" if PLATFORM_OSX - xobjective_c = "-xobjective-c" - xobjective_cxx = "-xobjective-c++" - xnone = "-xnone" + OSX_CFLAGS = "-ObjC++" FRAMEWORK_COCOA = -framework Cocoa endif -AM_CXXFLAGS= $(CAIRO_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(SOUP_CFLAGS) +AM_CXXFLAGS= $(CAIRO_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(SOUP_CFLAGS) $(OSX_CFLAGS) AM_LDFLAGS= $(CAIRO_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(SOUP_LIBS) $(FRAMEWORK_COCOA) bin_PROGRAMS= gingagui diff --git a/src-gui/ginga-gtk.cpp b/src-gui/ginga-gtk.cpp index 397462799..a22c3e9dd 100644 --- a/src-gui/ginga-gtk.cpp +++ b/src-gui/ginga-gtk.cpp @@ -27,7 +27,7 @@ using namespace ::std; #include #endif -#ifdef PLATFORM_OSX +#ifdef __APPLE__ #include #endif @@ -40,11 +40,11 @@ gchar *gingaID = nullptr; "Report bugs to: " PACKAGE_BUGREPORT "\n" \ "Ginga home page: " PACKAGE_URL -static gboolean opt_bigpicture = FALSE; // toggle bigpicture mode +static gboolean opt_bigpicture = FALSE; // toggle bigpicture mode static GOptionEntry options[] = { { "bigpicture", 'b', 0, G_OPTION_ARG_NONE, &opt_bigpicture, - "Enable bigpicture mode", NULL }, + "Enable bigpicture mode", NULL }, { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } }; void @@ -59,14 +59,10 @@ init_ginga_data () static HMODULE libbase_dll = NULL; BOOL WINAPI /* Avoid silly "no previous prototype" gcc warning */ -DllMain (HINSTANCE hinstDLL, - DWORD fdwReason, - LPVOID lpvReserved); +DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); BOOL WINAPI -DllMain (HINSTANCE hinstDLL, - DWORD fdwReason, - LPVOID lpvReserved) +DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { switch (fdwReason) { @@ -80,31 +76,41 @@ DllMain (HINSTANCE hinstDLL, #endif const gchar * -get_installation_dir (void) +get_binary_dir (void) { - static gchar *instalationdir = NULL; + static const gchar *instalationdir = NULL; if (instalationdir) return instalationdir; -#ifdef PLATFORM_OSX +#ifdef __APPLE__ NSAutoreleasePool *pool; - NSArray *path; - NSString *library_dir; + NSString *resource_path; + gchar *basename; + gchar *dirname; pool = [[NSAutoreleasePool alloc] init]; - path = NSSearchPathForDirectoriesInDomains (NSApplicationSupportDirectory, - NSUserDomainMask, YES); - library_dir = [path objectAtIndex:0]; - instalationdir = [library_dir UTF8String]; + + resource_path = [[NSBundle mainBundle] resourcePath]; + + basename = g_path_get_basename ([resource_path UTF8String]); + dirname = g_path_get_dirname ([resource_path UTF8String]); + + instalationdir = g_build_filename (dirname, basename, NULL); + + g_free (basename); + g_free (dirname); + [pool drain]; #elif defined G_OS_WIN32 - instalationdir = g_win32_get_package_installation_directory_of_module (libbase_dll); - if (! instalationdir) - g_error ("g_win32_get_package_installation_directory_of_module() failed"); + instalationdir + = g_win32_get_package_installation_directory_of_module (libbase_dll); + if (!instalationdir) + g_error ( + "g_win32_get_package_installation_directory_of_module() failed"); #else - instalationdir = GINGABINDIR; + instalationdir = (char *) GINGABINDIR; #endif return instalationdir; } @@ -117,10 +123,13 @@ get_data_dir (void) if (datadir) return datadir; -#if defined PLATFORM_OSX || defined G_OS_WIN32 - datadir = g_build_filename (get_installation_dir (), "share", "ginga", NULL); +#if defined __APPLE__ + datadir = g_path_get_dirname (get_binary_dir ()); + +#elif defined G_OS_WIN32 + datadir = g_build_filename (get_binary_dir (), "share", "ginga", NULL); #else - datadir = GINGADATADIR; + datadir = (char *) GINGADATADIR; #endif return datadir; @@ -131,15 +140,18 @@ env_init () { static gboolean env_initialized = FALSE; - if(env_initialized) + if (env_initialized) g_error ("env_init() must only be called once!"); env_initialized = TRUE; -#ifdef PLATFORM_OSX - const gchar *ldpath = g_getenv ("GST_PLUGIN_PATH"); - gchar *libdir = g_build_filename (get_installation_dir (),"lib", - NULL); +#ifdef __APPLE__ + if(!strcmp(g_path_get_basename (get_binary_dir ()), ".libs")) + return; + + const gchar *ldpath = g_getenv ("GST_PLUGIN_PATH"); + gchar *libdir = g_build_filename ("/usr", "local", "Cellar/", NULL); + printf("GST: %s \n", libdir); if (ldpath && *ldpath) { gchar *tmp = g_strconcat (libdir, ":", ldpath, NULL); @@ -151,8 +163,8 @@ env_init () g_setenv ("GST_PLUGIN_PATH", libdir, TRUE); } g_free (libdir); + #endif - } int @@ -168,10 +180,10 @@ main (int argc, char **argv) saved_argc = argc; saved_argv = g_strdupv (argv); -// #ifdef G_OS_WIN32 -// HWND var = GetConsoleWindow (); -// ShowWindow (var, SW_HIDE); -// #endif + // #ifdef G_OS_WIN32 + // HWND var = GetConsoleWindow (); + // ShowWindow (var, SW_HIDE); + // #endif opts.width = presentationAttributes.resolutionWidth; opts.height = presentationAttributes.resolutionHeight; @@ -190,10 +202,10 @@ main (int argc, char **argv) g_assert_nonnull (ctx); g_option_context_add_main_entries (ctx, options, NULL); if (!g_option_context_parse (ctx, &saved_argc, &saved_argv, &error)) - { - g_print ("option parsing failed: %s\n", error->message); - exit (1); - } + { + g_print ("option parsing failed: %s\n", error->message); + exit (1); + } g_option_context_free (ctx); init_ginga_data (); @@ -202,13 +214,15 @@ main (int argc, char **argv) setlocale (LC_ALL, "C"); - puts(get_data_dir ()); - gtk_window_set_default_icon_from_file ( g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", "common", "ginga_icon.png", NULL), &error); + printf ("PATH: %s", + g_build_path (G_DIR_SEPARATOR_S, get_data_dir (), "icons", + "common", "ginga_icon.png", NULL)); + // send log message to server send_http_log_message (0, (gchar *) "Open Ginga"); // check for ginga updates @@ -223,12 +237,13 @@ main (int argc, char **argv) } else { - if(saved_argc > 1){ - gchar *filename = saved_argv [1]; - gchar *ext = strrchr (filename, '.'); - if (!g_strcmp0 (ext, ".ncl")) - insert_historicbox (filename); - } + if (saved_argc > 1) + { + gchar *filename = saved_argv[1]; + gchar *ext = strrchr (filename, '.'); + if (!g_strcmp0 (ext, ".ncl")) + insert_historicbox (filename); + } } gtk_main (); From ffad2877d02e03f8e6095485c709e148a70a056f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 11:28:19 -0300 Subject: [PATCH 145/169] build: rename directory DEBIAN --- DEBIAN/application-x-ncl-NCL.xml | 10 ++++++++++ DEBIAN/changelog | 5 +++++ DEBIAN/compat | 1 + DEBIAN/control | 15 +++++++++++++++ DEBIAN/copyright | 1 + DEBIAN/ginga.desktop | 13 +++++++++++++ DEBIAN/postinst | 24 ++++++++++++++++++++++++ DEBIAN/rules | 18 ++++++++++++++++++ 8 files changed, 87 insertions(+) create mode 100644 DEBIAN/application-x-ncl-NCL.xml create mode 100644 DEBIAN/changelog create mode 100644 DEBIAN/compat create mode 100644 DEBIAN/control create mode 100644 DEBIAN/copyright create mode 100644 DEBIAN/ginga.desktop create mode 100644 DEBIAN/postinst create mode 100755 DEBIAN/rules diff --git a/DEBIAN/application-x-ncl-NCL.xml b/DEBIAN/application-x-ncl-NCL.xml new file mode 100644 index 000000000..1c86fe9a3 --- /dev/null +++ b/DEBIAN/application-x-ncl-NCL.xml @@ -0,0 +1,10 @@ + + + + Applicação NCL + NCL Application + + + + + diff --git a/DEBIAN/changelog b/DEBIAN/changelog new file mode 100644 index 000000000..f901210e7 --- /dev/null +++ b/DEBIAN/changelog @@ -0,0 +1,5 @@ +ginga-itv (0.13.6-1) unstable; urgency=medium + + * Initial release. + + -- Rafael Diniz Mon, 12 Jan 2015 19:41:17 -0300 diff --git a/DEBIAN/compat b/DEBIAN/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/DEBIAN/compat @@ -0,0 +1 @@ +9 diff --git a/DEBIAN/control b/DEBIAN/control new file mode 100644 index 000000000..a37cafeb3 --- /dev/null +++ b/DEBIAN/control @@ -0,0 +1,15 @@ +Package: ginga-itv +Source: ginga-itv +Section: misc +Priority: optional +Maintainer: Rafael Diniz +Standards-Version: 3.9.5 +Build-Depends: debhelper (>=9), pkg-config, dpkg-dev, dh-autoreconf, libltdl-dev, liblua5.2-dev, libglib2.0-dev, libpango1.0-dev, librsvg2-dev, libsoup2.4-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, libgstreamer-plugins-good1.0-dev, libgtk-3-dev, nclua (> 1.2) +Homepage: http://www.gingancl.org.br/ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: The Ginga middleware + Ginga® is the middleware of the Japanese-Brazilian Digital TV System (ISDB-TB) + and ITU-T Recommendation for IPTV services. Ginga is made up by a set of + standardized technologies and Brazilian innovations that make it the most + advanced middleware specification. diff --git a/DEBIAN/copyright b/DEBIAN/copyright new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/DEBIAN/copyright @@ -0,0 +1 @@ + diff --git a/DEBIAN/ginga.desktop b/DEBIAN/ginga.desktop new file mode 100644 index 000000000..406e5c2e8 --- /dev/null +++ b/DEBIAN/ginga.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Name=Ginga +Exec=/usr/bin/gingagui +Comment=Ginga Player +Icon=/usr/share/pixmaps/icon-gingagui.ico +StartupNotify=false +Encoding=UTF-8 +Categories=AudioVideo; +MimeType=application/x-ncl-NCL +Keywords=Player;Audio;Video; diff --git a/DEBIAN/postinst b/DEBIAN/postinst new file mode 100644 index 000000000..d0021fd49 --- /dev/null +++ b/DEBIAN/postinst @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + xdg-mime install application-x-ncl-NCL.xml + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/DEBIAN/rules b/DEBIAN/rules new file mode 100755 index 000000000..890b474d9 --- /dev/null +++ b/DEBIAN/rules @@ -0,0 +1,18 @@ +#!/usr/bin/make -f +include /usr/share/dpkg/pkg-info.mk + +export LDFLAGS=-Wl,--no-as-needed + +override_dh_auto_configure: + echo "${DEB_VERSION_UPSTREAM}" > .tarball-version + ./bootstrap + dh_auto_configure -- --disable-valgrind-tests + +override_dh_auto_test: + + +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + +%: + dh $@ From fe226f677d9c37b7fd47f9f26bae38c8d3da05ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 11:29:45 -0300 Subject: [PATCH 146/169] build: Removing debian directory --- debian/application-x-ncl-NCL.xml | 10 ---------- debian/changelog | 5 ----- debian/compat | 1 - debian/control | 16 ---------------- debian/copyright | 1 - debian/ginga.desktop | 13 ------------- debian/postinst.ex | 24 ------------------------ debian/rules | 18 ------------------ 8 files changed, 88 deletions(-) delete mode 100644 debian/application-x-ncl-NCL.xml delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/ginga.desktop delete mode 100644 debian/postinst.ex delete mode 100755 debian/rules diff --git a/debian/application-x-ncl-NCL.xml b/debian/application-x-ncl-NCL.xml deleted file mode 100644 index 1c86fe9a3..000000000 --- a/debian/application-x-ncl-NCL.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - Applicação NCL - NCL Application - - - - - diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index f901210e7..000000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -ginga-itv (0.13.6-1) unstable; urgency=medium - - * Initial release. - - -- Rafael Diniz Mon, 12 Jan 2015 19:41:17 -0300 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec635144f..000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control deleted file mode 100644 index 6d07ea2f8..000000000 --- a/debian/control +++ /dev/null @@ -1,16 +0,0 @@ -Source: ginga-itv -Section: misc -Priority: optional -Maintainer: Rafael Diniz -Standards-Version: 3.9.5 -Build-Depends: debhelper (>=9), pkg-config, dpkg-dev, dh-autoreconf, libltdl-dev, liblua5.2-dev, libglib2.0-dev, libpango1.0-dev, librsvg2-dev, libsoup2.4-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, libgstreamer-plugins-good1.0-dev, libgtk-3-dev, nclua (> 1.2) -Homepage: http://www.gingancl.org.br/ - -Package: ginga-itv -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: The Ginga middleware - Ginga® is the middleware of the Japanese-Brazilian Digital TV System (ISDB-TB) - and ITU-T Recommendation for IPTV services. Ginga is made up by a set of - standardized technologies and Brazilian innovations that make it the most - advanced middleware specification. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 8b1378917..000000000 --- a/debian/copyright +++ /dev/null @@ -1 +0,0 @@ - diff --git a/debian/ginga.desktop b/debian/ginga.desktop deleted file mode 100644 index 406e5c2e8..000000000 --- a/debian/ginga.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Terminal=false -Name=Ginga -Exec=/usr/bin/gingagui -Comment=Ginga Player -Icon=/usr/share/pixmaps/icon-gingagui.ico -StartupNotify=false -Encoding=UTF-8 -Categories=AudioVideo; -MimeType=application/x-ncl-NCL -Keywords=Player;Audio;Video; diff --git a/debian/postinst.ex b/debian/postinst.ex deleted file mode 100644 index d0021fd49..000000000 --- a/debian/postinst.ex +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - configure) - xdg-mime install application-x-ncl-NCL.xml - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 890b474d9..000000000 --- a/debian/rules +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/make -f -include /usr/share/dpkg/pkg-info.mk - -export LDFLAGS=-Wl,--no-as-needed - -override_dh_auto_configure: - echo "${DEB_VERSION_UPSTREAM}" > .tarball-version - ./bootstrap - dh_auto_configure -- --disable-valgrind-tests - -override_dh_auto_test: - - -override_dh_shlibdeps: - dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info - -%: - dh $@ From e3c17eaeaec65d2fe926b59c42d5181d075849bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 14:27:23 -0300 Subject: [PATCH 147/169] build: setting permissions * application-x-ncl-NCL.xml * ginga.desktop * postinst --- DEBIAN/application-x-ncl-NCL.xml | 0 DEBIAN/ginga.desktop | 0 DEBIAN/postinst | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 DEBIAN/application-x-ncl-NCL.xml mode change 100644 => 100755 DEBIAN/ginga.desktop mode change 100644 => 100755 DEBIAN/postinst diff --git a/DEBIAN/application-x-ncl-NCL.xml b/DEBIAN/application-x-ncl-NCL.xml old mode 100644 new mode 100755 diff --git a/DEBIAN/ginga.desktop b/DEBIAN/ginga.desktop old mode 100644 new mode 100755 diff --git a/DEBIAN/postinst b/DEBIAN/postinst old mode 100644 new mode 100755 From 4e94cc5344f4c8b3e986e29e1179bc387481b085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 16:11:23 -0300 Subject: [PATCH 148/169] build: adding version * DEBIAN/control --- DEBIAN/control | 1 + 1 file changed, 1 insertion(+) diff --git a/DEBIAN/control b/DEBIAN/control index a37cafeb3..4997c00b1 100644 --- a/DEBIAN/control +++ b/DEBIAN/control @@ -3,6 +3,7 @@ Source: ginga-itv Section: misc Priority: optional Maintainer: Rafael Diniz +Version: 1.0 Standards-Version: 3.9.5 Build-Depends: debhelper (>=9), pkg-config, dpkg-dev, dh-autoreconf, libltdl-dev, liblua5.2-dev, libglib2.0-dev, libpango1.0-dev, librsvg2-dev, libsoup2.4-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, libgstreamer-plugins-good1.0-dev, libgtk-3-dev, nclua (> 1.2) Homepage: http://www.gingancl.org.br/ From c268884d5a5c487413f285d3d7d6c17395fba2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 16:51:31 -0300 Subject: [PATCH 149/169] build: fixed path of icon * DEBIAN/ginga.desktop --- DEBIAN/ginga.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEBIAN/ginga.desktop b/DEBIAN/ginga.desktop index 406e5c2e8..924576e7b 100755 --- a/DEBIAN/ginga.desktop +++ b/DEBIAN/ginga.desktop @@ -5,7 +5,7 @@ Terminal=false Name=Ginga Exec=/usr/bin/gingagui Comment=Ginga Player -Icon=/usr/share/pixmaps/icon-gingagui.ico +Icon=/usr/share/ginga/icons/common/icon-gingagui.ico StartupNotify=false Encoding=UTF-8 Categories=AudioVideo; From c33be30685484c329e55611ed2cb2aeec1fdbb19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 18:27:12 -0300 Subject: [PATCH 150/169] build: adding on script command to copy ginga.desktop to /usr/share/applications/ * postinst --- DEBIAN/postinst | 1 + 1 file changed, 1 insertion(+) diff --git a/DEBIAN/postinst b/DEBIAN/postinst index d0021fd49..a56ce8cab 100755 --- a/DEBIAN/postinst +++ b/DEBIAN/postinst @@ -5,6 +5,7 @@ set -e case "$1" in configure) xdg-mime install application-x-ncl-NCL.xml + cp ginga.desktop /usr/share/applications/ ;; abort-upgrade|abort-remove|abort-deconfigure) From cd6495486a932c8d4339c4cb12bc7e087ddd15bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 18:58:46 -0300 Subject: [PATCH 151/169] build: rename DEBIAN dir --- {DEBIAN => debian}/application-x-ncl-NCL.xml | 0 {DEBIAN => debian}/changelog | 0 {DEBIAN => debian}/compat | 0 {DEBIAN => debian}/control | 0 {DEBIAN => debian}/copyright | 0 {DEBIAN => debian}/ginga.desktop | 0 {DEBIAN => debian}/postinst | 0 {DEBIAN => debian}/rules | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {DEBIAN => debian}/application-x-ncl-NCL.xml (100%) rename {DEBIAN => debian}/changelog (100%) rename {DEBIAN => debian}/compat (100%) rename {DEBIAN => debian}/control (100%) rename {DEBIAN => debian}/copyright (100%) rename {DEBIAN => debian}/ginga.desktop (100%) rename {DEBIAN => debian}/postinst (100%) rename {DEBIAN => debian}/rules (100%) diff --git a/DEBIAN/application-x-ncl-NCL.xml b/debian/application-x-ncl-NCL.xml similarity index 100% rename from DEBIAN/application-x-ncl-NCL.xml rename to debian/application-x-ncl-NCL.xml diff --git a/DEBIAN/changelog b/debian/changelog similarity index 100% rename from DEBIAN/changelog rename to debian/changelog diff --git a/DEBIAN/compat b/debian/compat similarity index 100% rename from DEBIAN/compat rename to debian/compat diff --git a/DEBIAN/control b/debian/control similarity index 100% rename from DEBIAN/control rename to debian/control diff --git a/DEBIAN/copyright b/debian/copyright similarity index 100% rename from DEBIAN/copyright rename to debian/copyright diff --git a/DEBIAN/ginga.desktop b/debian/ginga.desktop similarity index 100% rename from DEBIAN/ginga.desktop rename to debian/ginga.desktop diff --git a/DEBIAN/postinst b/debian/postinst similarity index 100% rename from DEBIAN/postinst rename to debian/postinst diff --git a/DEBIAN/rules b/debian/rules similarity index 100% rename from DEBIAN/rules rename to debian/rules From 0b3cd5976618c0fdbf30d7c4cbdacded9644d8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 19:33:08 -0300 Subject: [PATCH 152/169] build: adding ginga.desktop on makefile --- debian/ginga.desktop | 13 ------------- debian/postinst | 1 - src-gui/icons/Makefile.am | 5 +++++ 3 files changed, 5 insertions(+), 14 deletions(-) delete mode 100755 debian/ginga.desktop diff --git a/debian/ginga.desktop b/debian/ginga.desktop deleted file mode 100755 index 924576e7b..000000000 --- a/debian/ginga.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Terminal=false -Name=Ginga -Exec=/usr/bin/gingagui -Comment=Ginga Player -Icon=/usr/share/ginga/icons/common/icon-gingagui.ico -StartupNotify=false -Encoding=UTF-8 -Categories=AudioVideo; -MimeType=application/x-ncl-NCL -Keywords=Player;Audio;Video; diff --git a/debian/postinst b/debian/postinst index a56ce8cab..d0021fd49 100755 --- a/debian/postinst +++ b/debian/postinst @@ -5,7 +5,6 @@ set -e case "$1" in configure) xdg-mime install application-x-ncl-NCL.xml - cp ginga.desktop /usr/share/applications/ ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/src-gui/icons/Makefile.am b/src-gui/icons/Makefile.am index 4a38550cd..1ffb399e8 100644 --- a/src-gui/icons/Makefile.am +++ b/src-gui/icons/Makefile.am @@ -19,10 +19,15 @@ include $(top_srcdir)/build-aux/Makefile.am.common iconsdir= $(gingadatadir)/icons +applicationsdir= $(datadir)/applications commondir= $(iconsdir)/common lightdir= $(iconsdir)/light-theme darkdir= $(iconsdir)/dark-theme +applications_DATA=\ + ginga.desktop\ + $(NULL) + icons_DATA=\ $(NULL) From 66b626e43b150dd7de519506f9e630d129ab5984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Mon, 21 May 2018 19:40:15 -0300 Subject: [PATCH 153/169] build: adding ginga.desktop on src-gui makefile * src-gui/Makefile.am * src-gui/ginga.desktop --- src-gui/Makefile.am | 6 ++++++ src-gui/ginga.desktop | 13 +++++++++++++ src-gui/icons/Makefile.am | 5 ----- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100755 src-gui/ginga.desktop diff --git a/src-gui/Makefile.am b/src-gui/Makefile.am index 4762b6a55..bce2fed53 100644 --- a/src-gui/Makefile.am +++ b/src-gui/Makefile.am @@ -18,6 +18,8 @@ include $(top_srcdir)/build-aux/Makefile.am.common +applicationsdir= $(datadir)/applications + SUBDIRS= icons style AM_CPPFLAGS= -I$(top_srcdir)/lib -I$(top_builddir)/lib\ @@ -33,6 +35,10 @@ endif AM_CXXFLAGS= $(CAIRO_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(LIBXML_CFLAGS) $(SOUP_CFLAGS) $(OSX_CFLAGS) AM_LDFLAGS= $(CAIRO_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(LIBXML_LIBS) $(SOUP_LIBS) $(FRAMEWORK_COCOA) +applications_DATA=\ + ginga.desktop\ + $(NULL) + bin_PROGRAMS= gingagui gingagui_CXXFLAGS= $(AM_CXXFLAGS) gingagui_LDADD= $(top_builddir)/lib/libginga.la diff --git a/src-gui/ginga.desktop b/src-gui/ginga.desktop new file mode 100755 index 000000000..924576e7b --- /dev/null +++ b/src-gui/ginga.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Name=Ginga +Exec=/usr/bin/gingagui +Comment=Ginga Player +Icon=/usr/share/ginga/icons/common/icon-gingagui.ico +StartupNotify=false +Encoding=UTF-8 +Categories=AudioVideo; +MimeType=application/x-ncl-NCL +Keywords=Player;Audio;Video; diff --git a/src-gui/icons/Makefile.am b/src-gui/icons/Makefile.am index 1ffb399e8..4a38550cd 100644 --- a/src-gui/icons/Makefile.am +++ b/src-gui/icons/Makefile.am @@ -19,15 +19,10 @@ include $(top_srcdir)/build-aux/Makefile.am.common iconsdir= $(gingadatadir)/icons -applicationsdir= $(datadir)/applications commondir= $(iconsdir)/common lightdir= $(iconsdir)/light-theme darkdir= $(iconsdir)/dark-theme -applications_DATA=\ - ginga.desktop\ - $(NULL) - icons_DATA=\ $(NULL) From 0b9cfb81101dcb7c056b55d00830e76e8fc66ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Tue, 22 May 2018 11:09:14 -0300 Subject: [PATCH 154/169] build: downgrade control * debian/control --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 4997c00b1..6d07ea2f8 100644 --- a/debian/control +++ b/debian/control @@ -1,12 +1,12 @@ -Package: ginga-itv Source: ginga-itv Section: misc Priority: optional Maintainer: Rafael Diniz -Version: 1.0 Standards-Version: 3.9.5 Build-Depends: debhelper (>=9), pkg-config, dpkg-dev, dh-autoreconf, libltdl-dev, liblua5.2-dev, libglib2.0-dev, libpango1.0-dev, librsvg2-dev, libsoup2.4-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, libgstreamer-plugins-good1.0-dev, libgtk-3-dev, nclua (> 1.2) Homepage: http://www.gingancl.org.br/ + +Package: ginga-itv Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: The Ginga middleware From c0b6c43c872cbbf72f75a5a7c42fa69afc94ea81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Tue, 22 May 2018 15:38:43 -0300 Subject: [PATCH 155/169] build: Adding mime in ../share/mime/application and installing using this address * debian/postinst * src-gui/Makefile.am * renamed: debian/application-x-ncl-NCL.xml -> src-gui/application-x-ncl-NCL.xml --- debian/postinst | 2 +- src-gui/Makefile.am | 5 +++++ {debian => src-gui}/application-x-ncl-NCL.xml | 0 3 files changed, 6 insertions(+), 1 deletion(-) rename {debian => src-gui}/application-x-ncl-NCL.xml (100%) diff --git a/debian/postinst b/debian/postinst index d0021fd49..5818acb9d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,7 +4,7 @@ set -e case "$1" in configure) - xdg-mime install application-x-ncl-NCL.xml + xdg-mime install /usr/share/mime/application/application-x-ncl-NCL.xml ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/src-gui/Makefile.am b/src-gui/Makefile.am index bce2fed53..325ea91ff 100644 --- a/src-gui/Makefile.am +++ b/src-gui/Makefile.am @@ -19,6 +19,7 @@ include $(top_srcdir)/build-aux/Makefile.am.common applicationsdir= $(datadir)/applications +mimesdir= $(datadir)/mime/application SUBDIRS= icons style @@ -39,6 +40,10 @@ applications_DATA=\ ginga.desktop\ $(NULL) +mimes_DATA=\ + application-x-ncl-NCL.xml\ + $(NULL) + bin_PROGRAMS= gingagui gingagui_CXXFLAGS= $(AM_CXXFLAGS) gingagui_LDADD= $(top_builddir)/lib/libginga.la diff --git a/debian/application-x-ncl-NCL.xml b/src-gui/application-x-ncl-NCL.xml similarity index 100% rename from debian/application-x-ncl-NCL.xml rename to src-gui/application-x-ncl-NCL.xml From 05bf38d9880e0ca2dd10a4ada947d91a3e391e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Tue, 22 May 2018 17:03:20 -0300 Subject: [PATCH 156/169] build: adding ico in ../share/pixmaps * src-gui/ginga.desktop * src-gui/icons/Makefile.am --- src-gui/ginga.desktop | 2 +- src-gui/icons/Makefile.am | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src-gui/ginga.desktop b/src-gui/ginga.desktop index 924576e7b..406e5c2e8 100755 --- a/src-gui/ginga.desktop +++ b/src-gui/ginga.desktop @@ -5,7 +5,7 @@ Terminal=false Name=Ginga Exec=/usr/bin/gingagui Comment=Ginga Player -Icon=/usr/share/ginga/icons/common/icon-gingagui.ico +Icon=/usr/share/pixmaps/icon-gingagui.ico StartupNotify=false Encoding=UTF-8 Categories=AudioVideo; diff --git a/src-gui/icons/Makefile.am b/src-gui/icons/Makefile.am index 4a38550cd..9d3c14289 100644 --- a/src-gui/icons/Makefile.am +++ b/src-gui/icons/Makefile.am @@ -18,18 +18,18 @@ include $(top_srcdir)/build-aux/Makefile.am.common -iconsdir= $(gingadatadir)/icons +iconsdir= $(datadir)/pixmaps commondir= $(iconsdir)/common lightdir= $(iconsdir)/light-theme darkdir= $(iconsdir)/dark-theme icons_DATA=\ - $(NULL) + common/icon-gingagui.ico\ + $(NULL) common_DATA=\ common/blue-icon.png\ common/ginga_icon.png\ - common/icon-gingagui.ico\ common/green-icon.png\ common/red-icon.png\ common/yellow-icon.png\ From 05b7598c111d1c114230a0aac98b19938b29f7dc Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 22 May 2018 17:25:45 -0300 Subject: [PATCH 157/169] build: Fix configure.ac result for opengl --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 272732ef7..191e9dc29 100644 --- a/configure.ac +++ b/configure.ac @@ -285,8 +285,7 @@ AU_CHECK_OPTIONAL_PKG([nclua], [build with NCLua support], [], AU_CHECK_OPTIONAL_PKG([opengl], [build with OpenGL support], [], [OPENGL], - [gl >= opengl_required_version - sdl2]) + [gl >= opengl_required_version and sdl2]) # Aliases for compiler flags. AS_VAR_APPEND([GINGA_ALL_CXXFLAGS], [" $WARN_CFLAGS $WERROR_CFLAGS "]) From 09c97eb91cc7de822aa9cacbeea32e09907c70b1 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 22 May 2018 19:44:25 -0300 Subject: [PATCH 158/169] lib: Emit error if an timer media have an src property --- lib/Player.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Player.cpp b/lib/Player.cpp index 8160f7f1d..9eac9b845 100644 --- a/lib/Player.cpp +++ b/lib/Player.cpp @@ -593,6 +593,8 @@ Player::createPlayer (Formatter *formatter, Media *media, const string &uri, { WARNING ("unknown mime '%s': creating an empty player", mime.c_str ()); + if (!media->getProperty("uri").empty ()) + ERROR ("media from \"application/x-ginga-timer\" type should not have src"); } } From 90120f91010ee80d01cf654c56ecc0cf317e94b6 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 22 May 2018 19:45:15 -0300 Subject: [PATCH 159/169] lib: Emit error if cannot create gstreamer player for media --- lib/PlayerVideo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PlayerVideo.cpp b/lib/PlayerVideo.cpp index 5fd6862f7..98e053382 100644 --- a/lib/PlayerVideo.cpp +++ b/lib/PlayerVideo.cpp @@ -73,7 +73,7 @@ PlayerVideo::PlayerVideo (Formatter *formatter, Media *media) _playbin = gst_element_factory_make ("playbin", "playbin"); g_assert_nonnull (_playbin); - + //g_object_set (G_OBJECT (_playbin), "connection-speed", 56, nullptr); bus = gst_pipeline_get_bus (GST_PIPELINE (_playbin)); @@ -158,7 +158,7 @@ PlayerVideo::PlayerVideo (Formatter *formatter, Media *media) _callbacks.new_sample = cb_NewSample; gst_app_sink_set_callbacks (GST_APP_SINK (_video.sink), &_callbacks, this, nullptr); - + g_signal_connect (G_OBJECT (_playbin), "about-to-finish", (GCallback) cb_EOS, this); @@ -593,7 +593,7 @@ PlayerVideo::getPipelineState () if (unlikely (ret == GST_STATE_CHANGE_FAILURE)) { - return nullptr; + ERROR("cannot create PlayerVideo for %s", Player::_prop.uri.c_str ()); } return gst_element_state_get_name (curr); } @@ -622,7 +622,7 @@ PlayerVideo::cb_Bus (GstBus *bus, GstMessage *msg, PlayerVideo *player) { gst_message_parse_error (msg, &error, nullptr); g_assert_nonnull (error); - + string advice = ""; switch (error->code) { From 4a0b580057ebe6983af4bbcb3ac706c6c3d54dec Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 22 May 2018 20:11:02 -0300 Subject: [PATCH 160/169] tests: Use .lua and .html src samples only when supported --- tests/tests.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/tests.h b/tests/tests.h index d760d2453..a0fb966b1 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -42,12 +42,18 @@ vector samples = { { "application/x-ginga-timer", "" }, { "audio/mp3", ABS_TOP_SRCDIR "/tests-ncl/samples/arcade.mp3" }, { "image/png", ABS_TOP_SRCDIR "/tests-ncl/samples/gnu.png" }, +#if defined WITH_NCLUA && WITH_NCLUA { "application/x-ginga-NCLua", ABS_TOP_SRCDIR "/tests-ncl/samples/fps.lua" }, +#endif +#if defined WITH_LIBRSVG && WITH_LIBRSVG { "image/svg+xml", ABS_TOP_SRCDIR "/tests-ncl/samples/vector.svg" }, +#endif { "text/plain", ABS_TOP_SRCDIR "/tests-ncl/samples/text.txt" }, { "video/ogg", ABS_TOP_SRCDIR "/tests-ncl/samples/clock.ogv" }, +#if defined WITH_CEF && WITH_CEF { "text/html", ABS_TOP_SRCDIR "/tests-ncl/samples/page.html" }, +#endif }; static G_GNUC_UNUSED string From 420cf6832e5aad7fa4f186be74a95dc8c9b9f406 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 22 May 2018 20:33:34 -0300 Subject: [PATCH 161/169] tests: Remove wait 0s reaction for Context naturalend --- tests/test-Context-naturalend.cpp | 6 ------ tests/test-Context-nested-naturalend.cpp | 8 -------- tests/test-Media-explicitDur.cpp | 7 +------ tests/test-Media-nested-explicitDur.cpp | 12 ------------ 4 files changed, 1 insertion(+), 32 deletions(-) diff --git a/tests/test-Context-naturalend.cpp b/tests/test-Context-naturalend.cpp index f3e5650c6..4d4496797 100644 --- a/tests/test-Context-naturalend.cpp +++ b/tests/test-Context-naturalend.cpp @@ -79,12 +79,6 @@ main (void) g_assert (ctx1_lambda->getState () == Event::OCCURRING); g_assert (m1_lambda->getState () == Event::SLEEPING); - // In the next reaction, ctx1 is SLEEPING. - fmt->sendTick (0, 0, 0); - g_assert (root_lambda->getState () == Event::OCCURRING); - g_assert (ctx1_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - // In the next reaction, root is SLEEPING. fmt->sendTick (0, 0, 0); g_assert (root_lambda->getState () == Event::SLEEPING); diff --git a/tests/test-Context-nested-naturalend.cpp b/tests/test-Context-nested-naturalend.cpp index 565ba21a3..c6e9c45c6 100644 --- a/tests/test-Context-nested-naturalend.cpp +++ b/tests/test-Context-nested-naturalend.cpp @@ -129,14 +129,6 @@ main (void) g_assert (ctx2_lambda->getState () == Event::SLEEPING); g_assert (m2_lambda->getState () == Event::SLEEPING); - // In the next reaction, ctx1 is SLEEPING. - fmt->sendTick (0, 0, 0); - g_assert (root_lambda->getState () == Event::OCCURRING); - g_assert (ctx1_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - g_assert (ctx2_lambda->getState () == Event::SLEEPING); - g_assert (m2_lambda->getState () == Event::SLEEPING); - // In next the reaction, root_lambda is SLEEPING. fmt->sendTick (0, 0, 0); g_assert (root_lambda->getState () == Event::SLEEPING); diff --git a/tests/test-Media-explicitDur.cpp b/tests/test-Media-explicitDur.cpp index eaf8fb916..e751c4ec7 100644 --- a/tests/test-Media-explicitDur.cpp +++ b/tests/test-Media-explicitDur.cpp @@ -58,13 +58,8 @@ main (void) // -------------------------------- // main check - // after 3 second, m1 is SLEEPING + // after 3 seconds, m1 is SLEEPING fmt->sendTick (4 * GINGA_SECOND, 4 * GINGA_SECOND, 0); - g_assert (root_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - - // in next reaction, root is SLEEPING - fmt->sendTick (0, 0, 0); g_assert (root_lambda->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); diff --git a/tests/test-Media-nested-explicitDur.cpp b/tests/test-Media-nested-explicitDur.cpp index a3300e5e7..cf62efa30 100644 --- a/tests/test-Media-nested-explicitDur.cpp +++ b/tests/test-Media-nested-explicitDur.cpp @@ -75,18 +75,6 @@ main (void) // after 4 second, m1 is SLEEPING fmt->sendTick (4 * GINGA_SECOND, 4 * GINGA_SECOND, 0); - g_assert (root_lambda->getState () == Event::OCCURRING); - g_assert (ctx1_lambda->getState () == Event::OCCURRING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - - // in next reaction, ctx1 is SLEEPING - fmt->sendTick (0, 0, 0); - g_assert (root_lambda->getState () == Event::OCCURRING); - g_assert (ctx1_lambda->getState () == Event::SLEEPING); - g_assert (m1_lambda->getState () == Event::SLEEPING); - - // in next reaction, root is SLEEPING - fmt->sendTick (0, 0, 0); g_assert (root_lambda->getState () == Event::SLEEPING); g_assert (ctx1_lambda->getState () == Event::SLEEPING); g_assert (m1_lambda->getState () == Event::SLEEPING); From 15d979fdd8ad06fc08d6af506a064faba415a766 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 22 May 2018 20:51:28 -0300 Subject: [PATCH 162/169] cmake: set GINGABINDIR --- build-cmake/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt index 8d1efd663..5492d0f15 100644 --- a/build-cmake/CMakeLists.txt +++ b/build-cmake/CMakeLists.txt @@ -17,6 +17,7 @@ set (PACKAGE "ginga") set (GINGA_BINARY_DIR ${CMAKE_BINARY_DIR}/bin) set (GINGA_BINARY_TESTS_DIR ${CMAKE_BINARY_DIR}/tests) add_definitions (-DGINGADATADIR="${CMAKE_INSTALL_FULL_DATADIR}/${PACKAGE}") +add_definitions (-DGINGABINDIR="${CMAKE_INSTALL_FULL_BINDIR}") # Find dependencies find_package (GLIB 2.32 REQUIRED COMPONENTS gobject gio gthread gmodule) From 9ce48e0eb8094ac7f4cb6b49eddf7bd186902058 Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 22 May 2018 20:52:53 -0300 Subject: [PATCH 163/169] ci: Remove gnome3-staging ppa from docker --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 20f895b77..f6e5da356 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,6 @@ RUN apt-get update -y -qq RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test RUN apt-add-repository -y ppa:george-edison55/cmake-3.x RUN add-apt-repository -y ppa:gnome3-team/gnome3 -RUN add-apt-repository -y ppa:gnome3-team/gnome3-staging RUN apt-get update -y -qq RUN apt-get install -y git gcc g++ autotools-dev dh-autoreconf \ From 51277a185a6b29964ee879e982a8dcf4603fa04e Mon Sep 17 00:00:00 2001 From: Alan Livio Date: Tue, 22 May 2018 22:39:25 -0300 Subject: [PATCH 164/169] macos: Improve macos Info.plist --- extra/macos/Info.plist | 24 ++++++++++++++++++++++++ extra/macos/pkg_pos_install.sh | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/extra/macos/Info.plist b/extra/macos/Info.plist index f7efcbe22..427ffada6 100644 --- a/extra/macos/Info.plist +++ b/extra/macos/Info.plist @@ -14,5 +14,29 @@ APPL CFBundleIconFile Icon.icns + UTExportedTypeDeclarations + + + UTTypeIdentifier + com.telemidia.ginga.ncl + UTTypeTagSpecification + + public.filename-extension + + ncl + + + UTTypeConformsTo + + public.data + + UTTypeDescription + NCL file + UTTypeIconFile + Icon.icns + UTTypeReferenceURL + http://www.ncl.org.br/ + + \ No newline at end of file diff --git a/extra/macos/pkg_pos_install.sh b/extra/macos/pkg_pos_install.sh index ae2588838..2dc066572 100644 --- a/extra/macos/pkg_pos_install.sh +++ b/extra/macos/pkg_pos_install.sh @@ -16,4 +16,5 @@ # You should have received a copy of the GNU General Public License # along with Ginga. If not, see . -cp -r /Applications/Ginga.app/Contents/Frameworks/usr/local* /usr/ \ No newline at end of file +cp -r /Applications/Ginga.app/Contents/Frameworks/usr/local* /usr/ +/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister /Applications/Ginga.app \ No newline at end of file From 7a44c6426c5b4ee2a240318e8f5fb165d81d606f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Wed, 23 May 2018 10:04:38 -0300 Subject: [PATCH 165/169] build: fixed icons dir path * src-gui/ginga.desktop * src-gui/icons/Makefile.am * src-gui/icons/common/icon-gingagui.ico --- src-gui/ginga.desktop | 2 +- src-gui/icons/Makefile.am | 8 ++++---- src-gui/icons/common/icon-gingagui.ico | Bin 353118 -> 0 bytes 3 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 src-gui/icons/common/icon-gingagui.ico diff --git a/src-gui/ginga.desktop b/src-gui/ginga.desktop index 406e5c2e8..0ebdd570a 100755 --- a/src-gui/ginga.desktop +++ b/src-gui/ginga.desktop @@ -5,7 +5,7 @@ Terminal=false Name=Ginga Exec=/usr/bin/gingagui Comment=Ginga Player -Icon=/usr/share/pixmaps/icon-gingagui.ico +Icon=/usr/share/pixmaps/ginga.ico StartupNotify=false Encoding=UTF-8 Categories=AudioVideo; diff --git a/src-gui/icons/Makefile.am b/src-gui/icons/Makefile.am index 9d3c14289..5c4cc7073 100644 --- a/src-gui/icons/Makefile.am +++ b/src-gui/icons/Makefile.am @@ -19,12 +19,12 @@ include $(top_srcdir)/build-aux/Makefile.am.common iconsdir= $(datadir)/pixmaps -commondir= $(iconsdir)/common -lightdir= $(iconsdir)/light-theme -darkdir= $(iconsdir)/dark-theme +commondir= $(gingadatadir)/icons/common +lightdir= $(gingadatadir)/icons/light-theme +darkdir= $(gingadatadir)/icons/dark-theme icons_DATA=\ - common/icon-gingagui.ico\ + common/ginga.ico\ $(NULL) common_DATA=\ diff --git a/src-gui/icons/common/icon-gingagui.ico b/src-gui/icons/common/icon-gingagui.ico deleted file mode 100644 index 1f398cb39d6f93108deee8f49954895ab08e6751..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353118 zcmeFa2b@$@(*ED?@4vpTtbq)YhnzElA_mNHO>4rO^RDS#!*Gwc1JaDr_OCN}jpO0lD#`kz&*540& zdD(8aeDbX#?f74=NZ_IGe%gHh(M$I3bnlFNwN~$I&3@Jzu63NVwsmfvV71h0-!$H8 zs%<^Eux&YboW-qr%OI)`=m&a&zMwa58&Y;*jr8jWafjvN3;#UmG}u^z>FjT^@q?YC+PVL!B+CtBi`NtPHo)e^T)Q=4vy z;WOe^Eo7jz9;P)PrnMhB#S*tpwgmbh-T2Lod*@l=xpyrw z;cH9G{mBwb*2FEALGe1UXtgC~|7eLfzp%v9(i`*#A0gXNLk<1HCb&I_@&oDRf0a{u zMLC51;iZ+0k*avV^XGorO0n0C&2FFa2{9SCN9K6`V2s!;TvpGx^^C=wH|V&xP|oYbkl%+i2*d zAEUk=*>35We`t{~FFwCeT+P?4I6N=V8pkb`L3wnbINfsH<2vrkWUO%0gmjDmM}@1p z9q4lZ%sc-y@6%TKj?;}X{t;h(zoq!nVEOy+ke73Oa36d^BJ^~$uq@q01uv(bT)^en26uA}pnFF
0eYo-44wC*%B{)6!w_WYw}mKU!FH3QK^7*0WVr$6;-V}I#6z@@47q?b(Wgp@e%b+rKpg3KO>Z{v?Im#D4_g>I% zxGgnC=)LR!dj%h=p5;$>uKa$hs%{1TZ{fe1%jUg+?ITA@Y=k^EQ{E);$YM*(Qhe_+ zi^?&RtSfV^<9o%nr6e85q@Pj!b)81PA6#TxNZ-+W^dB5hJD~lp2XFc0-&MB0_~2KT z@1eM7DK^i2e&G5eRCgEh`6-Scm0Kpcmb4D>-(s9@N*&0guTg!*4$N0=%In%Yl-{HN zDJ~H93B(0HKJ4|kcdkl20KVVn;n`PfFZ3Ia^OHVbHJ8*=Wa9dnn6{XK564DwM2GU>DHy4!;>pIT!5c;E-^6JGo14?q8J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D zaAgN{?KQx6RbLRB6U9M0!&g@lufaLA;kT1l(T|xC__NSuYKOY-*>f(3gI-wHEC`$d zxTnb}anP6YTIkykA7MIq;=jxWPBbxppMITh#d(~ONO5e$8m|5^i_=3F)(HPbH~JK~ z&ZBL>lox;nkCLoxC&_cxkZgYe`BhYq-=Te^__|08EZauGJDdc~!j{Np(NM5cX#eo`8j+{LK8jDp~1b-dsZSV*(;A+`> zYlv^?B_7ux%Sj}~wivpd^`D@H9Rr=WLYDeBTNMdQAR0!E9xEQw6ta=+eg2`xUA^@IhOGG&tlCZh!ln|j>Cp@$_UHI_2NBCgM?Ma_-c|Z4(u*rt; zM}6OV=6|AZeDP!2?h~1lPOsW6N@_Q9;v)xDDaKDqK?d)J6$xJC_jR-Nj-OgsckOJ-j3{bR-K{pNl!bbgvOup2`^=E7{6v=(v8OXPIH`DR fX;r;%-9b@s%WRAr{(~>gL#%&gC~t%x?pE%1HB3Z3 From d802387cd58181a783238873ae76de422cdcc994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Wed, 23 May 2018 10:06:50 -0300 Subject: [PATCH 166/169] build: rename ginga icon * common/ginga.ico --- src-gui/icons/common/ginga.ico | Bin 0 -> 353118 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src-gui/icons/common/ginga.ico diff --git a/src-gui/icons/common/ginga.ico b/src-gui/icons/common/ginga.ico new file mode 100644 index 0000000000000000000000000000000000000000..1f398cb39d6f93108deee8f49954895ab08e6751 GIT binary patch literal 353118 zcmeFa2b@$@(*ED?@4vpTtbq)YhnzElA_mNHO>4rO^RDS#!*Gwc1JaDr_OCN}jpO0lD#`kz&*540& zdD(8aeDbX#?f74=NZ_IGe%gHh(M$I3bnlFNwN~$I&3@Jzu63NVwsmfvV71h0-!$H8 zs%<^Eux&YboW-qr%OI)`=m&a&zMwa58&Y;*jr8jWafjvN3;#UmG}u^z>FjT^@q?YC+PVL!B+CtBi`NtPHo)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NBCgM?Ma_-c|Z4(u*rt; zM}6OV=6|AZeDP!2?h~1lPOsW6N@_Q9;v)xDDaKDqK?d)J6$xJC_jR-Nj-OgsckOJ-j3{bR-K{pNl!bbgvOup2`^=E7{6v=(v8OXPIH`DR fX;r;%-9b@s%WRAr{(~>gL#%&gC~t%x?pE%1HB3Z3 literal 0 HcmV?d00001 From cc80e09e1cd1968d21249ede36928ce9988f0ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Wed, 23 May 2018 11:06:05 -0300 Subject: [PATCH 167/169] build: fixed gingagui icons path * src-gui/icons/Makefile.am --- src-gui/icons/Makefile.am | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src-gui/icons/Makefile.am b/src-gui/icons/Makefile.am index 5c4cc7073..b9ee1c293 100644 --- a/src-gui/icons/Makefile.am +++ b/src-gui/icons/Makefile.am @@ -18,14 +18,18 @@ include $(top_srcdir)/build-aux/Makefile.am.common -iconsdir= $(datadir)/pixmaps -commondir= $(gingadatadir)/icons/common -lightdir= $(gingadatadir)/icons/light-theme -darkdir= $(gingadatadir)/icons/dark-theme +pixmapsdir= $(datadir)/pixmaps +iconsdir= $(gingadatadir)/icons +commondir= $(iconsdir)/common +lightdir= $(iconsdir)/light-theme +darkdir= $(iconsdir)/dark-theme +pixmaps_DATA=\ + common/ginga.ico\ + $(NULL) + icons_DATA=\ - common/ginga.ico\ - $(NULL) + $(NULL) common_DATA=\ common/blue-icon.png\ From 5a6a7663a10596dda522ff4e31ac75116391fcff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Wed, 23 May 2018 12:19:34 -0300 Subject: [PATCH 168/169] build: adding license in debian package * debian/copyright: Likewise --- debian/copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/copyright b/debian/copyright index 8b1378917..03ac4606a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1 +1 @@ - +License: GPL-2+ From bfdf2ab3170e623a5cd3ca78ba75d14095a07557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Brand=C3=A3o?= Date: Wed, 23 May 2018 16:22:26 -0300 Subject: [PATCH 169/169] build: adding mime in ginga dir * debian/postinst * src-gui/Makefile.am --- debian/postinst | 2 +- src-gui/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index 5818acb9d..ed653933c 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,7 +4,7 @@ set -e case "$1" in configure) - xdg-mime install /usr/share/mime/application/application-x-ncl-NCL.xml + xdg-mime install /usr/share/ginga/mime/application-x-ncl-NCL.xml ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/src-gui/Makefile.am b/src-gui/Makefile.am index 325ea91ff..a11400965 100644 --- a/src-gui/Makefile.am +++ b/src-gui/Makefile.am @@ -19,7 +19,7 @@ include $(top_srcdir)/build-aux/Makefile.am.common applicationsdir= $(datadir)/applications -mimesdir= $(datadir)/mime/application +mimesdir= $(gingadatadir)/mime SUBDIRS= icons style