|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests that an else written after a conditional macro of ah-errors.H, parse_utils.H or ah-trace.H belongs to the if around the macro. More...
#include <gtest/gtest.h>#include <new>#include <sstream>#include <stdexcept>#include <string>#include <type_traits>#include <utility>#include <ah-errors.H>#include <ah-trace.H>#include <parse_utils.H>Go to the source code of this file.
Macros | |
| #define | TEST_THE_ELSE_AFTER(NAME, MACRO, E, THROWS, TAIL, HAS_MESSAGE) |
| #define | TEST_THE_ELSE_AFTER_CONSTEXPR(NAME, MACRO, E, THROWS, TAIL) |
| #define | TEST_THE_ELSE_AFTER_A_MESSAGE(NAME, MACRO, WRITES, LOCATED) |
| #define | WITH_MESSAGE << "the message" |
| #define | WITHOUT_MESSAGE |
Functions | |
| TEST (AhErrorsElse, RangeErrorIf) | |
| TEST (AhErrorsElse, RangeErrorUnless) | |
| TEST (AhErrorsElse, RuntimeErrorIf) | |
| TEST (AhErrorsElse, RuntimeErrorUnless) | |
| TEST (AhErrorsElse, LogicErrorIf) | |
| TEST (AhErrorsElse, LogicErrorUnless) | |
| TEST (AhErrorsElse, UnderflowErrorIf) | |
| TEST (AhErrorsElse, UnderflowErrorUnless) | |
| TEST (AhErrorsElse, OverflowErrorIf) | |
| TEST (AhErrorsElse, OverflowErrorUnless) | |
| TEST (AhErrorsElse, DomainErrorIf) | |
| TEST (AhErrorsElse, DomainErrorUnless) | |
| TEST (AhErrorsElse, OutOfRangeErrorIf) | |
| TEST (AhErrorsElse, OutOfRangeErrorUnless) | |
| TEST (AhErrorsElse, InvalidArgumentIf) | |
| TEST (AhErrorsElse, InvalidArgumentUnless) | |
| TEST (AhErrorsElse, LengthErrorIf) | |
| TEST (AhErrorsElse, LengthErrorUnless) | |
| TEST (AhErrorsElse, BadAllocIf) | |
| TEST (AhErrorsElse, BadAllocUnless) | |
| TEST (AhErrorsElse, RangeErrorIfConstexpr) | |
| TEST (AhErrorsElse, RangeErrorUnlessConstexpr) | |
| TEST (AhErrorsElse, RuntimeErrorIfConstexpr) | |
| TEST (AhErrorsElse, RuntimeErrorUnlessConstexpr) | |
| TEST (AhErrorsElse, LogicErrorIfConstexpr) | |
| TEST (AhErrorsElse, LogicErrorUnlessConstexpr) | |
| TEST (AhErrorsElse, UnderflowErrorIfConstexpr) | |
| TEST (AhErrorsElse, UnderflowErrorUnlessConstexpr) | |
| TEST (AhErrorsElse, OverflowErrorIfConstexpr) | |
| TEST (AhErrorsElse, OverflowErrorUnlessConstexpr) | |
| TEST (AhErrorsElse, DomainErrorIfConstexpr) | |
| TEST (AhErrorsElse, DomainErrorUnlessConstexpr) | |
| TEST (AhErrorsElse, OutOfRangeErrorIfConstexpr) | |
| TEST (AhErrorsElse, OutOfRangeErrorUnlessConstexpr) | |
| TEST (AhErrorsElse, InvalidArgumentIfConstexpr) | |
| TEST (AhErrorsElse, InvalidArgumentUnlessConstexpr) | |
| TEST (AhErrorsElse, LengthErrorIfConstexpr) | |
| TEST (AhErrorsElse, LengthErrorUnlessConstexpr) | |
| TEST (AhErrorsElse, BadAllocIfConstexpr) | |
| TEST (AhErrorsElse, BadAllocUnlessConstexpr) | |
| TEST (AhErrorsElse, WarningIf) | |
| TEST (AhErrorsElse, WarningUnless) | |
| TEST (AhErrorsElse, ParseErrorIf) | |
| TEST (AhErrorsElse, ParseErrorUnless) | |
| TEST (AhErrorsElse, TraceIf) | |
| TEST (AhErrorsElse, TraceUnless) | |
| TEST (AhErrorsElse, MsgIf) | |
| TEST (AhErrorsElse, MsgUnless) | |
| TEST (AhErrorsElse, ElseIfChain) | |
| TEST (AhErrorsElse, BreakAndContinueAfterAMacro) | |
| TEST (AhErrorsElse, ConstexprFormInATemplate) | |
| TEST (AhErrorsElse, TheMacrosThatWriteHideNoNameOfTheCaller) | |
| TEST (AhErrorsElse, TheMacrosThatThrowHideNoNameOfTheCaller) | |
| TEST (AhErrorsElse, ConstantConditionsDoNotWarn) | |
| TEST (AhErrorsElse, ConstexprFormsConvertTheirConditionAsIfConstexpr) | |
| TEST (AhErrorsElse, AMessageThatGivesBackAWrapperOfTheStreamIsThrown) | |
Tests that an else written after a conditional macro of ah-errors.H, parse_utils.H or ah-trace.H belongs to the if around the macro.
The macros used to be if statements without braces, so such an else belonged to the if of the macro. Every if of this file whose statement is a macro, with an else or without one, must compile without -Wdangling-else; that the else cannot follow a macro with no if around it is checked by ah_errors_else_check.cmake.
Definition in file ah_errors_else_test.cc.
| #define TEST_THE_ELSE_AFTER | ( | NAME, | |
| MACRO, | |||
| E, | |||
| THROWS, | |||
| TAIL, | |||
| HAS_MESSAGE | |||
| ) |
Definition at line 90 of file ah_errors_else_test.cc.
| #define TEST_THE_ELSE_AFTER_A_MESSAGE | ( | NAME, | |
| MACRO, | |||
| WRITES, | |||
| LOCATED | |||
| ) |
Definition at line 195 of file ah_errors_else_test.cc.
| #define TEST_THE_ELSE_AFTER_CONSTEXPR | ( | NAME, | |
| MACRO, | |||
| E, | |||
| THROWS, | |||
| TAIL | |||
| ) |
Definition at line 141 of file ah_errors_else_test.cc.
| #define WITH_MESSAGE << "the message" |
Definition at line 231 of file ah_errors_else_test.cc.
| #define WITHOUT_MESSAGE |
Definition at line 232 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| AMessageThatGivesBackAWrapperOfTheStreamIsThrown | |||
| ) |
Definition at line 601 of file ah_errors_else_test.cc.
References ah_domain_error_if.
| TEST | ( | AhErrorsElse | , |
| BadAllocIf | |||
| ) |
Definition at line 272 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| BadAllocIfConstexpr | |||
| ) |
Definition at line 331 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| BadAllocUnless | |||
| ) |
Definition at line 274 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| BadAllocUnlessConstexpr | |||
| ) |
Definition at line 334 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| BreakAndContinueAfterAMacro | |||
| ) |
Definition at line 377 of file ah_errors_else_test.cc.
References ah_domain_error_if, ah_domain_error_unless, and r.
| TEST | ( | AhErrorsElse | , |
| ConstantConditionsDoNotWarn | |||
| ) |
Definition at line 499 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| ConstexprFormInATemplate | |||
| ) |
Definition at line 412 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| ConstexprFormsConvertTheirConditionAsIfConstexpr | |||
| ) |
Definition at line 540 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| DomainErrorIf | |||
| ) |
Definition at line 256 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| DomainErrorIfConstexpr | |||
| ) |
Definition at line 308 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| DomainErrorUnless | |||
| ) |
Definition at line 258 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| DomainErrorUnlessConstexpr | |||
| ) |
Definition at line 311 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| ElseIfChain | |||
| ) |
Definition at line 366 of file ah_errors_else_test.cc.
References chain().
| TEST | ( | AhErrorsElse | , |
| InvalidArgumentIf | |||
| ) |
Definition at line 264 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| InvalidArgumentIfConstexpr | |||
| ) |
Definition at line 320 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| InvalidArgumentUnless | |||
| ) |
Definition at line 266 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| InvalidArgumentUnlessConstexpr | |||
| ) |
Definition at line 323 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| LengthErrorIf | |||
| ) |
Definition at line 268 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| LengthErrorIfConstexpr | |||
| ) |
Definition at line 326 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| LengthErrorUnless | |||
| ) |
Definition at line 270 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| LengthErrorUnlessConstexpr | |||
| ) |
Definition at line 329 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| LogicErrorIf | |||
| ) |
Definition at line 244 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| LogicErrorIfConstexpr | |||
| ) |
Definition at line 290 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| LogicErrorUnless | |||
| ) |
Definition at line 246 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| LogicErrorUnlessConstexpr | |||
| ) |
Definition at line 293 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| MsgIf | |||
| ) |
Definition at line 348 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| MsgUnless | |||
| ) |
Definition at line 349 of file ah_errors_else_test.cc.
References ah_domain_error_if, ah_domain_error_unless, chain(), k, and r.
| TEST | ( | AhErrorsElse | , |
| OutOfRangeErrorIf | |||
| ) |
Definition at line 260 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| OutOfRangeErrorIfConstexpr | |||
| ) |
Definition at line 314 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| OutOfRangeErrorUnless | |||
| ) |
Definition at line 262 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| OutOfRangeErrorUnlessConstexpr | |||
| ) |
Definition at line 317 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| OverflowErrorIf | |||
| ) |
Definition at line 252 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| OverflowErrorIfConstexpr | |||
| ) |
Definition at line 302 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| OverflowErrorUnless | |||
| ) |
Definition at line 254 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| OverflowErrorUnlessConstexpr | |||
| ) |
Definition at line 305 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| ParseErrorIf | |||
| ) |
Definition at line 341 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| ParseErrorUnless | |||
| ) |
Definition at line 343 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| RangeErrorIf | |||
| ) |
Definition at line 236 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| RangeErrorIfConstexpr | |||
| ) |
Definition at line 278 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| RangeErrorUnless | |||
| ) |
Definition at line 238 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| RangeErrorUnlessConstexpr | |||
| ) |
Definition at line 281 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| RuntimeErrorIf | |||
| ) |
Definition at line 240 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| RuntimeErrorIfConstexpr | |||
| ) |
Definition at line 284 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| RuntimeErrorUnless | |||
| ) |
Definition at line 242 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| RuntimeErrorUnlessConstexpr | |||
| ) |
Definition at line 287 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| TheMacrosThatThrowHideNoNameOfTheCaller | |||
| ) |
Definition at line 455 of file ah_errors_else_test.cc.
References ah_domain_error_if, ah_domain_error_unless, and ah_parse_error_if.
| TEST | ( | AhErrorsElse | , |
| TheMacrosThatWriteHideNoNameOfTheCaller | |||
| ) |
Definition at line 424 of file ah_errors_else_test.cc.
References ah_msg_if, ah_msg_unless, ah_trace_if, ah_trace_unless, ah_warning_if, ah_warning_unless, and out.
| TEST | ( | AhErrorsElse | , |
| TraceIf | |||
| ) |
Definition at line 346 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| TraceUnless | |||
| ) |
Definition at line 347 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| UnderflowErrorIf | |||
| ) |
Definition at line 248 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| UnderflowErrorIfConstexpr | |||
| ) |
Definition at line 296 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| UnderflowErrorUnless | |||
| ) |
Definition at line 250 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| UnderflowErrorUnlessConstexpr | |||
| ) |
Definition at line 299 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| WarningIf | |||
| ) |
Definition at line 336 of file ah_errors_else_test.cc.
| TEST | ( | AhErrorsElse | , |
| WarningUnless | |||
| ) |
Definition at line 337 of file ah_errors_else_test.cc.