dlvhex  2.5.0
testsuite/TestModelGraph.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 <iostream>
00036 #include <set>
00037 #include <list>
00038 #include <string>
00039 #include <vector>
00040 #include <cassert>
00041 
00042 #include <boost/foreach.hpp>
00043 //#include <boost/type_traits/remove_const.hpp>
00044 #include <boost/graph/graph_traits.hpp>
00045 #include <boost/graph/adjacency_list.hpp>
00046 #include <boost/property_map/vector_property_map.hpp>
00047 #include <boost/concept/assert.hpp>
00048 #include <boost/concept_check.hpp>
00049 #define BOOST_TEST_MODULE __FILE__
00050 #include <boost/test/unit_test.hpp>
00051 
00052 #include "dlvhex2/Logger.h"
00053 #include "dlvhex2/EvalGraph.h"
00054 #include "dlvhex2/ModelGraph.h"
00055 
00056 #include "fixtureE2M2.h"
00057 
00058 using dlvhex::MT_OUT;
00059 using dlvhex::MT_IN;
00060 
00061 LOG_INIT(Logger::ERROR | Logger::WARNING)
00062 
00063 BOOST_AUTO_TEST_SUITE(root_TestModelGraph)
00064 
00065 BOOST_FIXTURE_TEST_CASE(setup_model_graph_m2, ModelGraphE2M2Fixture)
00066 {
00067     TestModelGraph::ModelList::const_iterator it;
00068 
00069   BOOST_REQUIRE(mg.modelsAt(u2, MT_OUT).size() == 1);
00070     it = mg.modelsAt(u2, MT_OUT).begin();
00071   BOOST_CHECK(*it == m5);
00072 
00073   BOOST_REQUIRE(mg.modelsAt(u2, MT_IN).size() == 2);
00074     it = mg.modelsAt(u2, MT_IN).begin();
00075   BOOST_CHECK(*it == m3);
00076     ++it;
00077   BOOST_CHECK(*it == m4);
00078 
00079   BOOST_CHECK(mg.propsOf(m10).location == u3);
00080   BOOST_CHECK(mg.propsOf(m10).type == MT_OUT);
00081 }
00082 
00083 BOOST_AUTO_TEST_SUITE_END()