A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
type-traits-test-suite.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 University of Washington
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#include "ns3/type-traits.h"
20
#include "ns3/test.h"
21
22
using namespace
ns3;
23
24
class
TypeTraitsTestCase
:
public
TestCase
25
{
26
public
:
27
TypeTraitsTestCase
();
28
virtual
~TypeTraitsTestCase
() {}
29
30
private
:
31
virtual
void
DoRun (
void
);
32
};
33
34
TypeTraitsTestCase::TypeTraitsTestCase
(
void
)
35
:
TestCase
(
"Check type traits"
)
36
{
37
}
38
39
void
40
TypeTraitsTestCase::DoRun
(
void
)
41
{
42
NS_TEST_ASSERT_MSG_EQ
(
TypeTraits
<
void
(
TypeTraitsTestCase
::*) (
void
)>::IsPointerToMember, 1,
"Check"
);
43
NS_TEST_ASSERT_MSG_EQ
(
TypeTraits
<
void
(
TypeTraitsTestCase
::*) (
void
)
const
>::IsPointerToMember, 1,
"Check"
);
44
NS_TEST_ASSERT_MSG_EQ
(
TypeTraits
<
void
(
TypeTraitsTestCase
::*) (
int
)>::IsPointerToMember, 1,
"Check"
);
45
NS_TEST_ASSERT_MSG_EQ
(
TypeTraits
<
void
(
TypeTraitsTestCase
::*) (
int
)
const
>::IsPointerToMember, 1,
"Check"
);
46
NS_TEST_ASSERT_MSG_EQ
(
TypeTraits
<
void
(
TypeTraitsTestCase
::*) (
void
)
const
>::PointerToMemberTraits::nArgs, 0,
"Check"
);
47
NS_TEST_ASSERT_MSG_EQ
(
TypeTraits
<
void
(
TypeTraitsTestCase
::*) (
int
)
const
>::PointerToMemberTraits::nArgs, 1,
"Check"
);
48
}
49
50
class
TypeTraitsTestSuite
:
public
TestSuite
51
{
52
public
:
53
TypeTraitsTestSuite
();
54
};
55
56
TypeTraitsTestSuite::TypeTraitsTestSuite
()
57
:
TestSuite
(
"type-traits"
, UNIT)
58
{
59
AddTestCase
(
new
TypeTraitsTestCase
, TestCase::QUICK);
60
}
61
62
static
TypeTraitsTestSuite
typeTraitsTestSuite
;
ns3::TestSuite
A suite of tests to run.
Definition:
test.h:1025
TypeTraitsTestCase
Definition:
type-traits-test-suite.cc:24
typeTraitsTestSuite
static TypeTraitsTestSuite typeTraitsTestSuite
Definition:
type-traits-test-suite.cc:62
ns3::TestCase
encapsulates test code
Definition:
test.h:849
TypeTraitsTestCase::TypeTraitsTestCase
TypeTraitsTestCase()
Definition:
type-traits-test-suite.cc:34
TypeTraitsTestSuite::TypeTraitsTestSuite
TypeTraitsTestSuite()
Definition:
type-traits-test-suite.cc:56
ns3::TestCase::AddTestCase
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
Definition:
test.cc:173
TypeTraits
Type trait reference values.
Definition:
type-traits.h:6
TypeTraitsTestCase::DoRun
virtual void DoRun(void)
Implementation to actually run this TestCase.
Definition:
type-traits-test-suite.cc:40
TypeTraitsTestCase::~TypeTraitsTestCase
virtual ~TypeTraitsTestCase()
Definition:
type-traits-test-suite.cc:28
TypeTraitsTestSuite
Definition:
type-traits-test-suite.cc:50
NS_TEST_ASSERT_MSG_EQ
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition:
test.h:137
src
core
test
type-traits-test-suite.cc
Generated on Sat Apr 19 2014 14:06:53 for ns-3 by
1.8.6