From 1cadae2d75a35b52abe617e57745c6d8cbcd2fdc Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 3 Sep 2007 02:33:47 +0200 Subject: [PATCH] TDBS (test driven brain storming) :-) --- tests/50components.tests | 2 +- tests/51asset.tests | 14 ++++ tests/52engine.tests | 6 ++ tests/53session.tests | 14 ++++ tests/54builder.tests | 6 ++ tests/55controller.tests | 6 ++ tests/58proc-operate.tests | 6 ++ .../components/proc/asset/createassettest.cpp | 63 ++++++++++++++++ .../components/proc/asset/deleteassettest.cpp | 67 +++++++++++++++++ .../proc/asset/dependantassetstest.cpp | 65 +++++++++++++++++ tests/components/proc/asset/testclipasset.hpp | 58 +++++++++++++++ .../components/proc/engine/sourcenodetest.cpp | 62 ++++++++++++++++ .../proc/mobject/builder/buildsegmenttest.cpp | 67 +++++++++++++++++ .../mobject/controller/rendersegmenttest.cpp | 73 +++++++++++++++++++ .../proc/mobject/session/addcliptest.cpp | 68 +++++++++++++++++ .../proc/mobject/session/deletecliptest.cpp | 68 +++++++++++++++++ .../mobject/session/rebuildfixturetest.cpp | 69 ++++++++++++++++++ .../proc/mobject/session/testclip.hpp | 60 +++++++++++++++ .../proc/mobject/session/testsession1.hpp | 63 ++++++++++++++++ 19 files changed, 836 insertions(+), 1 deletion(-) create mode 100644 tests/51asset.tests create mode 100644 tests/52engine.tests create mode 100644 tests/53session.tests create mode 100644 tests/54builder.tests create mode 100644 tests/55controller.tests create mode 100644 tests/58proc-operate.tests create mode 100644 tests/components/proc/asset/createassettest.cpp create mode 100644 tests/components/proc/asset/deleteassettest.cpp create mode 100644 tests/components/proc/asset/dependantassetstest.cpp create mode 100644 tests/components/proc/asset/testclipasset.hpp create mode 100644 tests/components/proc/engine/sourcenodetest.cpp create mode 100644 tests/components/proc/mobject/builder/buildsegmenttest.cpp create mode 100644 tests/components/proc/mobject/controller/rendersegmenttest.cpp create mode 100644 tests/components/proc/mobject/session/addcliptest.cpp create mode 100644 tests/components/proc/mobject/session/deletecliptest.cpp create mode 100644 tests/components/proc/mobject/session/rebuildfixturetest.cpp create mode 100644 tests/components/proc/mobject/session/testclip.hpp create mode 100644 tests/components/proc/mobject/session/testsession1.hpp diff --git a/tests/50components.tests b/tests/50components.tests index f0f2746c5..11afe390f 100644 --- a/tests/50components.tests +++ b/tests/50components.tests @@ -1,4 +1,4 @@ -TESTING "Component Test Suite: ALL" ./test-components +TESTING "Component Test Suite: common and basic components" ./test-components --group=common diff --git a/tests/51asset.tests b/tests/51asset.tests new file mode 100644 index 000000000..37b7dac4f --- /dev/null +++ b/tests/51asset.tests @@ -0,0 +1,14 @@ +TESTING "Component Test Suite: Asset Manager" ./test-components --group=asset + + + +PLANNED "CreateAsset_test" CreateAsset_test < + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace asset + { + namespace test + { + + + + + /*********************************************************************** + * @test creating new Assets and registering them with the AssetManager. + * @see proc_interface::AssetManager#reg + */ + class CreateAsset_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (CreateAsset_test, "unit asset"); + + + + } // namespace test + +} // namespace asset diff --git a/tests/components/proc/asset/deleteassettest.cpp b/tests/components/proc/asset/deleteassettest.cpp new file mode 100644 index 000000000..f7d8d5e9b --- /dev/null +++ b/tests/components/proc/asset/deleteassettest.cpp @@ -0,0 +1,67 @@ +/* + DeleteAsset(Test) - deleting and Asset with all dependencies + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace asset + { + namespace test + { + + + + + /******************************************************************* + * @test deleting an Asset includes removing all dependant Assets + * and all MObjects relying on these. Especially this means + * breaking all links between the involved Objects, so the + * shared-ptrs can do the actual cleanup. + * @see asset::Asset#unlink + * @see mobject::MObject#unlink + */ + class DeleteAsset_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (DeleteAsset_test, "function asset"); + + + + } // namespace test + +} // namespace asset diff --git a/tests/components/proc/asset/dependantassetstest.cpp b/tests/components/proc/asset/dependantassetstest.cpp new file mode 100644 index 000000000..648f2defd --- /dev/null +++ b/tests/components/proc/asset/dependantassetstest.cpp @@ -0,0 +1,65 @@ +/* + DependantAssets(Test) - unittest for the object creating factory + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace asset + { + namespace test + { + + + + + /******************************************************************* + * @test the handling of Assets dependant on other Assets and the + * enabling/disabling of Assets. + * @see asset::Asset + * @see asset::Clip + */ + class DependantAssets_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (DependantAssets_test, "unit function asset"); + + + + } // namespace test + +} // namespace asset diff --git a/tests/components/proc/asset/testclipasset.hpp b/tests/components/proc/asset/testclipasset.hpp new file mode 100644 index 000000000..3a06d1ba8 --- /dev/null +++ b/tests/components/proc/asset/testclipasset.hpp @@ -0,0 +1,58 @@ +/* + TESTCLIPASSET.hpp - test Media-Asset (clip) for checking Assets and MObjects + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef ASSET_TESTCLIPASSET_H +#define ASSET_TESTCLIPASSET_H + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace asset + { + /** + * An asset::Media instance Test Clip for checking + * various Asset operations and for creating + * dependent Clip-MObjects. + * + */ + class TestClipAsset + { + public: + }; + + + + + +} // namespace asset +#endif diff --git a/tests/components/proc/engine/sourcenodetest.cpp b/tests/components/proc/engine/sourcenodetest.cpp new file mode 100644 index 000000000..e7fab2279 --- /dev/null +++ b/tests/components/proc/engine/sourcenodetest.cpp @@ -0,0 +1,62 @@ +/* + SourceNode(Test) - unit test of the source readering render node + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace engine + { + namespace test + { + + + + + /******************************************************************* + * @test the source reading render node. + */ + class SourceNode_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (SourceNode_test, "unit engine"); + + + + } // namespace test + +} // namespace engine diff --git a/tests/components/proc/mobject/builder/buildsegmenttest.cpp b/tests/components/proc/mobject/builder/buildsegmenttest.cpp new file mode 100644 index 000000000..800cb4558 --- /dev/null +++ b/tests/components/proc/mobject/builder/buildsegmenttest.cpp @@ -0,0 +1,67 @@ +/* + BuildSegment(Test) - building the render-tree for a segment of the EDL + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace mobject + { + namespace builder + { + namespace test + { + + + + + /******************************************************************* + * @test the builder core functionality: create a render pipeline + * for a given segment of the EDL. + */ + class BuildSegment_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (BuildSegment_test, "function builder"); + + + + } // namespace test + + } // namespace builder + +} // namespace mobject diff --git a/tests/components/proc/mobject/controller/rendersegmenttest.cpp b/tests/components/proc/mobject/controller/rendersegmenttest.cpp new file mode 100644 index 000000000..5ef4064f1 --- /dev/null +++ b/tests/components/proc/mobject/controller/rendersegmenttest.cpp @@ -0,0 +1,73 @@ +/* + RenderSegment(Test) - Proc-Layer Integrationtest + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace mobject + { + namespace controller + { + namespace test + { + + + + + /******************************************************************* + * @test create a render process from a given segment of the EDL. + * Basically this includes cooperation of all parts of the + * Cinelerra Proc Layer. For a prepared test-EDL we invoke the + * controller to create a render process. This includes building + * the render pipeline. Finally, we analyze all the created + * Structures. + * @note this test doesn't cover the actual rendering. + * @see proc_interface::ControllerFacade + */ + class RenderSegment_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (RenderSegment_test, "function operate"); + + + + } // namespace test + + } // namespace controller + +} // namespace mobject diff --git a/tests/components/proc/mobject/session/addcliptest.cpp b/tests/components/proc/mobject/session/addcliptest.cpp new file mode 100644 index 000000000..f6cc5def1 --- /dev/null +++ b/tests/components/proc/mobject/session/addcliptest.cpp @@ -0,0 +1,68 @@ +/* + AddClip(Test) - adding an Clip-MObject to the EDL/Session + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace mobject + { + namespace session + { + namespace test + { + + + + + /******************************************************************* + * @test adding an test clip to the EDL/Session. + * @see mobject::session::Clip + * @see mobject::session::EDL + */ + class AddClip_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (AddClip_test, "unit session"); + + + + } // namespace test + + } // namespace session + +} // namespace mobject diff --git a/tests/components/proc/mobject/session/deletecliptest.cpp b/tests/components/proc/mobject/session/deletecliptest.cpp new file mode 100644 index 000000000..4a5c01567 --- /dev/null +++ b/tests/components/proc/mobject/session/deletecliptest.cpp @@ -0,0 +1,68 @@ +/* + DeleteClip(Test) - removing an Clip-MObject from the Session + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace mobject + { + namespace session + { + namespace test + { + + + + + /******************************************************************* + * @test removing a test clip from the EDL. + * @see mobject::session::Clip + * @see mobject::session::EDL + */ + class DeleteClip_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (DeleteClip_test, "function session"); + + + + } // namespace test + + } // namespace session + +} // namespace mobject diff --git a/tests/components/proc/mobject/session/rebuildfixturetest.cpp b/tests/components/proc/mobject/session/rebuildfixturetest.cpp new file mode 100644 index 000000000..01ad76b34 --- /dev/null +++ b/tests/components/proc/mobject/session/rebuildfixturetest.cpp @@ -0,0 +1,69 @@ +/* + RebuildFixture(Test) - (re)building the explicit placements + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace mobject + { + namespace session + { + namespace test + { + + + + + /******************************************************************* + * @test (re)building the ExplicitPlacement objects from the objects + * placed into the Session/EDL. + * @see mobject::session::Fixture + * @see mobject::ExplicitPlacement + */ + class RebuildFixture_test : public Test + { + virtual void run(Arg arg) + { + } + }; + + + /** Register this test class... */ + LAUNCHER (RebuildFixture_test, "unit session"); + + + + } // namespace test + + } // namespace session + +} // namespace mobject diff --git a/tests/components/proc/mobject/session/testclip.hpp b/tests/components/proc/mobject/session/testclip.hpp new file mode 100644 index 000000000..ec9ec8715 --- /dev/null +++ b/tests/components/proc/mobject/session/testclip.hpp @@ -0,0 +1,60 @@ +/* + TESTCLIP.hpp - test clip (stub) for checking EDL/Session functionality + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef MOBJECT_SESSION_TESTCLIP_H +#define MOBJECT_SESSION_TESTCLIP_H + + +#include "common/test/run.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace mobject + { + namespace session + { + /** + * Sample or Test Clip for checking + * various EDL, session and builder operations. + * + */ + class TestClip + { + public: + }; + + + + + } // namespace session + +} // namespace mobject +#endif diff --git a/tests/components/proc/mobject/session/testsession1.hpp b/tests/components/proc/mobject/session/testsession1.hpp new file mode 100644 index 000000000..5426047be --- /dev/null +++ b/tests/components/proc/mobject/session/testsession1.hpp @@ -0,0 +1,63 @@ +/* + TESTSESSION1.hpp - complete session configuration use for various tests + + Copyright (C) CinelerraCV + 2007, Christian Thaeter + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef MOBJECT_SESSION_TESTCLIP_H +#define MOBJECT_SESSION_TESTCLIP_H + + +#include "proc/mobject/session/session.hpp" +#include "common/error.hpp" +//#include "common/factory.hpp" +//#include "common/util.hpp" + +//#include +#include + +//using boost::format; +using std::string; +using std::cout; + + +namespace mobject + { + namespace session + { + typedef std::auto_ptr PSession; /////TODO + + /** + * Create a Test Session configuration usable for various Tests. + * This Session holds two Clips and corresponds to "Example1" + * in the UML design. + */ + PSession Testsession1 () + { + UNIMPLEMENTED ("Test-Session 1"); + }; + + + + + } // namespace session + +} // namespace mobject +#endif