OKlibrary  0.2.1.6
Scoring_Tests.hpp
Go to the documentation of this file.
00001 // Oliver Kullmann, 17.6.2005 (Swansea)
00002 /* Copyright 2005 - 2007 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00014 #ifndef SCORINGTESTS_kdkdnvc1
00015 #define SCORINGTESTS_kdkdnvc1
00016 
00017 #include <string>
00018 #include <cassert>
00019 
00020 #include <OKlib/TestSystem/TestBaseClass.hpp>
00021 #include <OKlib/TestSystem/TestExceptions.hpp>
00022 
00023 #include <OKlib/Experimentation/Competition/ResultProcessing.hpp>
00024 #include <OKlib/Experimentation/Competition/ParsingSingleResult.hpp>
00025 #include <OKlib/Experimentation/Competition/AnalysisTools.hpp>
00026 #include <OKlib/Experimentation/Competition/ParsingResultSequences_Tests.hpp>
00027 
00028 namespace OKlib {
00029   namespace SATCompetition {
00030 
00031     template <template <class IndexedDatabase, class SeriesPursePolicy = SAT2005SeriesPurse, typename NumberType = double> class  PurseScoring>
00032     class Test_PurseScoring : public ::OKlib::TestSystem::TestBase {
00033     public :
00034       typedef Test_PurseScoring test_type;
00035       Test_PurseScoring() {
00036         insert(this);
00037       }
00038     private :
00039 
00040       void perform_test_trivial() {
00041 
00042         test_result<Result>(filename_large_industrial, line_count_large_industrial);
00043         test_result<ResultRandomSat>(filename_large_random, line_count_large_random);
00044 
00045       }
00046 
00047       template <class result_type>
00048       void test_result(const std::string& filename, const unsigned int line_count) {
00049 
00050         typedef Result_database_from_file<ParserResult, result_type> result_database;
00051         typedef typename result_database::database_type database;
00052         typedef ElementaryAnalysis<database> indexed_database;
00053         typedef PurseScoring<indexed_database> purse_scoring_type;
00054 
00055         result_database rdb(filename);
00056         assert(rdb.result_sequence.size() == line_count);
00057         indexed_database idb(rdb.db);
00058         purse_scoring_type purse_scoring(idb);
00059 
00060         typedef typename purse_scoring_type::number_type number_type;
00061         
00062       }
00063 
00064     };
00065 
00066   }
00067 
00068 }
00069 
00070 #endif