Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
ee94add5
Commit
ee94add5
authored
Sep 22, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more tests for DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST and also fixed unit
tests so they work on older versions of visual studio.
parent
282db240
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
is_same_object.cpp
dlib/test/is_same_object.cpp
+17
-0
No files found.
dlib/test/is_same_object.cpp
View file @
ee94add5
...
...
@@ -14,14 +14,20 @@ namespace
dlib
::
logger
dlog
(
"test.is_same_object"
);
DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST
(
has_booya_template
,
void
,
template
booya
<
int
>
,
(
std
::
string
)
const
);
DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST
(
has_booya2_template
,
void
,
template
booya2
<
int
>
,
(
int
)
const
);
DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST
(
has_funct_int
,
void
,
funct
,
(
int
));
DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST
(
has_funct_double
,
void
,
funct
,
(
double
));
DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST
(
has_funct_f
,
float
,
funct_f
,
(
int
));
class
htest
{
public
:
template
<
typename
EXP
>
void
booya
(
std
::
string
)
const
{}
template
<
typename
EXP
>
void
booya2
(
EXP
)
const
{}
void
funct
(
double
)
{}
};
...
...
@@ -30,17 +36,28 @@ namespace
public
:
void
funct
(
int
)
{}
float
funct_f
(
int
)
{}
};
void
test_metaprog
()
{
DLIB_TEST
(
has_booya2_template
<
htest
>::
value
==
true
)
DLIB_TEST
(
has_booya2_template
<
htest2
>::
value
==
false
)
#if _MSC_VER > 1600 // there is a bug in visual studio 2010 and older that prevents this test from working
DLIB_TEST
(
has_booya_template
<
htest
>::
value
==
true
)
#endif
DLIB_TEST
(
has_booya_template
<
htest2
>::
value
==
false
)
DLIB_TEST
(
has_funct_int
<
htest
>::
value
==
false
)
DLIB_TEST
(
has_funct_int
<
htest2
>::
value
==
true
)
DLIB_TEST
(
has_funct_double
<
htest
>::
value
==
true
)
DLIB_TEST
(
has_funct_double
<
htest2
>::
value
==
false
)
DLIB_TEST
(
has_funct_f
<
htest
>::
value
==
false
)
DLIB_TEST
(
has_funct_f
<
htest2
>::
value
==
true
)
}
class
is_same_object_tester
:
public
tester
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment