Changeset c26f44


Ignore:
Timestamp:
Oct 5, 2009, 5:21:58 PM (16 years ago)
Author:
Frederik Heber <heber@…>
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:
fa861b
Parents:
a33931
git-author:
Frederik Heber <heber@…> (10/05/09 17:14:58)
git-committer:
Frederik Heber <heber@…> (10/05/09 17:21:58)
Message:

Fixed testsuite, removed some minor bugs.

  • TesselationUnitTest_SOURCES lacked memoryallocator stuff
  • Free does not give a message anymore, as there can be no error.
  • testsuite was fixed for suite 2 and 3, mostly due to changed options that were not accomodated for in the testsuite
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Makefile.am

    ra33931 rc26f44  
    1616VectorUnitTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
    1717VectorUnitTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
    18 TesselationUnitTest_SOURCES = defs.hpp helpers.cpp helpers.hpp leastsquaremin.cpp leastsquaremin.hpp linkedcell.cpp linkedcell.hpp tesselation.cpp tesselation.hpp tesselationhelpers.cpp tesselationhelpers.hpp tesselationunittest.cpp tesselationunittest.hpp vector.cpp vector.hpp verbose.cpp verbose.hpp
     18TesselationUnitTest_SOURCES = defs.hpp helpers.cpp helpers.hpp leastsquaremin.cpp leastsquaremin.hpp linkedcell.cpp linkedcell.hpp memoryallocator.hpp memoryusageobserver.cpp memoryusageobserver.hpp tesselation.cpp tesselation.hpp tesselationhelpers.cpp tesselationhelpers.hpp tesselationunittest.cpp tesselationunittest.hpp vector.cpp vector.hpp verbose.cpp verbose.hpp
    1919TesselationUnitTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
    2020TesselationUnitTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
  • TabularUnified src/atom.cpp

    ra33931 rc26f44  
    6363{
    6464  Free<int>(&ComponentNr, "atom::~atom: *ComponentNr");
    65   Free<char *>(&Name, "atom::~atom: *Name");
     65  Free<char>(&Name, "atom::~atom: *Name");
    6666};
    6767
  • TabularUnified src/builder.cpp

    ra33931 rc26f44  
    20572057      return 0;
    20582058      break;
     2059    case 2:  // just for -f option
     2060      delete(molecules); // also free's all molecules contained
     2061      delete(periode);
     2062      cout << Verbose(0) <<  "Maximum of allocated memory: "
     2063        << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl;
     2064      cout << Verbose(0) <<  "Remaining non-freed memory: "
     2065        << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl;
     2066      return 2;
     2067      break;
    20592068    default:
    20602069      break;
  • TabularUnified src/memoryallocator.hpp

    ra33931 rc26f44  
    110110 *
    111111 * \param pointer to the allocated memory range to free; may be NULL, this function is a no-op then
     112 * \param *msg optional error message
    112113 */
    113 template <typename X> void Free(X** buffer)
     114template <typename X> void Free(X** buffer, const char *msg = NULL)
    114115{
    115116  if ((buffer == NULL) || (*buffer == NULL))
  • TabularUnified src/memoryusageobserver.cpp

    ra33931 rc26f44  
    7777 *
    7878 * \param pointer to the allocated piece of memory
     79 * \param *msg optional error message
    7980 */
    80 void MemoryUsageObserver::removeMemory(void* pointer) {
     81void MemoryUsageObserver::removeMemory(void* pointer, const char *msg) {
    8182  map<void*, size_t>::iterator current = memoryUsers.find(pointer);
    8283
    8384  if (current == memoryUsers.end()) {
    8485    cout << "WARNING: There is non-tracked memory to be freed. Pointer "
    85       << pointer << " is not registered by MemoryUsageObserver." << endl;
     86      << pointer << " is not registered by MemoryUsageObserver: ";
     87    if (msg != NULL)
     88      cout << *msg;
     89    cout << endl;
    8690    return;
    8791  }
  • TabularUnified src/memoryusageobserver.hpp

    ra33931 rc26f44  
    2828  static void purgeInstance();
    2929  void addMemory(void* pointer, size_t size);
    30   void removeMemory(void* pointer);
     30  void removeMemory(void* pointer, const char *msg = NULL);
    3131  size_t getUsedMemorySize();
    3232  size_t getMaximumUsedMemory();
  • TabularUnified src/molecules.cpp

    ra33931 rc26f44  
    16061606    MinimiseConstrainedPotential(out, PermutationMap, startstep, endstep, configuration.GetIsAngstroem());
    16071607  else {
    1608     PermutationMap = (atom **) Malloc(AtomCount*sizeof(atom *), "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
     1608    PermutationMap = Malloc<atom *>(AtomCount, "molecule::LinearInterpolationBetweenConfiguration: **PermutationMap");
    16091609    Walker = start;
    16101610    while (Walker->next != end) {
  • TabularUnified src/tesselation.cpp

    ra33931 rc26f44  
    552552TesselPoint::~TesselPoint()
    553553{
    554   Free<char *>(&Name, "~TesselPoint - *Name");
    555554};
    556555
  • TabularUnified src/tesselationunittest.cpp

    ra33931 rc26f44  
    8484  delete(TesselStruct);
    8585  for (LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
    86     delete((*Runner)->Name);
     86    delete[]((*Runner)->Name);
    8787    delete((*Runner)->node);
    8888    delete(*Runner);
     
    178178    for (set<BoundaryTriangleSet*>::iterator TriangleRunner = triangles->begin(); TriangleRunner != triangles->end(); TriangleRunner++)
    179179      CPPUNIT_ASSERT_EQUAL( true, (*TriangleRunner)->ContainsBoundaryPoint(Walker) );
     180    delete(triangles);
    180181  }
    181182}
  • TabularUnified tests/testsuite.at

    ra33931 rc26f44  
    3333AT_DATA([test.conf], [])
    3434AT_CHECK([../../molecuilder test.conf -e ./ -p test.xyz], 0, [ignore], [ignore])
    35 AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1       10.000000000    10.000000000    10.000000000    0 # Number in molecule 0
     35AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1       10.000000000    10.000000000    10.000000000    0 # molecule nr 0
    3636], [ignore])
    37 AT_CHECK([cp test.conf main_pcp_linux], 0, [ignore], [ignore])
    38 AT_DATA([input], [aa 10. 10. 10. 1
     37AT_CHECK([mv test.conf main_pcp_linux], 0, [ignore], [ignore])
     38AT_DATA([input], [maa 10. 10. 10. 1
    3939s
    4040q
    4141])
    42 AT_CHECK([../../molecuilder -e ./ <input], 0, [ignore], [ignore])
     42AT_CHECK([../../molecuilder test.conf -e ./ <input], 0, [ignore], [ignore])
    4343AT_CHECK([diff main_pcp_linux test.conf], 0, [ignore], [ignore])
    4444# 4. test some more configuration
    45 AT_CHECK([../../molecuilder test.conf -e ./ -t -s -b -F -E -c -b -a -U -T -u], 0, [ignore], [stderr])
    46 AT_CHECK([fgrep -c "Not enough or invalid" stderr], 0, [10
     45AT_CHECK([../../molecuilder test.conf -e ./ -t -s -b -E -c -b -a -U -T -u], 0, [ignore], [stderr])
     46AT_CHECK([fgrep -c "Not enough or invalid" stderr], 0, [9
    4747], [ignore])
    4848AT_CLEANUP
     
    7575# 4. create the config and check it
    7676AT_CHECK([../../molecuilder test.conf -e ./ -p test.xyz], 0, [ignore], [ignore])
    77 AT_CHECK([fgrep "Ion_Type1_4" test.conf], 0, [Ion_Type1_4       8.532785963     4.787886018     2.645886050     0 # Number in molecule 6
     77AT_CHECK([fgrep "Ion_Type1_4" test.conf], 0, [Ion_Type1_4       8.532785963     4.787886018     2.645886050     0 # molecule nr 6
    7878], [ignore])
    7979AT_CHECK([fgrep "Ion_Type2_4" test.conf], 1, [ignore], [ignore])
Note: See TracChangeset for help on using the changeset viewer.