dlvhex  2.5.0
testsuite/fixtureE2M2.cpp
Go to the documentation of this file.
00001 /* dlvhex -- Answer-Set Programming with external interfaces.
00002  * Copyright (C) 2005, 2006, 2007 Roman Schindlauer
00003  * Copyright (C) 2006, 2007, 2008, 2009, 2010 Thomas Krennwallner
00004  * Copyright (C) 2009, 2010 Peter Schüller
00005  * 
00006  * This file is part of dlvhex.
00007  *
00008  * dlvhex is free software; you can redistribute it and/or modify it
00009  * under the terms of the GNU Lesser General Public License as
00010  * published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * dlvhex is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with dlvhex; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA.
00022  */
00023 
00031 #ifdef HAVE_CONFIG_H
00032 #include "config.h"
00033 #endif // HAVE_CONFIG_H
00034 
00035 #include "fixtureE2M2.h"
00036 
00037 #include <boost/test/unit_test.hpp>
00038 
00039 using namespace dlvhex;
00040 
00041 ModelGraphE2M2Fixture::ModelGraphE2M2Fixture():
00042   EvalGraphE2Fixture(),
00043   mg(eg)
00044 {
00045   std::vector<Model> depm;
00046   depm.reserve(2);
00047 
00048   // u1
00049   BOOST_TEST_MESSAGE("adding dummyi1");
00050   dummyi1 = mg.addModel(u1, MT_IN);
00051   BOOST_TEST_MESSAGE("adding m1");
00052   depm.clear(); depm.push_back(dummyi1);
00053   m1 = mg.addModel(u1, MT_OUT, depm);
00054   BOOST_TEST_MESSAGE("adding m2");
00055   depm.clear(); depm.push_back(dummyi1);
00056   m2 = mg.addModel(u1, MT_OUT, depm);
00057 
00058   // u2
00059   BOOST_TEST_MESSAGE("adding m3");
00060   depm.clear(); depm.push_back(m1);
00061   m3 = mg.addModel(u2, MT_IN, depm);
00062   BOOST_TEST_MESSAGE("adding m4");
00063   depm.clear(); depm.push_back(m2);
00064   m4 = mg.addModel(u2, MT_IN, depm);
00065   BOOST_TEST_MESSAGE("adding m5");
00066   depm.clear(); depm.push_back(m4);
00067   m5 = mg.addModel(u2, MT_OUT, depm);
00068 
00069   // u3
00070   BOOST_TEST_MESSAGE("adding m6");
00071   depm.clear(); depm.push_back(m1);
00072   m6 = mg.addModel(u3, MT_IN, depm);
00073   BOOST_TEST_MESSAGE("adding m7");
00074   depm.clear(); depm.push_back(m2);
00075   m7 = mg.addModel(u3, MT_IN, depm);
00076   BOOST_TEST_MESSAGE("adding m8");
00077   depm.clear(); depm.push_back(m6);
00078   m8 = mg.addModel(u3, MT_OUT, depm);
00079   BOOST_TEST_MESSAGE("adding m9");
00080   depm.clear(); depm.push_back(m6);
00081   m9 = mg.addModel(u3, MT_OUT, depm);
00082   BOOST_TEST_MESSAGE("adding m10");
00083   depm.clear(); depm.push_back(m7);
00084   m10 = mg.addModel(u3, MT_OUT, depm);
00085   BOOST_TEST_MESSAGE("adding m11");
00086   depm.clear(); depm.push_back(m7);
00087   m11 = mg.addModel(u3, MT_OUT, depm);
00088 
00089   // u4
00090   BOOST_TEST_MESSAGE("adding m12");
00091   depm.clear(); depm.push_back(m5); depm.push_back(m10);
00092   m12 = mg.addModel(u4, MT_IN, depm);
00093   BOOST_TEST_MESSAGE("adding m13");
00094   depm.clear(); depm.push_back(m5); depm.push_back(m11);
00095   m13 = mg.addModel(u4, MT_IN, depm);
00096   BOOST_TEST_MESSAGE("adding m14");
00097   depm.clear(); depm.push_back(m12);
00098   m14 = mg.addModel(u4, MT_OUT, depm);
00099 }
00100