summaryrefslogtreecommitdiff
path: root/TAO/tests/DynAny_Test/test_wrapper.cpp
blob: a4192374341475a44f5a2e4892f7009ae81ca712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//=============================================================================
/**
 *  @file    test_wrapper.cpp
 *
 *  $Id$
 *
 *  This file contains the implementation of the DynAny basic test manager
 *
 *
 *  @author Jeff Parsons <parsons@cs.wustl.edu>
 */
//=============================================================================


#if !defined (TEST_WRAPPER_CPP)
#define TEST_WRAPPER_CPP

#include "test_wrapper.h"
#include "ace/OS.h"
#include "ace/Log_Msg.h"

// Constructor
template <class T>
Test_Wrapper<T>::Test_Wrapper (T* t)
  : test_object_ (t)
{
}

// Destructor
template <class T>
Test_Wrapper<T>::~Test_Wrapper (void)
{
  delete this->test_object_;
}

template <class T>
int
Test_Wrapper<T>::run_test (void)
{
  const char* test_name = this->test_object_->test_name ();

  ACE_DEBUG ((LM_DEBUG,
              "********************* %s *******************\n\n",
              test_name));

  if (this->test_object_->run_test () == -1)
    {
      ACE_ERROR ((LM_ERROR,
                  "(%N:%l) test_wrapper.cpp - run_test:"
                  "run_test exception in %s",
                  test_name));

      return -1;
    }

  return 0;
}

#endif /* TEST_WRAPPER_CPP */