Skip to content
Snippets Groups Projects
Commit fb609186 authored by Jorrit Fahlke's avatar Jorrit Fahlke
Browse files

[shared_ptrtest] Test the configured shared_ptr class as well as Dunes

replacement implementation.

[[Imported from SVN: r6319]]
parent 352c7f9c
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,8 @@ TESTPROGS = \
paramtreetest \
polyallocator \
poolallocatortest \
shared_ptrtest \
shared_ptrtest_config \
shared_ptrtest_dune \
singletontest \
smallobject \
static_assert_test \
......@@ -103,7 +104,11 @@ test_stack_SOURCES = test-stack.cc
arraylisttest_SOURCES = arraylisttest.cc
shared_ptrtest_SOURCES = shared_ptrtest.cc
shared_ptrtest_config_SOURCES = shared_ptrtest.cc
shared_ptrtest_dune_SOURCES = shared_ptrtest.cc
shared_ptrtest_dune_CPPFLAGS = $(AM_CPPFLAGS) \
-DDISABLE_CONFIGURED_SHARED_PTR
tuplestest_dune_SOURCES = tuplestest.cc
tuplestest_dune_CPPFLAGS = $(AM_CPPFLAGS) \
......
......@@ -7,12 +7,18 @@
#include "config.h"
#endif
#if defined(DISABLE_CONFIGURED_SHARED_PTR) && defined(SHARED_PTR_NAMESPACE)
#undef SHARED_PTR_NAMESPACE
#endif
#include <dune/common/classname.hh>
#include <dune/common/shared_ptr.hh>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <ostream>
#include <vector>
#include <cstdlib>
template<class T>
class Deleter
......@@ -43,6 +49,11 @@ int main(){
// test default constructor
shared_ptr<int> foo;
// print the type of the shared_ptr, so we know whether we are
// checking dune's shared_ptr or some std one
std::cout << "=== checking shared_ptr type: " << className(foo)
<< std::endl;
// test cast-to-bool
if (foo) {
std::cout << "Default constructor doesn't create a NULL pointer!" << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment