Adobe Source Libraries
1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
check_regular.hpp
Go to the documentation of this file.
1
/*
2
Copyright 2013 Adobe
3
Distributed under the Boost Software License, Version 1.0.
4
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
*/
6
/**************************************************************************************************/
7
8
#include <
adobe/config.hpp
>
9
#include <adobe/implementation/swap.hpp>
10
#include <boost/test/unit_test.hpp>
11
12
namespace
adobe
{
17
18
template
<
typename
T>
19
T
arbitrary_regular_value
();
20
21
22
template
<
typename
T>
23
void
check_regular
(
const
T& x) {
24
using
std::swap
;
25
26
BOOST_CHECK(x != T());
27
T y = x;
28
BOOST_CHECK_MESSAGE(x == y,
"copy-ctor"
);
29
T z = T();
30
BOOST_CHECK_MESSAGE(z != x,
"default-ctor"
);
31
z = y;
32
BOOST_CHECK_MESSAGE(x == z,
"assignment"
);
33
T w = T();
34
swap
(y, w);
35
BOOST_CHECK(x == w && x != y && y == T());
36
}
37
38
39
BOOST_TEST_CASE_TEMPLATE_FUNCTION
(check_regulars, T) {
40
check_regular
(
arbitrary_regular_value<T>
());
41
}
42
44
}
// namespace adobe
config.hpp
adobe::BOOST_TEST_CASE_TEMPLATE_FUNCTION
BOOST_TEST_CASE_TEMPLATE_FUNCTION(check_regulars, T)
Definition
check_regular.hpp:39
adobe::arbitrary_regular_value
T arbitrary_regular_value()
adobe::check_regular
void check_regular(const T &x)
Definition
check_regular.hpp:23
adobe::version_1::swap
void swap(any_regular_t &x, any_regular_t &y)
Definition
any_regular.hpp:586
adobe
Definition
class_template.hpp:7
std::swap
void swap(adobe::extents_t::slice_t &x, adobe::extents_t::slice_t &y) BOOST_NOEXCEPT
Definition
extents.hpp:120
adobe
test
check_regular.hpp
Generated by
1.14.0