Skip to main content

Deprecated

Definitions kept for compatibility with earlier releases. More...

Topics Index​

 Operators

Deprecated overloaded operators for test comparisons. More...

 Old logical function names

Deprecated v5.0.1 names of the logical functions. More...

 Literals and wrappers

Deprecated literal operators and wrappers for typed operands. More...

Namespaces Index​

namespacetype_traits

Deprecated v5.0.1 namespace of the concepts and of the value wrapper templates. More...

Classes Index​

structfunction_traits<T>

Deprecated traits of the callable objects. More...

structfunction_traits<R(*)(Args_T...)>

Deprecated traits of the function pointers. More...

structfunction_traits<R(Args_T...)>

Deprecated traits of the function types. More...

structfunction_traits<R(T::*)(Args_T...) const>

Deprecated traits of the pointers to const member functions. More...

structfunction_traits<R(T::*)(Args_T...)>

Deprecated traits of the pointers to member functions. More...

structidentity<T, Extra>

Deprecated identity type. More...

structlist<Types>

Deprecated empty type list. More...

classtimestamp

Deprecated clock reading. More...

Concepts Index​

concepthas_epsilon

Deprecated concept satisfied when T is a framework floating-point wrapper with a tolerance. More...

concepthas_npos

Deprecated concept satisfied when T provides a npos member. More...

concepthas_value

Deprecated concept satisfied when T has a member named value. More...

conceptis_floating_point

Deprecated concept satisfied when T is a floating-point type. More...

Typedefs Index​

template <class T>
usinggenuine_integral_value = detail::value< T >

Deprecated integral value wrapper. More...

usingrunner_totals = counters

Deprecated name of counters. More...

usingstatic_runner = runner

Deprecated name of runner. More...

usingsubtest = test_case

Deprecated name of test_case. More...

usingtimestamps = stopwatch

Deprecated name of stopwatch. More...

template <class T>
usingvalue_base_ = detail::value_base< T >

Deprecated name of detail::value_base. More...

Functions Index​

const char *short_name (const char *name) noexcept

Deprecated extraction of the file name from a path. More...

template <class Lhs_T, class Rhs_T>
constexpr boolwithin_tolerance (const Lhs_T &lhs, const Rhs_T &rhs)

Deprecated check whether two operands are equal within the tolerance of the floating-point wrappers. More...

Variables Index​

static constexpr boolwithin_tolerance_result = true

Deprecated result when the operands are within the tolerance. More...

static constexpr boolwithin_tolerance_result = false

Deprecated result when the operands are within the tolerance. More...

static constexpr boolwithin_tolerance_result = true

Deprecated result when the operands are within the tolerance. More...

static constexpr boolwithin_tolerance_result = false

Deprecated result when the operands are within the tolerance. More...

static constexpr boolwithin_tolerance_result = true

Deprecated result when the operands are within the tolerance. More...

static constexpr boolwithin_tolerance_result = false

Deprecated result when the operands are within the tolerance. More...

Deprecated Functions Index​

template <class T>
constexpr T &mut (const T &t) noexcept

Deprecated generic mutator to remove const qualification from a reference. More...

Description​

Definitions kept for compatibility with earlier releases.

The deprecated definitions are kept so that the tests written for the earlier releases still compile; they will be removed in a future major release. The compiler reports each use, with a message that names the replacement and the version that deprecated it (most of them since 6.0.0).

Availability

The deprecated definitions exist only when the application defines the macro MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED (see Configuration). Without it, the tests that still use them do not compile, which shows what remains to be migrated.

Migration

Build once with the macro defined and the deprecation warnings enabled, and rewrite each reported use as its message suggests. While migrating, the applications that build with -Werror can disable the warnings temporarily with -Wno-deprecated-declarations.

 
 // Deprecated.
 using namespace mt::operators;
 using namespace mt::literals;
 t.expect (compute_answer () == 42_i) << "answer is 42";
 
 // Replacement.
 t.expect (mt::eq (compute_answer (), 42)) << "answer is 42";
Deprecated groups

Three groups of deprecated definitions have topics of their own:

  • the overloaded comparison and logical operators (see Operators), replaced by the function comparators and the logical functions;
  • the user-defined literals and the value wrappers (see Literals and wrappers), replaced by the plain values passed to the function comparators;
  • the logical functions _and(), _or(), and _not() (see Old logical function names), replaced by all_of(), any_of(), and negate().
Other deprecated definitions
  • the v5.0.1 names of the classes: static_runner (replaced by runner), subtest (replaced by test_case), detail::runner_totals (replaced by counters), and detail::timestamps and detail::timestamp, which are internal and not replaced;
  • runner (const char*), replaced by runner() followed by add_top_suite() (since 4.1.0);
  • runner::initialise (argc, argv, top_suite_name), replaced by initialise (argc, argv) followed by add_top_suite();
  • runner::exit_code(), replaced by runner::run_suites();
  • runner::suite(), replaced by runner::add_suite();
  • runner::suites_count(), replaced by added_suites_count() or total_suites_count();
  • runner::verbosity(), and runner::reporter() with its verbosity() member, replaced by runner::verbosity_level();
  • runner::timings() and suite::timings(), and the members of detail::stopwatch kept from the v5.0.1 timestamps, which are internal and not replaced;
  • the counters members successful_checks(), executed_subtests(), and was_successful(), replaced by passed_checks(), executed_test_cases(), and passed() (the deprecated mutators increment_successful_checks() and increment_executed_subtests() were removed, since the counters are updated only by the framework);
  • test_case::assume(), replaced by test_case::require();
  • the overloads of test_case::expect() and test_case::require() that accept an argument that is always true (a string literal or a function name), replaced by writing the condition;
  • the static_suite constructor whose callable takes a static_suite&, replaced by a callable taking a suite&;
  • mut(), replaced by const_cast<T&>;
  • runner::name(), which always returned "runner", not replaced: the names in the reports are those of the suites (see add_top_suite());
  • detail::expression_formatter::c_str() and empty(), replaced by str().c_str() and str().empty();
  • the members children_subtests_count(), current_subtest_index(), and own_index() of the test nodes, which are internal and not replaced;
  • extension::has_epsilon, the concept that detects the floating-point wrappers with a tolerance, to be removed with them;
  • reflection::short_name(), replaced by utility::extract_file_name();
  • the type_traits namespace, with the concepts and the value wrapper templates of v5.0.1, replaced by the extension namespace;
  • the traits of the type_traits namespace: function_traits and list, which are not replaced, and identity, replaced by std::type_identity.

Typedefs​

genuine_integral_value​

template <class T>
using micro_os_plus::micro_test_plus::type_traits::genuine_integral_value = detail::value<T>

Deprecated integral value wrapper.

Template Parameters
T

The integral type of the stored value.

In v5.0.1, a separate wrapper with the same members as value<T>, never created by the framework; now value<T>, so the values are compared and reported in the same way.

Deprecated

the value wrappers are internal (since 6.0.0)

Definition at line 2823 of file deprecated.h.

runner_totals​

using micro_os_plus::micro_test_plus::detail::runner_totals = counters

Deprecated name of counters.

The v5.0.1 name of the class returned by totals(), renamed since the suites and the test cases own one too, not only the runner.

Deprecated

use counters (since 6.0.0)

Definition at line 2295 of file deprecated.h.

static_runner​

using micro_os_plus::micro_test_plus::static_runner = runner

Deprecated name of runner.

The runner also runs the static_suite objects that refer to it, so a separate runner class is no longer needed.

Deprecated

use runner (since 6.0.0)

Definition at line 2250 of file deprecated.h.

subtest​

using micro_os_plus::micro_test_plus::subtest = test_case

Deprecated name of test_case.

The v5.0.1 name of the class passed to the test case bodies, kept for the functions and the lambdas that name it as the type of their first parameter (void f (mt::subtest& t)); the lambdas with an auto& parameter are not affected.

Deprecated

use test_case (since 6.0.0)

Definition at line 2237 of file deprecated.h.

timestamps​

using micro_os_plus::micro_test_plus::detail::timestamps = stopwatch

Deprecated name of stopwatch.

The v5.0.1 name of the class returned by the timings() functions of the runner and of the suites, which kept the two timestamps of the measured interval. Its public members are kept, on stopwatch; its protected members, the two optional timestamp objects, are not. The timings are internal; the elapsed times are shown by the reporters.

Deprecated

the timings are internal (since 6.0.0)

Definition at line 2312 of file deprecated.h.

value_base_​

template <class T>
using micro_os_plus::micro_test_plus::type_traits::value_base_ = detail::value_base<T>

Deprecated name of detail::value_base.

Template Parameters
T

The type of the stored value.

The v5.0.1 name, with a trailing underscore. The stored value is now private, and get() returns a reference; the value is read with get() or with the explicit conversion, not through the v5.0.1 public member value_.

Deprecated

the value wrappers are internal (since 6.0.0)

Definition at line 2807 of file deprecated.h.

Functions​

short_name()​

const char * micro_os_plus::micro_test_plus::reflection::short_name (const char * name)
nodiscard noexcept

Deprecated extraction of the file name from a path.

Forwards to utility::extract_file_name(), which the framework uses internally; it is kept only for compatibility with the existing applications.

Parameters
name

The path, as a C-string.

Returns

A pointer to the file name within the input string, after the last / or backslash separator, or the string itself if there is no separator.

Delegates to utility::extract_file_name(), the single implementation used by the framework, so both the / and the backslash separators are recognised. If no separator is present, the original input string is returned.

Definition at line 78 of file deprecated.cpp.

78 short_name (const char* name) noexcept
79 {
80 return utility::extract_file_name (name);
81 }

References micro_os_plus::micro_test_plus::utility::extract_file_name and micro_os_plus::micro_test_plus::reflection::short_name.

Referenced by micro_os_plus::micro_test_plus::reflection::short_name.

within_tolerance()​

template <class Lhs_T, class Rhs_T>
bool micro_os_plus::micro_test_plus::detail::within_tolerance (const Lhs_T & lhs, const Rhs_T & rhs)
nodiscard constexpr

Deprecated check whether two operands are equal within the tolerance of the floating-point wrappers.

Used by compare_op for all six tags, so that a value within the tolerance is equal, and neither less nor greater; at least one operand must have an epsilon member (a floating-point literal, a to_f, to_d, or to_ld wrapper, or approx()).

Used only by the deprecated floating-point wrappers, it is available only when MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED is defined.

Deprecated

to be removed with the deprecated floating-point wrappers (since 6.0.0)

Template Parameters
Lhs_T

The type of the left-hand operand.

Rhs_T

The type of the right-hand operand.

Parameters
lhs

The left-hand operand.

rhs

The right-hand operand.

Return Values
true

The absolute difference is less than the tolerance (the smaller one, if both operands have one).

false

Otherwise.

The tolerance is the smaller epsilon of the two operands, if both have one, otherwise the epsilon of the operand that has one. The operands are equal when the absolute value of their difference is less than the tolerance.

Definition at line 212 of file detail-inlines.h.

212 within_tolerance (const Lhs_T& lhs, const Rhs_T& rhs)
213 {
214#if defined(__GNUC__)
215#pragma GCC diagnostic push
216#pragma GCC diagnostic ignored "-Wfloat-equal"
217#pragma GCC diagnostic ignored "-Wconversion"
218#pragma GCC diagnostic ignored "-Wdouble-promotion"
219#pragma GCC diagnostic ignored "-Wsign-compare"
220#if defined(__clang__)
221#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
222#pragma clang diagnostic ignored "-Wpedantic"
223#endif // defined(__clang__)
224#endif // defined(__GNUC__)
225 const auto difference
226 = math::abs (detail::unwrap (lhs) - detail::unwrap (rhs));
229 {
230 // If both values have precision, use the smallest one.
231 return difference < math::min_value (lhs.epsilon, rhs.epsilon);
232 }
233 else if constexpr (extension::has_epsilon<Lhs_T>)
234 {
235 return difference < lhs.epsilon;
236 }
237 else
238 {
239 return difference < rhs.epsilon;
240 }
241#if defined(__GNUC__)
242#pragma GCC diagnostic pop
243#endif // defined(__GNUC__)
244 }

References micro_os_plus::micro_test_plus::detail::math::abs, micro_os_plus::micro_test_plus::detail::math::min_value, micro_os_plus::micro_test_plus::detail::unwrap and micro_os_plus::micro_test_plus::detail::within_tolerance.

Referenced by micro_os_plus::micro_test_plus::detail::compare_op< Lhs_T, Rhs_T, Compare_T >::compare_op and micro_os_plus::micro_test_plus::detail::within_tolerance.

Variables​

within_tolerance_result​

bool micro_os_plus::micro_test_plus::detail::equal_to::within_tolerance_result = true
constexpr static

Deprecated result when the operands are within the tolerance.

Values within the tolerance are equal.

Used only by the tolerance of the deprecated floating-point wrappers.

Deprecated

to be removed with the deprecated floating-point wrappers (since 6.0.0)

Definition at line 468 of file detail.h.

468 static constexpr bool within_tolerance_result = true;

within_tolerance_result​

bool micro_os_plus::micro_test_plus::detail::greater::within_tolerance_result = false
constexpr static

Deprecated result when the operands are within the tolerance.

Values within the tolerance are equal, not ordered.

Used only by the tolerance of the deprecated floating-point wrappers.

Deprecated

to be removed with the deprecated floating-point wrappers (since 6.0.0)

Definition at line 586 of file detail.h.

586 static constexpr bool within_tolerance_result = false;

within_tolerance_result​

bool micro_os_plus::micro_test_plus::detail::greater_equal::within_tolerance_result = true
constexpr static

Deprecated result when the operands are within the tolerance.

Values within the tolerance are equal.

Used only by the tolerance of the deprecated floating-point wrappers.

Deprecated

to be removed with the deprecated floating-point wrappers (since 6.0.0)

Definition at line 645 of file detail.h.

645 static constexpr bool within_tolerance_result = true;

within_tolerance_result​

bool micro_os_plus::micro_test_plus::detail::less::within_tolerance_result = false
constexpr static

Deprecated result when the operands are within the tolerance.

Values within the tolerance are equal, not ordered.

Used only by the tolerance of the deprecated floating-point wrappers.

Deprecated

to be removed with the deprecated floating-point wrappers (since 6.0.0)

Definition at line 704 of file detail.h.

704 static constexpr bool within_tolerance_result = false;

within_tolerance_result​

bool micro_os_plus::micro_test_plus::detail::less_equal::within_tolerance_result = true
constexpr static

Deprecated result when the operands are within the tolerance.

Values within the tolerance are equal.

Used only by the tolerance of the deprecated floating-point wrappers.

Deprecated

to be removed with the deprecated floating-point wrappers (since 6.0.0)

Definition at line 763 of file detail.h.

763 static constexpr bool within_tolerance_result = true;

within_tolerance_result​

bool micro_os_plus::micro_test_plus::detail::not_equal_to::within_tolerance_result = false
constexpr static

Deprecated result when the operands are within the tolerance.

Values within the tolerance are equal.

Used only by the tolerance of the deprecated floating-point wrappers.

Deprecated

to be removed with the deprecated floating-point wrappers (since 6.0.0)

Definition at line 527 of file detail.h.

527 static constexpr bool within_tolerance_result = false;

Deprecated Functions​

mut()​

template <class T>
T & micro_os_plus::micro_test_plus::mut (const T & t)
nodiscard constexpr noexcept

Deprecated generic mutator to remove const qualification from a reference.

Not used by the framework. Equivalent to const_cast<T&> (t), which replaces it.

warning

Modifying an object that was originally declared as const through the returned reference is undefined behaviour.

Template Parameters
T

The type of the input object.

Parameters
t

The object from which to remove const qualification.

Returns

A non-const reference to the input object.

Deprecated

use const_cast<T&> (since 6.0.0)

Removes the const qualifier from the reference with const_cast.

Definition at line 725 of file deprecated-inlines.h.

725 mut (const T& t) noexcept -> T&
726 {
727 return const_cast<T&> (t);
728 }

Reference micro_os_plus::micro_test_plus::mut.

Referenced by micro_os_plus::micro_test_plus::mut.


Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.