Action_Thermostats
        Add_AtomRandomPerturbation
        Add_RotateAroundBondAction
        Add_SelectAtomByNameAction
        Adding_Graph_to_ChangeBondActions
        Adding_MD_integration_tests
        Adding_StructOpt_integration_tests
        AutomationFragmentation_failures
        Candidate_v1.6.0
        Candidate_v1.6.1
        Candidate_v1.7.0
        ChangeBugEmailaddress
        ChangingTestPorts
        ChemicalSpaceEvaluator
        Debian_Package_split
        Debian_package_split_molecuildergui_only
        Disabling_MemDebug
        Docu_Python_wait
        EmpiricalPotential_contain_HomologyGraph_documentation
        Enhance_userguide
        Enhanced_StructuralOptimization
        Enhanced_StructuralOptimization_continued
        Example_ManyWaysToTranslateAtom
        Exclude_Hydrogens_annealWithBondGraph
        FitPartialCharges_GlobalError
        Fix_ChronosMutex
        Fix_StatusMsg
        Fix_StepWorldTime_single_argument
        Fix_Verbose_Codepatterns
        ForceAnnealing_goodresults
        ForceAnnealing_oldresults
        ForceAnnealing_tocheck
        ForceAnnealing_with_BondGraph
        ForceAnnealing_with_BondGraph_continued
        ForceAnnealing_with_BondGraph_continued_betteresults
        ForceAnnealing_with_BondGraph_contraction-expansion
        GeometryObjects
        Gui_displays_atomic_force_velocity
        IndependentFragmentGrids_IntegrationTest
        JobMarket_RobustOnKillsSegFaults
        JobMarket_StableWorkerPool
        JobMarket_unresolvable_hostname_fix
        PartialCharges_OrthogonalSummation
        PythonUI_with_named_parameters
        QtGui_reactivate_TimeChanged_changes
        Recreated_GuiChecks
        RotateToPrincipalAxisSystem_UndoRedo
        StoppableMakroAction
        TremoloParser_IncreasedPrecision
        TremoloParser_MultipleTimesteps
        Ubuntu_1604_changes
        stable
      
      
      
| Rev | Line |   | 
|---|
| [084729c] | 1 | /*
 | 
|---|
 | 2 |  * Project: MoleCuilder
 | 
|---|
 | 3 |  * Description: creates and alters molecular systems
 | 
|---|
 | 4 |  * Copyright (C)  2010 University of Bonn. All rights reserved.
 | 
|---|
 | 5 |  * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
 | 
|---|
 | 6 |  */
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | /*
 | 
|---|
 | 9 |  * AssertUnitTest.cpp
 | 
|---|
 | 10 |  *
 | 
|---|
 | 11 |  *  Created on: Feb 10, 2011
 | 
|---|
 | 12 |  *      Author: heber
 | 
|---|
 | 13 |  */
 | 
|---|
 | 14 | 
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | // include config.h
 | 
|---|
 | 17 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 18 | #include <config.h>
 | 
|---|
 | 19 | #endif
 | 
|---|
 | 20 | 
 | 
|---|
 | 21 | using namespace std;
 | 
|---|
 | 22 | 
 | 
|---|
 | 23 | #include <cppunit/CompilerOutputter.h>
 | 
|---|
 | 24 | #include <cppunit/extensions/TestFactoryRegistry.h>
 | 
|---|
 | 25 | #include <cppunit/ui/text/TestRunner.h>
 | 
|---|
 | 26 | 
 | 
|---|
 | 27 | #include "CodePatterns/Assert.hpp"
 | 
|---|
 | 28 | 
 | 
|---|
 | 29 | #include "AssertUnitTest.hpp"
 | 
|---|
 | 30 | 
 | 
|---|
 | 31 | #ifdef HAVE_TESTRUNNER
 | 
|---|
 | 32 | #include "UnitTestMain.hpp"
 | 
|---|
 | 33 | #endif /*HAVE_TESTRUNNER*/
 | 
|---|
 | 34 | 
 | 
|---|
 | 35 | /********************************************** Test classes **************************************/
 | 
|---|
 | 36 | 
 | 
|---|
 | 37 | // Registers the fixture into the 'registry'
 | 
|---|
 | 38 | CPPUNIT_TEST_SUITE_REGISTRATION( AssertTest );
 | 
|---|
 | 39 | 
 | 
|---|
 | 40 | void testfunction() {
 | 
|---|
 | 41 |   ASSERT(0==1, "testfunction() - 0 != 1");
 | 
|---|
 | 42 | }
 | 
|---|
 | 43 | 
 | 
|---|
 | 44 | void testfunction2() {
 | 
|---|
 | 45 |   ASSERT(0==0, "testfunction() - 0 != 0");
 | 
|---|
 | 46 | }
 | 
|---|
 | 47 | 
 | 
|---|
 | 48 | void AssertTest::setUp()
 | 
|---|
 | 49 | {
 | 
|---|
 | 50 |   ASSERT_DO(Assert::Ignore);
 | 
|---|
 | 51 | };
 | 
|---|
 | 52 | 
 | 
|---|
 | 53 | void AssertTest::tearDown()
 | 
|---|
 | 54 | {};
 | 
|---|
 | 55 | 
 | 
|---|
 | 56 | /**
 | 
|---|
 | 57 |  * UnitTest for execeptions thrown by ASSERT()
 | 
|---|
 | 58 |  */
 | 
|---|
 | 59 | void AssertTest::ThrowTest()
 | 
|---|
 | 60 | {
 | 
|---|
 | 61 |   // test throw
 | 
|---|
 | 62 |   ASSERT_DO(Assert::Throw);
 | 
|---|
 | 63 |   CPPUNIT_ASSERT_THROW(testfunction(), Assert::AssertionFailure);
 | 
|---|
 | 64 |   CPPUNIT_ASSERT_NO_THROW(testfunction2());
 | 
|---|
 | 65 |   // test no throws on ignore (abort and others would interrupt unit test)
 | 
|---|
 | 66 |   ASSERT_DO(Assert::Ignore);
 | 
|---|
 | 67 |   CPPUNIT_ASSERT_NO_THROW(testfunction());
 | 
|---|
 | 68 | };
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.