dlvhex
2.5.0
|
Test HEX parser. More...
#include <boost/cstdint.hpp>
#include "dlvhex2/HexParser.h"
#include "dlvhex2/InputProvider.h"
#include "dlvhex2/ProgramCtx.h"
#include "dlvhex2/Printer.h"
#include "dlvhex2/Registry.h"
#include "dlvhex2/Interpretation.h"
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <fstream>
Go to the source code of this file.
Defines | |
#define | BOOST_TEST_MODULE "TestHexParser" |
#define | LOG_REGISTRY_PROGRAM(ctx) |
Functions | |
DLVHEX_NAMESPACE_USE | BOOST_AUTO_TEST_CASE (testHexParserSimple) |
BOOST_AUTO_TEST_CASE (testHexParserConstraint) | |
BOOST_AUTO_TEST_CASE (testHexParserBuiltinPredicates) | |
BOOST_AUTO_TEST_CASE (testHexParserExternalAtoms) |
Test HEX parser.
Definition in file TestHexParser.cpp.
#define BOOST_TEST_MODULE "TestHexParser" |
Definition at line 43 of file TestHexParser.cpp.
#define LOG_REGISTRY_PROGRAM | ( | ctx | ) |
LOG(INFO,*ctx.registry()); \ RawPrinter printer(std::cerr, ctx.registry()); \ std::cerr << "edb = " << *ctx.edb << std::endl; \ LOG(INFO,"idb"); \ printer.printmany(ctx.idb,"\n"); \ std::cerr << std::endl; \ LOG(INFO,"idb end");
Definition at line 49 of file TestHexParser.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
DLVHEX_NAMESPACE_USE BOOST_AUTO_TEST_CASE | ( | testHexParserSimple | ) |
Definition at line 62 of file TestHexParser.cpp.
References ID::address, Rule::body, ProgramCtx::edb, Rule::head, ID_FAIL(), ProgramCtx::idb, Rule::kind, Rule::level, LOG_REGISTRY_PROGRAM, ID::MAINKIND_RULE, ID::nafLiteralFromAtom(), ModuleHexParser::parse(), ID::posLiteralFromAtom(), ID::PROPERTY_RULE_DISJ, ProgramCtx::registry(), ProgramCtx::setupRegistry(), ID::SUBKIND_RULE_REGULAR, and Rule::weight.
BOOST_AUTO_TEST_CASE | ( | testHexParserConstraint | ) |
Definition at line 114 of file TestHexParser.cpp.
References Rule::body, Rule::head, ID_FAIL(), ProgramCtx::idb, Rule::kind, Rule::level, LOG_REGISTRY_PROGRAM, ID::MAINKIND_RULE, ID::nafLiteralFromAtom(), ModuleHexParser::parse(), ID::posLiteralFromAtom(), ProgramCtx::registry(), ProgramCtx::setupRegistry(), ID::SUBKIND_RULE_CONSTRAINT, and Rule::weight.
BOOST_AUTO_TEST_CASE | ( | testHexParserBuiltinPredicates | ) |
Definition at line 249 of file TestHexParser.cpp.
References Rule::body, Rule::head, ID_FAIL(), ProgramCtx::idb, ID::isBuiltinAtom(), ID::isLiteral(), Rule::kind, Rule::level, LOG_REGISTRY_PROGRAM, ID::MAINKIND_RULE, ModuleHexParser::parse(), ProgramCtx::registry(), ProgramCtx::setupRegistry(), ID::SUBKIND_RULE_CONSTRAINT, ID::TERM_BUILTIN_GE, ID::TERM_BUILTIN_INT, ID::TERM_BUILTIN_LT, ID::TERM_BUILTIN_NE, ID::termFromBuiltin(), ID::termFromInteger(), and Rule::weight.
BOOST_AUTO_TEST_CASE | ( | testHexParserExternalAtoms | ) |
Definition at line 327 of file TestHexParser.cpp.
References Rule::body, Rule::head, ID_FAIL(), ProgramCtx::idb, ID::isExternalAtom(), ID::isLiteral(), Rule::kind, Rule::level, LOG_REGISTRY_PROGRAM, ID::MAINKIND_RULE, ModuleHexParser::parse(), ID::PROPERTY_RULE_EXTATOMS, ProgramCtx::registry(), ProgramCtx::setupRegistry(), ID::SUBKIND_RULE_CONSTRAINT, ID::termFromInteger(), and Rule::weight.