Commit f66c62fa authored by Blake Nelson's avatar Blake Nelson

Added tests for boost utilities.


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@12 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent a694ae2a
......@@ -50,7 +50,8 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_NekUnitTests_OBJECTS = NekUnitTests-main.$(OBJEXT) \
NekUnitTests-testNekPoint.$(OBJEXT) \
NekUnitTests-testNekVector.$(OBJEXT)
NekUnitTests-testNekVector.$(OBJEXT) \
NekUnitTests-testBoostUtil.$(OBJEXT)
NekUnitTests_OBJECTS = $(am_NekUnitTests_OBJECTS)
NekUnitTests_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir)
......@@ -139,7 +140,7 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
NekUnitTests_SOURCES = main.cpp testNekPoint.cpp testNekVector.cpp
NekUnitTests_SOURCES = main.cpp testNekPoint.cpp testNekVector.cpp testBoostUtil.cpp
NekUnitTests_CPPFLAGS = -I$(srcdir)/.. -I$(srcdir)/../../ThirdParty/boost_1_33_0
all: all-am
......@@ -208,6 +209,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NekUnitTests-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NekUnitTests-testBoostUtil.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NekUnitTests-testNekPoint.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NekUnitTests-testNekVector.Po@am__quote@
......@@ -266,6 +268,20 @@ NekUnitTests-testNekVector.obj: testNekVector.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='testNekVector.cpp' object='NekUnitTests-testNekVector.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NekUnitTests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NekUnitTests-testNekVector.obj `if test -f 'testNekVector.cpp'; then $(CYGPATH_W) 'testNekVector.cpp'; else $(CYGPATH_W) '$(srcdir)/testNekVector.cpp'; fi`
NekUnitTests-testBoostUtil.o: testBoostUtil.cpp
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NekUnitTests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NekUnitTests-testBoostUtil.o -MD -MP -MF "$(DEPDIR)/NekUnitTests-testBoostUtil.Tpo" -c -o NekUnitTests-testBoostUtil.o `test -f 'testBoostUtil.cpp' || echo '$(srcdir)/'`testBoostUtil.cpp; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/NekUnitTests-testBoostUtil.Tpo" "$(DEPDIR)/NekUnitTests-testBoostUtil.Po"; else rm -f "$(DEPDIR)/NekUnitTests-testBoostUtil.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='testBoostUtil.cpp' object='NekUnitTests-testBoostUtil.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NekUnitTests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NekUnitTests-testBoostUtil.o `test -f 'testBoostUtil.cpp' || echo '$(srcdir)/'`testBoostUtil.cpp
NekUnitTests-testBoostUtil.obj: testBoostUtil.cpp
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NekUnitTests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NekUnitTests-testBoostUtil.obj -MD -MP -MF "$(DEPDIR)/NekUnitTests-testBoostUtil.Tpo" -c -o NekUnitTests-testBoostUtil.obj `if test -f 'testBoostUtil.cpp'; then $(CYGPATH_W) 'testBoostUtil.cpp'; else $(CYGPATH_W) '$(srcdir)/testBoostUtil.cpp'; fi`; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/NekUnitTests-testBoostUtil.Tpo" "$(DEPDIR)/NekUnitTests-testBoostUtil.Po"; else rm -f "$(DEPDIR)/NekUnitTests-testBoostUtil.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='testBoostUtil.cpp' object='NekUnitTests-testBoostUtil.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(NekUnitTests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NekUnitTests-testBoostUtil.obj `if test -f 'testBoostUtil.cpp'; then $(CYGPATH_W) 'testBoostUtil.cpp'; else $(CYGPATH_W) '$(srcdir)/testBoostUtil.cpp'; fi`
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
......
......@@ -15,6 +15,7 @@ using boost::unit_test_framework::test_suite;
#include <UnitTests/testNekPoint.h>
#include <UnitTests/testNekVector.h>
#include <UnitTests/testBoostUtil.h>
// The boost unit test framework provides the main function for us.
// All we need to do is provide a test suite.
......@@ -30,11 +31,17 @@ test_suite* init_unit_test_suite( int, char* [] )
test->add(BOOST_TEST_CASE(&Nektar::UnitTests::testNekVectorOperators), 0);
test->add(BOOST_TEST_CASE(&Nektar::UnitTests::testNekVectorArithmetic), 0);
test->add(BOOST_TEST_CASE(&Nektar::UnitTests::testMakePtr), 0);
return test;
}
/**
$Log: main.cpp,v $
Revision 1.1 2006/05/04 18:59:55 kirby
*** empty log message ***
Revision 1.2 2006/04/11 02:02:13 bnelson
Added more tests.
......
///////////////////////////////////////////////////////////////////////////////
//
// File: testBoostUtil.cpp
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Tests the boost utility functions.
//
///////////////////////////////////////////////////////////////////////////////
#include <UnitTests/testBoostUtil.h>
#include <LibUtilities/BoostUtil.hpp>
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_case_template.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/progress.hpp>
namespace Nektar
{
namespace UnitTests
{
class TestClass
{
public:
TestClass()
{
++constructionCount;
}
~TestClass()
{
++destructionCount;
}
static unsigned int constructionCount;
static unsigned int destructionCount;
};
unsigned int TestClass::constructionCount = 0;
unsigned int TestClass::destructionCount = 0;
void testMakePtr()
{
using namespace Nektar::LibUtilities;
{
boost::shared_ptr<TestClass> p = MakePtr(new TestClass());
BOOST_CHECK(TestClass::constructionCount == 1);
BOOST_CHECK(TestClass::destructionCount == 0);
}
BOOST_CHECK(TestClass::constructionCount == 1);
BOOST_CHECK(TestClass::destructionCount == 1);
}
}
}
///////////////////////////////////////////////////////////////////////////////
//
// File: testBoostUtil.h
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Tests the boost utility functions.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_UNIT_TESTS_TEST_BOOST_UTIL_H
#define NEKTAR_UNIT_TESTS_TEST_BOOST_UTIL_H
namespace Nektar
{
namespace UnitTests
{
void testMakePtr();
}
}
#endif // NEKTAR_UNIT_TESTS_TEST_BOOST_UTIL_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment