Skip to main content

counters-inlines.h File

C++ header file with inline implementations for the µTest++ counters. More...

Namespaces Index​

namespacemicro_os_plus

The primary namespace for the µOS++ framework. More...

namespacemicro_test_plus

Primary namespace for the µTest++ testing framework. More...

Description​

C++ header file with inline implementations for the µTest++ counters.

This header provides the inline member function bodies for the counters class, separated from the class declaration in counters.h to enforce the project convention that declarations reside in headers and implementations reside in inline files.

All definitions reside within the micro_os_plus::micro_test_plus namespace.

This file is included by counters.h; the applications include micro-os-plus/micro-test-plus.h, not this file.

File Listing​

The file content with the documentation metadata removed is:

1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2021-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can be
9 * obtained from https://opensource.org/licenses/mit.
10 */
11
12// ----------------------------------------------------------------------------
13
31
32#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_COUNTERS_INLINES_H_
33#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_COUNTERS_INLINES_H_
34
35// ----------------------------------------------------------------------------
36
37#if defined(__cplusplus)
38
39// ----------------------------------------------------------------------------
40
41#if defined(__GNUC__)
42#pragma GCC diagnostic push
43
44#if defined(__clang__)
45#pragma clang diagnostic ignored "-Wc++98-compat"
46#endif // defined(__clang__)
47#endif // defined(__GNUC__)
48
49// ============================================================================
50
52{
53 // ==========================================================================
54
59 inline void
60 counters::increment_passed_checks (size_t count) noexcept
61 {
62 passed_checks_ += count;
63 }
64
69 inline void
70 counters::increment_failed_checks (size_t count) noexcept
71 {
72 failed_checks_ += count;
73 }
74
79 inline void
81 {
83 }
84
89 inline void
91 {
92 failed_test_cases_ += count;
93 }
94
99 inline void
101 {
102 skipped_test_cases_ += count;
103 }
104
109 inline size_t
110 counters::passed_checks (void) const noexcept
111 {
112 return passed_checks_;
113 }
114
115#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
120 // Deprecated since 6.0.0; use passed_checks().
121 inline size_t
122 counters::successful_checks (void) const noexcept
123 {
124 return passed_checks ();
125 }
126#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
127
132 inline size_t
133 counters::failed_checks (void) const noexcept
134 {
135 return failed_checks_;
136 }
137
142 inline size_t
143 counters::executed_checks (void) const noexcept
144 {
146 }
147
152 inline size_t
153 counters::executed_test_cases (void) const noexcept
154 {
156 }
157
158#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
163 // Deprecated since 6.0.0; use executed_test_cases().
164 inline size_t
165 counters::executed_subtests (void) const noexcept
166 {
167 return executed_test_cases ();
168 }
169#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
170
175 inline size_t
176 counters::failed_test_cases (void) const noexcept
177 {
178 return failed_test_cases_;
179 }
180
185 inline size_t
186 counters::skipped_test_cases (void) const noexcept
187 {
189 }
190
198 inline bool
199 counters::passed (void) const noexcept
200 {
201 return failed_checks_ == 0 && failed_test_cases_ == 0;
202 }
203
204#if defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
209 // Deprecated since 6.0.0; use passed().
210 inline bool
211 counters::was_successful (void) const noexcept
212 {
213 return passed ();
214 }
215#endif // defined(MICRO_OS_PLUS_MICRO_TEST_PLUS_DEPRECATED_ENABLED)
216
217 // --------------------------------------------------------------------------
218} // namespace micro_os_plus::micro_test_plus
219
220// ----------------------------------------------------------------------------
221
222#if defined(__GNUC__)
223#pragma GCC diagnostic pop
224#endif // defined(__GNUC__)
225
226// ----------------------------------------------------------------------------
227
228#endif // defined(__cplusplus)
229
230// ----------------------------------------------------------------------------
231
232#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_COUNTERS_INLINES_H_
233
234// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.