Commit 5c472566 authored by Blake Nelson's avatar Blake Nelson

*** empty log message ***


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@473 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent b2811dad
FIND_LIBRARY( WIN32_BLAS NAMES blas_win32 PATHS ${CMAKE_SOURCE_DIR}/../ThirdParty
${CMAKE_SOURCE_DIR}/../../ThirdParty)
FIND_LIBRARY( WIN32_LAPACK NAMES lapack_win32 PATHS ${CMAKE_SOURCE_DIR}/../ThirdParty
${CMAKE_SOURCE_DIR}/../../ThirdParty)
GET_FILENAME_COMPONENT(LAPACK_DIR ${WIN32_LAPACK} PATH CACHE)
LINK_DIRECTORIES(${LAPACK_DIR})
IF (WIN32_BLAS)
SET(WIN32_LAPACK_FOUND ON)
ENDIF (WIN32_BLAS)
IF (WIN32_LAPACK_FOUND)
IF (NOT WIN32_LAPACK_FIND_QUIETLY)
MESSAGE(STATUS "Found WIN32 Lapack: ${WIN32_LAPACK}")
ENDIF (NOT WIN32_LAPACK_FIND_QUIETLY)
ELSE(WIN32_LAPACK_FOUND)
IF (WIN32_LAPACK_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Win32 Lapack")
ENDIF (WIN32_LAPACK_FIND_REQUIRED)
ENDIF (WIN32_LAPACK_FOUND)
......@@ -10,6 +10,7 @@ testNekManager.cpp
testNekMatrix.cpp
testNekPoint.cpp
testNekVector.cpp
testNekSharedArray.cpp
Memory/TestNekMemoryManager.cpp
StdRegions/testStdSegExp.cpp
testFoundation/testFoundation.cpp
......@@ -25,6 +26,7 @@ testNekManager.h
testNekMatrix.h
testNekPoint.h
testNekVector.h
testNekSharedArray.h
Memory/TestNekMemoryManager.h
StdRegions/testStdSegExp.h
testFoundation/testFoundation.h
......@@ -33,6 +35,7 @@ testFoundation/testFoundation.h
ADD_DEFINITIONS(-DENABLE_NEKTAR_EXCEPTIONS)
ADD_NEKTAR_EXECUTABLE(UnitTests UnitTestSources UnitTestHeaders)
#ADD_NEKTAR_EXECUTABLE(UnitTests UnitTestSources)
IF( ${CMAKE_COMPILER_IS_GNUCXX} )
......@@ -77,4 +80,8 @@ IF( USE_FRAMEWORK )
TARGET_LINK_LIBRARIES(UnitTests ${FRAMEWORK_LINK_FLAGS})
ENDIF ( USE_FRAMEWORK )
IF( USE_WIN32_LAPACK )
TARGET_LINK_LIBRARIES(UnitTests ${WIN32_LAPACK} ${WIN32_BLAS})
ENDIF( USE_WIN32_LAPACK )
INSTALL(TARGETS UnitTests RUNTIME DESTINATION ${NEKTAR_BIN_DIR})
......@@ -174,15 +174,15 @@ namespace Nektar
{
// Fundamental Types
{
boost::shared_array<int> a = MemoryManager::AllocateSharedArray<10, int>();
SharedArray<int> a = MemoryManager::AllocateSharedArray<10, int>();
boost::shared_array<int> b = MemoryManager::AllocateSharedArray<int>(120);
SharedArray<int> b = MemoryManager::AllocateSharedArray<int>(120);
}
// User Defined types
{
CountedObject<int>::ClearCounters();
boost::shared_array<CountedObject<int> > a = MemoryManager::AllocateSharedArray<10, CountedObject<int> >();
SharedArray<CountedObject<int> > a = MemoryManager::AllocateSharedArray<10, CountedObject<int> >();
BOOST_CHECK_EQUAL(CountedObject<int>::numberDefaultConstructed, 10);
BOOST_CHECK_EQUAL(CountedObject<int>::numberOf1ParameterConstructions, 0);
......@@ -194,7 +194,7 @@ namespace Nektar
BOOST_CHECK_EQUAL(CountedObject<int>::numberDestroyed, 10);
{
boost::shared_array<CountedObject<int> > b = MemoryManager::AllocateSharedArray<CountedObject<int> >(17);
SharedArray<CountedObject<int> > b = MemoryManager::AllocateSharedArray<CountedObject<int> >(17);
BOOST_CHECK_EQUAL(CountedObject<int>::numberDefaultConstructed, 27);
BOOST_CHECK_EQUAL(CountedObject<int>::numberOf1ParameterConstructions, 0);
BOOST_CHECK_EQUAL(CountedObject<int>::numberOf2ParameterConstructions, 0);
......
......@@ -306,27 +306,17 @@ namespace Nektar
}
}
void testDifferentiation()
void testDifferentiation()
{
NekDouble expected_result = -4.0;
for(int i = 0; i < num_BasisTypes; i++)
{
LibUtilities::BasisType btype = TestedBasisTypes[i];
LibUtilities::BasisType btype = TestedBasisTypes[i];
for(int j = 0; j < num_PointsTypes; j++)
{
LibUtilities::PointsType Qtype = TestedPointsTypes[j];
for(int nummodes = 2; nummodes <= max_nummodes; nummodes++)
for(int j = 0; j < num_PointsTypes; j++)
{
for(int nq = 6 ; nq <= max_nq; nq++)
{
const LibUtilities::PointsKey Pkey(nq,Qtype);
const LibUtilities::BasisKey Bkey(btype,nummodes,Pkey);
StdRegions::StdSegExp *E = new StdRegions::StdSegExp(Bkey);
LibUtilities::PointsType Qtype = TestedPointsTypes[j];
NekDoubleSharedArray z = GetDoubleTmpSpace(nq);
NekDoubleSharedArray f = GetDoubleTmpSpace(nq);
......@@ -407,7 +397,7 @@ namespace Nektar
NekDouble exactmatrices[3][6] = {
{-sqrt(2)*2.0/3.0, -sqrt(2.0/3.0)*12.0/7.0, sqrt(0.4)*2.0/3.0, -sqrt(2.0/7.0)*2.0/3.0, 0.0, sqrt(2.0/11.0)*(8.0/21.0)},
{2.0, -2.0, -4.0, 10.0/7.0, 0.0, -12.0/7.0},
{-sqrt(2)*2.0/3.0, -sqrt(2.0/3.0)*12.0/7.0, sqrt(0.4)*2.0/3.0, -sqrt(2.0/7.0)*2.0/3.0, 0.0, sqrt(2.0/11.0)*(8.0/21.0)}
{-sqrt(2.0)*2.0/3.0, -sqrt(2.0/3.0)*12.0/7.0, sqrt(0.4)*2.0/3.0, -sqrt(2.0/7.0)*2.0/3.0, 0.0, sqrt(2.0/11.0)*(8.0/21.0)}
};
int nummodes = 6;
......@@ -616,6 +606,9 @@ namespace Nektar
/**
$Log: testStdSegExp.cpp,v $
Revision 1.7 2007/03/26 11:17:03 pvos
made testStdRegions back working
Revision 1.6 2007/03/20 03:50:28 bnelson
Removed a lot of warning messages.
......
......@@ -20,6 +20,7 @@ using boost::unit_test_framework::test_suite;
#include <UnitTests/testExpressionTemplates.h>
#include <UnitTests/testLinearSystem.h>
#include <UnitTests/testNekLinAlgAlgorithms.h>
#include <UnitTests/testNekSharedArray.h>
#include <UnitTests/testNekManager.h>
......@@ -33,19 +34,26 @@ test_suite* init_unit_test_suite( int, char* [] )
{
test_suite* test= BOOST_TEST_SUITE( "Nektar++ Test Suite" );
// Test Foundation
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussGaussLegendre),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauMLegendre),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauPLegendre),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussLobattoLegendre),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussGaussChebyshev),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauMChebyshev),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauPChebyshev),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussLobattoChebyshev),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauMAlpha0Beta1),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauMAlpha0Beta2),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testPolyEvenlySpaced),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testFourierEvenlySpaced),0);
// shared array
test->add(BOOST_TEST_CASE(&Nektar::SharedArrayUnitTests::testGet), 0);
test->add(BOOST_TEST_CASE(&Nektar::SharedArrayUnitTests::testAccessOperator), 0);
test->add(BOOST_TEST_CASE(&Nektar::SharedArrayUnitTests::testOffset), 0);
test->add(BOOST_TEST_CASE(&Nektar::SharedArrayUnitTests::testConstruction), 0);
test->add(BOOST_TEST_CASE(&Nektar::SharedArrayUnitTests::testAssignment), 0);
// Test Foundation
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussGaussLegendre),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauMLegendre),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauPLegendre),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussLobattoLegendre),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussGaussChebyshev),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauMChebyshev),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauPChebyshev),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussLobattoChebyshev),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauMAlpha0Beta1),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testGaussRadauMAlpha0Beta2),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testPolyEvenlySpaced),0);
test->add(BOOST_TEST_CASE(&Nektar::foundationUnitTests::testFourierEvenlySpaced),0);
// StdSegExp algorithms
test->add(BOOST_TEST_CASE(&Nektar::StdSegExpUnitTests::testMassMatrix), 0);
......@@ -90,6 +98,7 @@ test_suite* init_unit_test_suite( int, char* [] )
test->add(BOOST_TEST_CASE(&Nektar::UnitTests::testBlockMatrices), 0);
test->add(BOOST_TEST_CASE(&Nektar::UnitTests::testBlockDiagonalMatrices), 0);
test->add(BOOST_TEST_CASE(&Nektar::UnitTests::testBlockDiagonalTimesEqual), 0);
test->add(BOOST_TEST_CASE(&Nektar::UnitTests::testNekMatrixTemp), 0);
// These tests were originally added because it appeared that a NekObjectFactory
......@@ -123,11 +132,16 @@ test_suite* init_unit_test_suite( int, char* [] )
/// Linear algebra algorithsm.
test->add(BOOST_TEST_CASE(&Nektar::NekLinAlgTests::testGramSchmidtOrthogonalizationBookExample), 0);
return test;
}
/**
$Log: main.cpp,v $
Revision 1.27 2007/03/26 11:16:12 pvos
made testStdRegions back working
Revision 1.26 2007/03/22 05:31:09 ehan
create testFoundation
......
......@@ -52,7 +52,7 @@ namespace Nektar
unsigned int result_buf[] = { 20, 50, 10 };
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,matrix_buf));
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,3,matrix_buf));
NekVector<unsigned int, 3> b(result_buf);
LinearSystem<NekMatrix<unsigned int, eDiagonal> > linsys(A);
......@@ -70,7 +70,7 @@ namespace Nektar
unsigned int result_buf[] = { 20, 50, 10 };
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,matrix_buf));
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,3,matrix_buf));
boost::shared_ptr<NekVector<unsigned int, 3> > b(new NekVector<unsigned int, 3>(result_buf));
LinearSystem<NekMatrix<unsigned int, eDiagonal> > linsys(A);
......@@ -88,7 +88,7 @@ namespace Nektar
unsigned int result_buf[] = { 20, 50, 10 };
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,matrix_buf));
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,3,matrix_buf));
boost::shared_ptr<NekVector<unsigned int, 3> > b(new NekVector<unsigned int, 3>(result_buf));
boost::shared_ptr<NekVector<unsigned int, 3> > result(new NekVector<unsigned int, 3>());
......@@ -107,7 +107,7 @@ namespace Nektar
unsigned int result_buf[] = { 20, 50, 10 };
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,matrix_buf));
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,3,matrix_buf));
NekVector<unsigned int, 3> b(result_buf);
NekVector<unsigned int, 3> result;
......@@ -126,7 +126,7 @@ namespace Nektar
unsigned int result_buf[] = { 20, 50, 10 };
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,matrix_buf));
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,3,matrix_buf));
boost::shared_ptr<NekVector<unsigned int, 3> > b(new NekVector<unsigned int, 3>(result_buf));
NekVector<unsigned int, 3> result;
......@@ -145,7 +145,7 @@ namespace Nektar
unsigned int result_buf[] = { 20, 50, 10 };
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,matrix_buf));
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,3,matrix_buf));
NekVector<unsigned int, 3> b(result_buf);
boost::shared_ptr<NekVector<unsigned int, 3> > result(new NekVector<unsigned int, 3>());
......@@ -166,7 +166,7 @@ namespace Nektar
unsigned int result_buf[] = { 20, 50, 10 };
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,matrix_buf));
boost::shared_ptr<NekMatrix<unsigned int, eDiagonal> > A(new NekMatrix<unsigned int, eDiagonal>(3,3,matrix_buf));
boost::shared_ptr<NekVector<unsigned int, 3> > b(new NekVector<unsigned int, 3>(result_buf));
LinearSystem<NekMatrix<unsigned int, eDiagonal> > linsys(A);
......
......@@ -324,7 +324,7 @@ namespace Nektar
NekMatrix<unsigned int> full(3, 3, fullValues);
unsigned int diagonalValues[] = {6, 12, 5};
NekMatrix<unsigned int, eDiagonal> diag(3, diagonalValues);
NekMatrix<unsigned int, eDiagonal> diag(3, 3, diagonalValues);
NekMatrix<unsigned int> result1 = full+diag;
NekMatrix<unsigned int> result2 = diag+full;
......@@ -680,12 +680,21 @@ namespace Nektar
// BlockMatrix m1(3, 3, rowSizes, columnSizes);
}
void testNekMatrixTemp()
{
//NekMatrixTemp<double> m1(1,2);
//NekMatrixTemp<double, eFull, eBlock> m2(1,2);
}
}
}
/**
$Log: testNekMatrix.cpp,v $
Revision 1.21 2007/02/13 02:47:23 bnelson
*** empty log message ***
Revision 1.20 2007/01/18 20:59:28 sherwin
Before new configuration
......
......@@ -50,7 +50,7 @@ namespace Nektar
void testBlockMatrices();
void testBlockDiagonalMatrices();
void testBlockDiagonalTimesEqual();
void testNekMatrixTemp();
}
}
......@@ -59,6 +59,9 @@ namespace Nektar
/**
$Log: testNekMatrix.h,v $
Revision 1.7 2006/10/30 05:08:14 bnelson
Added preliminary linear system and block matrix support.
Revision 1.6 2006/09/30 15:38:29 bnelson
no message
......
///////////////////////////////////////////////////////////////////////////////
//
// File: testNekSharedArray.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: Test code for Nektar::shared_array
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_UNIT_TESTS_SHARED_ARRAY_HPP
#define NEKTAR_UNIT_TESTS_SHARED_ARRAY_HPP
#include <UnitTests/testNekSharedArray.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <UnitTests/CountedObject.h>
#include <boost/test/unit_test.hpp>
#include <boost/test/test_tools.hpp>
namespace Nektar
{
namespace SharedArrayUnitTests
{
SharedArray<double> testFunc1()
{
SharedArray<double> result(new double[10], 10);
return result;
}
class TestClass
{
public:
TestClass() : result(new double[10], 10) {}
SharedArray<double> foo() { return result; }
const SharedArray<double>& bar() const { return result; }
private:
SharedArray<double> result;
};
// Nothing really runs here - it just checks valid compilation. The commented out
// lines should not compile.
void testGet()
{
Nektar::SharedArray<double> d1(new double[10], 10);
const Nektar::SharedArray<double> d2(new double[10], 10);
const Nektar::SharedArray<double>& d3 = d1;
double* a1 = d1.get();
const double* a2 = d1.get();
//double* a3 = d2.get();
const double* a4 = d2.get();
//double* a5 = d3.get();
const double* a6 = d3.get();
//Nektar::SharedArray<double> d4(d2);
//d4[0] = 2.7;
const Nektar::SharedArray<double> d5(d1);
//d5 = d3;
//d5[0] = 3.4;
Nektar::SharedArray<double> d6;
d6 = d1;
Nektar::SharedArray<double> d7 = testFunc1();
TestClass t;
Nektar::SharedArray<double> d8 = t.foo();
//Nektar::SharedArray<double> d9 = t.bar();
const Nektar::SharedArray<double>& d9 = t.bar();
}
void testAccessOperator()
{
Nektar::SharedArray<double> d1(new double[10], 10);
const Nektar::SharedArray<double> d2(new double[10], 10);
const Nektar::SharedArray<double>& d3 = d1;
double& a1 = d1[0];
const double& a2 = d1[0];
//double& a3 = d2[0];
const double& a4 = d2[0];
//double& a5 = d3[0];
const double& a6 = d3[0];
}
void testOffset()
{
Nektar::SharedArray<double> d1(new double[10], 10);
for(unsigned int i = 0; i < 10; ++i)
{
d1[i] = (double)i + .7;
}
Nektar::SharedArray<double> d2 = d1 + 5;
BOOST_CHECK_EQUAL(d1[5], d2[0]);
const Nektar::SharedArray<double>& d3 = d2;
//Nektar::SharedArray<double> d4 = d3 + 2;
}
class TestReference
{
public:
TestReference() : obj(new double[10], 10) {}
const SharedArray<double>& foo() const { return obj; }
SharedArray<double> obj;
};
void testConstruction()
{
{
CountedObject<double>::ClearCounters();
SharedArray<CountedObject<double> > non_const_array =
MemoryManager::AllocateSharedArray<CountedObject<double> >(10);
const SharedArray<CountedObject<double> > const_array =
MemoryManager::AllocateSharedArray<CountedObject<double> >(10);
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 0);
{
SharedArray<CountedObject<double> > a1(non_const_array);
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 0);
}
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 0);
{
SharedArray<CountedObject<double> > a2(const_array);
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 0);
}
// 10 should be destroyed from the copy of the const_array.
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 10);
{
const SharedArray<CountedObject<double> > a1(non_const_array);
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 10);
}
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 10);
{
const SharedArray<CountedObject<double> > a2(const_array);
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 10);
}
// TODO - Ideally we could detect that a const object is being
// created and avoid the copy.
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 20);
}
}
void testAssignment()
{
{
CountedObject<double>::ClearCounters();
SharedArray<CountedObject<double> > non_const_array =
MemoryManager::AllocateSharedArray<CountedObject<double> >(10);
const SharedArray<CountedObject<double> > const_array =
MemoryManager::AllocateSharedArray<CountedObject<double> >(10);
{
SharedArray<CountedObject<double> > a1;
a1 = non_const_array;
//a1 = const_array;
}
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 0);
{
SharedArray<CountedObject<double> > a2;
a2.Assign(const_array);
}
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 10);
{
const SharedArray<CountedObject<double> > a2;
//a2 = SharedArray<CountedObject<double> >(non_const_array);
}
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 10);
{
const SharedArray<CountedObject<double> > a3;
//a3 = SharedArray<CountedObject<double> >(const_array);
}
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 10);
}
BOOST_CHECK_EQUAL(CountedObject<double>::numberDestroyed, 30);
}
}
}
#endif //NEKTAR_UNIT_TESTS_SHARED_ARRAY_HPP
///////////////////////////////////////////////////////////////////////////////
//
// File: testNekSharedArray.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: Test code for Nektar::shared_array
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_UNIT_TESTS_SHARED_ARRAY_HPP
#define NEKTAR_UNIT_TESTS_SHARED_ARRAY_HPP
namespace Nektar
{
namespace SharedArrayUnitTests
{
void testGet();
void testAccessOperator();
void testOffset();
void testConstruction();
void testAssignment();
}
}
#endif //NEKTAR_UNIT_TESTS_SHARED_ARRAY_HPP
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