Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
ee94add5
Commit
ee94add5
authored
Sep 21, 2013
by
Davis King
Browse files
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
dlib/test/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
...
@@ -14,14 +14,20 @@ namespace
dlib
::
logger
dlog
(
"test.is_same_object"
);
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_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_int
,
void
,
funct
,
(
int
));
DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST
(
has_funct_double
,
void
,
funct
,
(
double
));
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
class
htest
{
{
public:
public:
template
<
typename
EXP
>
template
<
typename
EXP
>
void
booya
(
std
::
string
)
const
{}
void
booya
(
std
::
string
)
const
{}
template
<
typename
EXP
>
void
booya2
(
EXP
)
const
{}
void
funct
(
double
)
{}
void
funct
(
double
)
{}
};
};
...
@@ -30,17 +36,28 @@ namespace
...
@@ -30,17 +36,28 @@ namespace
public:
public:
void
funct
(
int
)
{}
void
funct
(
int
)
{}
float
funct_f
(
int
)
{}
};
};
void
test_metaprog
()
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
)
DLIB_TEST
(
has_booya_template
<
htest
>::
value
==
true
)
#endif
DLIB_TEST
(
has_booya_template
<
htest2
>::
value
==
false
)
DLIB_TEST
(
has_booya_template
<
htest2
>::
value
==
false
)
DLIB_TEST
(
has_funct_int
<
htest
>::
value
==
false
)
DLIB_TEST
(
has_funct_int
<
htest
>::
value
==
false
)
DLIB_TEST
(
has_funct_int
<
htest2
>::
value
==
true
)
DLIB_TEST
(
has_funct_int
<
htest2
>::
value
==
true
)
DLIB_TEST
(
has_funct_double
<
htest
>::
value
==
true
)
DLIB_TEST
(
has_funct_double
<
htest
>::
value
==
true
)
DLIB_TEST
(
has_funct_double
<
htest2
>::
value
==
false
)
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
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