|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests of the messages of the macros of ah-errors.H that throw. More...
#include <gtest/gtest.h>#include <atomic>#include <cstring>#include <iomanip>#include <ios>#include <ostream>#include <sstream>#include <stdexcept>#include <string>#include <string_view>#include <thread>#include <type_traits>#include <typeinfo>#include <utility>#include <ah-errors.H>#include <bitArray.H>#include <tpl_array.H>#include <tpl_arrayQueue.H>#include <tpl_dynArray.H>#include <tpl_memArray.H>#include <tpl_small_vector.H>Go to the source code of this file.
Namespaces | |
| namespace | overload_of_the_caller |
Macros | |
| #define | EXPECT_THE_WHOLE(E, call, items) |
| #define | EXPECT_THE_ITEMS(E, call, items) |
| #define | EXPECT_THE_TEXT(E, statement, text) |
| #define | EXPECT_THE_MESSAGES_OF(E, base) |
| #define | ITEMS << "value " << n << ", " << s << ' ' << 2.5 |
Functions | |
| TEST (ErrorMessage, EveryMacroGivesItsPlaceAndItsItems) | |
| TEST (ErrorMessage, AMessageWithoutItemsIsItsPlace) | |
| TEST (ErrorMessage, TakesTheItemsThatAStreamTakes) | |
| TEST (ErrorMessage, TakesTheManipulatorsOfAStream) | |
| TEST (ErrorMessage, KeepsTheTemporariesOfItsItemsUntilItThrows) | |
| TEST (ErrorMessage, EvaluatesItsItemsOnceInOrderAndOnlyToThrow) | |
| TEST (ErrorMessage, ReadsEachItemWhenItIsInserted) | |
| TEST (ErrorMessage, GoesThroughAMacroThatTakesItAsAnArgument) | |
| TEST (ErrorMessage, TheStreamOfAMessageTakesAPointerOfTheFrame) | |
| TEST (ErrorMessage, TheStreamDiesWhenItsExceptionLeaves) | |
| TEST (ErrorMessage, AnOverloadOfTheCallerTakesItsItemsAndNotThePlace) | |
| TEST (ErrorMessage, EachThreadWritesItsOwnMessages) | |
| TEST (ErrorMessage, AMessageInsideAnotherKeepsBoth) | |
| TEST (ErrorMessage, ACheckedAccessOutOfRangeThrowsWithItsText) | |
Tests of the messages of the macros of ah-errors.H that throw.
A macro writes its message in a stream that an object of one pointer owns out of the frame of the function that checks. These tests check that the text is the one that a stream gives for the same items, behind the place of the call; that each item is evaluated once, in order and only to throw, and read when it is inserted; that the stream has the type of the temporary stream that the macros had, and dies when its exception leaves, also when an item throws; that the place is written by the library and each thread writes its own messages; and that the checked accesses of the arrays still throw with their text.
Definition in file ah_errors_message_test.cc.
| #define EXPECT_THE_ITEMS | ( | E, | |
| call, | |||
| items | |||
| ) |
Definition at line 247 of file ah_errors_message_test.cc.
| #define EXPECT_THE_MESSAGES_OF | ( | E, | |
| base | |||
| ) |
Definition at line 269 of file ah_errors_message_test.cc.
| #define EXPECT_THE_TEXT | ( | E, | |
| statement, | |||
| text | |||
| ) |
Definition at line 259 of file ah_errors_message_test.cc.
| #define EXPECT_THE_WHOLE | ( | E, | |
| call, | |||
| items | |||
| ) |
Definition at line 234 of file ah_errors_message_test.cc.
| #define ITEMS << "value " << n << ", " << s << ' ' << 2.5 |
| TEST | ( | ErrorMessage | , |
| ACheckedAccessOutOfRangeThrowsWithItsText | |||
| ) |
Definition at line 524 of file ah_errors_message_test.cc.
References Aleph::SmallVector< T, N >::append(), Aleph::bits(), Aleph::message(), Aleph::ArrayQueue< T >::put(), Aleph::MemArray< T >::put(), Aleph::DynArray< T >::read(), and Aleph::DynArray< T >::touch().
| TEST | ( | ErrorMessage | , |
| AMessageInsideAnotherKeepsBoth | |||
| ) |
Definition at line 516 of file ah_errors_message_test.cc.
References ah_runtime_error, and EXPECT_THE_TEXT.
| TEST | ( | ErrorMessage | , |
| AMessageWithoutItemsIsItsPlace | |||
| ) |
Definition at line 300 of file ah_errors_message_test.cc.
References ah_domain_error_unless, ah_length_error, ah_range_error_if, EXPECT_THE_TEXT, and EXPECT_THE_WHOLE.
| TEST | ( | ErrorMessage | , |
| AnOverloadOfTheCallerTakesItsItemsAndNotThePlace | |||
| ) |
Definition at line 474 of file ah_errors_message_test.cc.
References Aleph::message().
| TEST | ( | ErrorMessage | , |
| EachThreadWritesItsOwnMessages | |||
| ) |
Definition at line 486 of file ah_errors_message_test.cc.
References Aleph::Array< T >::append().
| TEST | ( | ErrorMessage | , |
| EvaluatesItsItemsOnceInOrderAndOnlyToThrow | |||
| ) |
Definition at line 364 of file ah_errors_message_test.cc.
References ah_logic_error_if, ah_logic_error_unless, EXPECT_THE_TEXT, and Aleph::next().
| TEST | ( | ErrorMessage | , |
| EveryMacroGivesItsPlaceAndItsItems | |||
| ) |
Definition at line 280 of file ah_errors_message_test.cc.
References ah_domain_error, ah_fatal_error, ah_invalid_argument, ah_length_error, ah_logic_error, ah_out_of_range_error, ah_overflow_error, ah_range_error, ah_runtime_error, ah_underflow_error, EXPECT_THE_MESSAGES_OF, EXPECT_THE_WHOLE, and ITEMS.
| TEST | ( | ErrorMessage | , |
| GoesThroughAMacroThatTakesItAsAnArgument | |||
| ) |
Definition at line 411 of file ah_errors_message_test.cc.
References ah_domain_error_if, and ah_out_of_range_error.
| TEST | ( | ErrorMessage | , |
| KeepsTheTemporariesOfItsItemsUntilItThrows | |||
| ) |
Definition at line 351 of file ah_errors_message_test.cc.
References ah_runtime_error, ah_runtime_error_if, and EXPECT_THE_TEXT.
| TEST | ( | ErrorMessage | , |
| ReadsEachItemWhenItIsInserted | |||
| ) |
Definition at line 382 of file ah_errors_message_test.cc.
References ah_logic_error, EXPECT_THE_TEXT, and value.
| TEST | ( | ErrorMessage | , |
| TakesTheItemsThatAStreamTakes | |||
| ) |
Definition at line 307 of file ah_errors_message_test.cc.
References ah_domain_error, and EXPECT_THE_ITEMS.
| TEST | ( | ErrorMessage | , |
| TakesTheManipulatorsOfAStream | |||
| ) |
Definition at line 338 of file ah_errors_message_test.cc.
References ah_domain_error, and EXPECT_THE_ITEMS.
| TEST | ( | ErrorMessage | , |
| TheStreamDiesWhenItsExceptionLeaves | |||
| ) |
Definition at line 452 of file ah_errors_message_test.cc.
References ah_runtime_error, and ah_runtime_error_if.
| TEST | ( | ErrorMessage | , |
| TheStreamOfAMessageTakesAPointerOfTheFrame | |||
| ) |
Definition at line 428 of file ah_errors_message_test.cc.
References Aleph::message().