Ignore:
Timestamp:
Apr 17, 2012, 11:39:19 AM (13 years ago)
Author:
Michael Ankele <ankele@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
c513b7
Parents:
c68409
git-author:
Michael Ankele <ankele@…> (04/10/12 11:52:53)
git-committer:
Michael Ankele <ankele@…> (04/17/12 11:39:19)
Message:

updated Parameters' unittests

  • renamed "xxxUnitTest" -> "xxxTest" (to evade naming conflicts)
  • removed string operations
  • fixed missing template <T>s
Location:
src/Parameters/unittests
Files:
4 deleted
1 edited
8 moved

Legend:

Unmodified
Added
Removed
  • src/Parameters/unittests/ContinuousParameterTest.cpp

    rc68409 rdbb533  
    77
    88/*
    9  * ContinuousParameterUnitTest.cpp
     9 * ContinuousParameterTest.cpp
    1010 *
    1111 *  Created on: Sep 30, 2011
     
    1818#endif
    1919
    20 #include "ContinuousParameterUnitTest.hpp"
     20#include "ContinuousParameterTest.hpp"
    2121
    2222#include <cppunit/CompilerOutputter.h>
     
    2424#include <cppunit/ui/text/TestRunner.h>
    2525
    26 #include "Parser/Parameters/ContinuousParameter.hpp"
     26#include "Parameters/ContinuousParameter.hpp"
    2727
    2828#include "CodePatterns/Range.hpp"
  • src/Parameters/unittests/ContinuousParameterTest.hpp

    rc68409 rdbb533  
    11/*
    2  * ContinuousParameterUnitTest.hpp
     2 * ContinuousParameterTest.hpp
    33 *
    44 *  Created on: Sep 30, 2011
    55 *      Author: heber
    66 */
    7 #ifndef CONTINUOUSPARAMETERUNITTEST_HPP_
    8 #define CONTINUOUSPARAMETERUNITTEST_HPP_
     7#ifndef CONTINUOUSPARAMETERTEST_HPP_
     8#define CONTINUOUSPARAMETERTEST_HPP_
    99
    1010// include config.h
     
    3737};
    3838
    39 #endif /* CONTINUOUSPARAMETERUNITTEST_HPP_ */
     39#endif /* CONTINUOUSPARAMETERTEST_HPP_ */
  • src/Parameters/unittests/ContinuousValueTest.cpp

    rc68409 rdbb533  
    77
    88/*
    9  * ContinuousValueUnitTest.cpp
     9 * ContinuousValueTest.cpp
    1010 *
    1111 *  Created on: Sep 29, 2011
     
    1818#endif
    1919
    20 #include "ContinuousValueUnitTest.hpp"
     20#include "ContinuousValueTest.hpp"
    2121
    2222#include <cppunit/CompilerOutputter.h>
     
    2424#include <cppunit/ui/text/TestRunner.h>
    2525
    26 #include "Parser/Parameters/ContinuousValue.hpp"
    27 
    28 #include "CodePatterns/toString.hpp"
     26#include "Parameters/ContinuousValue.hpp"
    2927
    3028#ifdef HAVE_TESTRUNNER
     
    8078  // checking valid values
    8179  for (int i=1; i<=4;++i)
    82     CPPUNIT_ASSERT_EQUAL(true, test.isValid(toString(i)));
     80    CPPUNIT_ASSERT_EQUAL(true, test.isValid(i));
    8381
    8482  // checking invalid values
    8583  for (int i=-10; i<=0;++i)
    86     CPPUNIT_ASSERT_EQUAL(false, test.isValid(toString(i)));
     84    CPPUNIT_ASSERT_EQUAL(false, test.isValid(i));
    8785  for (int i=5; i<=0;++i)
    88     CPPUNIT_ASSERT_EQUAL(false, test.isValid(toString(i)));
     86    CPPUNIT_ASSERT_EQUAL(false, test.isValid(i));
    8987}
    9088
     
    179177#ifndef NDEBUG
    180178  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    181   CPPUNIT_ASSERT_THROW(test.set(toString(5)), Assert::AssertionFailure);
    182 #endif
    183 #ifndef NDEBUG
    184   std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    185   CPPUNIT_ASSERT_THROW(test.set(toString(0)), Assert::AssertionFailure);
     179  CPPUNIT_ASSERT_THROW(test.set(5), Assert::AssertionFailure);
     180#endif
     181#ifndef NDEBUG
     182  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
     183  CPPUNIT_ASSERT_THROW(test.set(0), Assert::AssertionFailure);
    186184#endif
    187185
    188186  // checking all valid ones
    189187  for (int i=1; i<=4;++i) {
    190     test.set(toString(i));
    191     CPPUNIT_ASSERT_EQUAL(toString(i), test.get());
     188    test.set(i);
     189    CPPUNIT_ASSERT_EQUAL(i, test.get());
    192190  }
    193191}
  • src/Parameters/unittests/ContinuousValueTest.hpp

    rc68409 rdbb533  
    11/*
    2  * ContinuousValueUnitTest.hpp
     2 * ContinuousValueTest.hpp
    33 *
    44 *  Created on: Sep 29, 2011
    55 *      Author: heber
    66 */
    7 #ifndef CONTINUOUSVALUEUNITTEST_HPP_
    8 #define CONTINUOUSVALUEUNITTEST_HPP_
     7#ifndef CONTINUOUSVALUETEST_HPP_
     8#define CONTINUOUSVALUETEST_HPP_
    99
    1010// include config.h
     
    4545};
    4646
    47 #endif /* CONTINUOUSVALUEUNITTEST_HPP_ */
     47#endif /* CONTINUOUSVALUETEST_HPP_ */
  • src/Parameters/unittests/DiscreteParameterTest.cpp

    rc68409 rdbb533  
    77
    88/*
    9  * DiscreteParameterUnitTest.cpp
     9 * DiscreteParameterTest.cpp
    1010 *
    1111 *  Created on: Sep 30, 2011
     
    1818#endif
    1919
    20 #include "DiscreteParameterUnitTest.hpp"
     20#include "DiscreteParameterTest.hpp"
    2121
    2222#include <cppunit/CompilerOutputter.h>
     
    2424#include <cppunit/ui/text/TestRunner.h>
    2525
    26 #include "Parser/Parameters/DiscreteParameter.hpp"
     26#include "Parameters/DiscreteParameter.hpp"
    2727
    2828#ifdef HAVE_TESTRUNNER
  • src/Parameters/unittests/DiscreteParameterTest.hpp

    rc68409 rdbb533  
    11/*
    2  * DiscreteParameterUnitTest.hpp
     2 * DiscreteParameterTest.hpp
    33 *
    44 *  Created on: Sep 30, 2011
    55 *      Author: heber
    66 */
    7 #ifndef DISCRETEPARAMETERUNITTEST_HPP_
    8 #define DISCRETEPARAMETERUNITTEST_HPP_
     7#ifndef DISCRETEPARAMETERTEST_HPP_
     8#define DISCRETEPARAMETERTEST_HPP_
    99
    1010// include config.h
     
    3535};
    3636
    37 #endif /* DISCRETEPARAMETERUNITTEST_HPP_ */
     37#endif /* DISCRETEPARAMETERTEST_HPP_ */
  • src/Parameters/unittests/DiscreteValueTest.cpp

    rc68409 rdbb533  
    77
    88/*
    9  * DiscreteValueUnitTest.cpp
     9 * DiscreteValueTest.cpp
    1010 *
    1111 *  Created on: Sep 28, 2011
     
    1818#endif
    1919
    20 #include "DiscreteValueUnitTest.hpp"
     20#include "DiscreteValueTest.hpp"
    2121
    2222#include <cppunit/CompilerOutputter.h>
     
    2424#include <cppunit/ui/text/TestRunner.h>
    2525
    26 #include "Parser/Parameters/DiscreteValue.hpp"
    27 
    28 #include "CodePatterns/toString.hpp"
     26#include "Parameters/DiscreteValue.hpp"
    2927
    3028#ifdef HAVE_TESTRUNNER
     
    104102  // checking valid values
    105103  for (int i=1; i<=3;++i)
    106     CPPUNIT_ASSERT_EQUAL(true, test.isValid(toString(i)));
    107 
    108   // checking invalid values
    109   for (int i=-10; i<=0;++i)
    110     CPPUNIT_ASSERT_EQUAL(false, test.isValid(toString(i)));
     104    CPPUNIT_ASSERT_EQUAL(true, test.isValid(i));
     105
     106  // checking invalid values
     107  for (int i=-10; i<=0;++i)
     108    CPPUNIT_ASSERT_EQUAL(false, test.isValid(i));
    111109  for (int i=4; i<=0;++i)
    112     CPPUNIT_ASSERT_EQUAL(false, test.isValid(toString(i)));
     110    CPPUNIT_ASSERT_EQUAL(false, test.isValid(i));
    113111}
    114112
     
    167165#ifndef NDEBUG
    168166  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    169   CPPUNIT_ASSERT_THROW(test.set(toString(4)), Assert::AssertionFailure);
    170 #endif
    171 #ifndef NDEBUG
    172   std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    173   CPPUNIT_ASSERT_THROW(test.set(toString(0)), Assert::AssertionFailure);
     167  CPPUNIT_ASSERT_THROW(test.set(4), Assert::AssertionFailure);
     168#endif
     169#ifndef NDEBUG
     170  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
     171  CPPUNIT_ASSERT_THROW(test.set(0), Assert::AssertionFailure);
    174172#endif
    175173
    176174  // checking all valid ones
    177175  for (int i=1; i<=3;++i) {
    178     test.set(toString(i));
    179     CPPUNIT_ASSERT_EQUAL(toString(i), test.get());
     176    test.set(i);
     177    CPPUNIT_ASSERT_EQUAL(i, test.get());
    180178  }
    181179
  • src/Parameters/unittests/DiscreteValueTest.hpp

    rc68409 rdbb533  
    11/*
    2  * DiscreteValueUnitTest.hpp
     2 * DiscreteValueTest.hpp
    33 *
    44 *  Created on: Sep 28, 2011
    55 *      Author: heber
    66 */
    7 #ifndef DISCRETEVALUEUNITTEST_HPP_
    8 #define DISCRETEVALUEUNITTEST_HPP_
     7#ifndef DISCRETEVALUETEST_HPP_
     8#define DISCRETEVALUETEST_HPP_
    99
    1010// include config.h
     
    4545};
    4646
    47 #endif /* DISCRETEVALUEUNITTEST_HPP_ */
     47#endif /* DISCRETEVALUETEST_HPP_ */
  • src/Parameters/unittests/Makefile.am

    rc68409 rdbb533  
    33
    44
    5 PARSERPARAMETERSTESTSSOURCES = \
    6         ../Parameters/unittests/ContinuousValueUnitTest.cpp \
    7         ../Parameters/unittests/ContinuousParameterUnitTest.cpp \
    8         ../Parameters/unittests/DiscreteValueUnitTest.cpp \
    9         ../Parameters/unittests/DiscreteParameterUnitTest.cpp \
    10         ../Parameters/unittests/ParameterStorageUnitTest.cpp \
    11         ../Parameters/unittests/StringParameterUnitTest.cpp
     5PARAMETERSTESTSSOURCES = \
     6        ../Parameters/unittests/ContinuousValueTest.cpp \
     7        ../Parameters/unittests/ContinuousParameterTest.cpp \
     8        ../Parameters/unittests/DiscreteValueTest.cpp \
     9        ../Parameters/unittests/DiscreteParameterTest.cpp
    1210
    13 PARSERPARAMETERSTESTSHEADERS = \
    14         ../Parameters/unittests/ContinuousValueUnitTest.hpp \
    15         ../Parameters/unittests/ContinuousParameterUnitTest.hpp \
    16         ../Parameters/unittests/DiscreteValueUnitTest.hpp \
    17         ../Parameters/unittests/DiscreteParameterUnitTest.hpp \
    18         ../Parameters/unittests/ParameterStorageUnitTest.hpp \
    19         ../Parameters/unittests/StringParameterUnitTest.hpp
     11PARAMETERSTESTSHEADERS = \
     12        ../Parameters/unittests/ContinuousValueTest.hpp \
     13        ../Parameters/unittests/ContinuousParameterTest.hpp \
     14        ../Parameters/unittests/DiscreteValueTest.hpp \
     15        ../Parameters/unittests/DiscreteParameterTest.hpp
    2016
    21 PARSERPARAMETERSTESTS = \
    22         ContinuousValueUnitTest \
    23         ContinuousParameterUnitTest \
    24         DiscreteValueUnitTest \
    25         DiscreteParameterUnitTest \
    26         ParameterStorageUnitTest \
    27         StringParameterUnitTest
     17PARAMETERSTESTS = \
     18        ContinuousValueTest \
     19        ContinuousParameterTest \
     20        DiscreteValueTest \
     21        DiscreteParameterTest
    2822
    29 TESTS += $(PARSERPARAMETERSTESTS)
    30 check_PROGRAMS += $(PARSERPARAMETERSTESTS)
    31 noinst_PROGRAMS += $(PARSERPARAMETERSTESTS)
     23TESTS += $(PARAMETERSTESTS)
     24check_PROGRAMS += $(PARAMETERSTESTS)
     25noinst_PROGRAMS += $(PARAMETERSTESTS)
    3226
    33 PARSERPARAMETERSLIBS =
     27PARAMETERSLIBS =
    3428
    3529
    36 ContinuousValueUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    37         ../Parameters/unittests/ContinuousValueUnitTest.cpp \
    38         ../Parameters/unittests/ContinuousValueUnitTest.hpp \
     30ContinuousValueTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
     31        ../Parameters/unittests/ContinuousValueTest.cpp \
     32        ../Parameters/unittests/ContinuousValueTest.hpp \
    3933        ../Parameters/ContinuousValue.hpp \
    4034        ../Parameters/ContinuousValue_impl.hpp \
    4135        ../Parameters/ValueInterface.hpp
    42 ContinuousValueUnitTest_LDADD = \
    43         $(PARSERPARAMETERSLIBS)
     36ContinuousValueTest_LDADD = \
     37        $(PARAMETERSLIBS)
    4438 
    45 ContinuousParameterUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    46         ../Parameters/unittests/ContinuousParameterUnitTest.cpp \
    47         ../Parameters/unittests/ContinuousParameterUnitTest.hpp \
     39ContinuousParameterTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
     40        ../Parameters/unittests/ContinuousParameterTest.cpp \
     41        ../Parameters/unittests/ContinuousParameterTest.hpp \
    4842        ../Parameters/ContinuousValue.hpp \
    4943        ../Parameters/ContinuousValue_impl.hpp \
     
    5246        ../Parameters/Parameter.hpp \
    5347        ../Parameters/ValueInterface.hpp
    54 ContinuousParameterUnitTest_LDADD = \
    55         $(PARSERPARAMETERSLIBS)
     48ContinuousParameterTest_LDADD = \
     49        $(PARAMETERSLIBS)
    5650 
    57 DiscreteValueUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    58         ../Parameters/unittests/DiscreteValueUnitTest.cpp \
    59         ../Parameters/unittests/DiscreteValueUnitTest.hpp \
     51DiscreteValueTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
     52        ../Parameters/unittests/DiscreteValueTest.cpp \
     53        ../Parameters/unittests/DiscreteValueTest.hpp \
    6054        ../Parameters/DiscreteValue.hpp \
    6155        ../Parameters/DiscreteValue_impl.hpp \
    6256        ../Parameters/ValueInterface.hpp
    63 DiscreteValueUnitTest_LDADD = \
    64         $(PARSERPARAMETERSLIBS)
     57DiscreteValueTest_LDADD = \
     58        $(PARAMETERSLIBS)
    6559
    66 DiscreteParameterUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    67         ../Parameters/unittests/DiscreteParameterUnitTest.cpp \
    68         ../Parameters/unittests/DiscreteParameterUnitTest.hpp \
     60DiscreteParameterTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
     61        ../Parameters/unittests/DiscreteParameterTest.cpp \
     62        ../Parameters/unittests/DiscreteParameterTest.hpp \
    6963        ../Parameters/DiscreteValue.hpp \
    7064        ../Parameters/DiscreteValue_impl.hpp \
     
    7367        ../Parameters/Parameter.hpp \
    7468        ../Parameters/ValueInterface.hpp
    75 DiscreteParameterUnitTest_LDADD = \
    76         $(PARSERPARAMETERSLIBS)
    77 
    78 ParameterStorageUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    79         ../Parameters/unittests/ParameterStorageUnitTest.cpp \
    80         ../Parameters/unittests/ParameterStorageUnitTest.hpp \
    81         ../Parameters/ParameterStorage.cpp \
    82         ../Parameters/ParameterStorage.hpp \
    83         ../Parameters/ContinuousValue.hpp \
    84         ../Parameters/ContinuousValue_impl.hpp \
    85         ../Parameters/DiscreteValue.hpp \
    86         ../Parameters/DiscreteValue_impl.hpp \
    87         ../Parameters/ValueInterface.hpp
    88 ParameterStorageUnitTest_LDADD = \
    89         $(CodePatterns_LIBS) \
    90         $(PARSERPARAMETERSLIBS)
    91 
    92 StringParameterUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
    93         ../Parameters/unittests/StringParameterUnitTest.cpp \
    94         ../Parameters/unittests/StringParameterUnitTest.hpp \
    95         ../Parameters/StringParameter.cpp \
    96         ../Parameters/StringParameter.hpp \
    97         ../Parameters/Parameter.hpp \
    98         ../Parameters/ValueInterface.hpp
    99 StringParameterUnitTest_LDADD = \
    100         $(PARSERPARAMETERSLIBS)
     69DiscreteParameterTest_LDADD = \
     70        $(PARAMETERSLIBS)
    10171 
    10272 
Note: See TracChangeset for help on using the changeset viewer.