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
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
);
60
}
61
62
static
TypeTraitsTestSuite
typeTraitsTestSuite
;
63
64
}
// namespace ns3
src
core
test
type-traits-test-suite.cc
Generated on Tue Oct 9 2012 16:45:36 for ns-3 by
1.8.1.2