Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
test_ah_errors.cc File Reference

Comprehensive tests for ah-errors.H exception handling macros. More...

#include <iostream>
#include <sstream>
#include <cassert>
#include <stdexcept>
#include <string>
#include "../ah-errors.H"
Include dependency graph for test_ah_errors.cc:

Go to the source code of this file.

Macros

#define TEST_EXCEPTION(exception_type, code, should_throw)
 

Functions

void test_range_error_if ()
 
void test_range_error_unless ()
 
void test_range_error ()
 
void test_runtime_error_if ()
 
void test_runtime_error_unless ()
 
void test_runtime_error ()
 
void test_logic_error_if ()
 
void test_logic_error_unless ()
 
void test_logic_error ()
 
void test_underflow_error_if ()
 
void test_underflow_error_unless ()
 
void test_underflow_error ()
 
void test_overflow_error_if ()
 
void test_overflow_error_unless ()
 
void test_overflow_error ()
 
void test_domain_error_if ()
 
void test_domain_error_unless ()
 
void test_domain_error ()
 
void test_out_of_range_error_if ()
 
void test_out_of_range_error_unless ()
 
void test_out_of_range_error ()
 
void test_invalid_argument_if ()
 
void test_invalid_argument_unless ()
 
void test_invalid_argument ()
 
void test_length_error_if ()
 
void test_length_error_unless ()
 
void test_length_error ()
 
void test_fatal_error ()
 
void test_warning_macros ()
 
void test_message_formatting ()
 
int main ()
 

Variables

int tests_passed = 0
 
int tests_failed = 0
 

Detailed Description

Comprehensive tests for ah-errors.H exception handling macros.

Author
Test suite for Aleph-w

Definition in file test_ah_errors.cc.

Macro Definition Documentation

◆ TEST_EXCEPTION

#define TEST_EXCEPTION (   exception_type,
  code,
  should_throw 
)

Definition at line 21 of file test_ah_errors.cc.

Function Documentation

◆ main()

◆ test_domain_error()

void test_domain_error ( )

Definition at line 286 of file test_ah_errors.cc.

References ah_domain_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_domain_error_if()

void test_domain_error_if ( )

Definition at line 260 of file test_ah_errors.cc.

References ah_domain_error_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_domain_error_unless()

void test_domain_error_unless ( )

Definition at line 273 of file test_ah_errors.cc.

References ah_domain_error_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_fatal_error()

void test_fatal_error ( )

Definition at line 416 of file test_ah_errors.cc.

References ah_fatal_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_invalid_argument()

void test_invalid_argument ( )

Definition at line 364 of file test_ah_errors.cc.

References ah_invalid_argument, and TEST_EXCEPTION.

Referenced by main().

◆ test_invalid_argument_if()

void test_invalid_argument_if ( )

Definition at line 338 of file test_ah_errors.cc.

References ah_invalid_argument_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_invalid_argument_unless()

void test_invalid_argument_unless ( )

Definition at line 351 of file test_ah_errors.cc.

References ah_invalid_argument_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_length_error()

void test_length_error ( )

Definition at line 403 of file test_ah_errors.cc.

References ah_length_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_length_error_if()

void test_length_error_if ( )

Definition at line 377 of file test_ah_errors.cc.

References ah_length_error_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_length_error_unless()

void test_length_error_unless ( )

Definition at line 390 of file test_ah_errors.cc.

References ah_length_error_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_logic_error()

void test_logic_error ( )

Definition at line 169 of file test_ah_errors.cc.

References ah_logic_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_logic_error_if()

void test_logic_error_if ( )

Definition at line 143 of file test_ah_errors.cc.

References ah_logic_error_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_logic_error_unless()

void test_logic_error_unless ( )

Definition at line 156 of file test_ah_errors.cc.

References ah_logic_error_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_message_formatting()

void test_message_formatting ( )

Definition at line 479 of file test_ah_errors.cc.

References ah_range_error, tests_failed, and tests_passed.

Referenced by main().

◆ test_out_of_range_error()

void test_out_of_range_error ( )

Definition at line 325 of file test_ah_errors.cc.

References ah_out_of_range_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_out_of_range_error_if()

void test_out_of_range_error_if ( )

Definition at line 299 of file test_ah_errors.cc.

References ah_out_of_range_error_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_out_of_range_error_unless()

void test_out_of_range_error_unless ( )

Definition at line 312 of file test_ah_errors.cc.

References ah_out_of_range_error_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_overflow_error()

void test_overflow_error ( )

Definition at line 247 of file test_ah_errors.cc.

References ah_overflow_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_overflow_error_if()

void test_overflow_error_if ( )

Definition at line 221 of file test_ah_errors.cc.

References ah_overflow_error_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_overflow_error_unless()

void test_overflow_error_unless ( )

Definition at line 234 of file test_ah_errors.cc.

References ah_overflow_error_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_range_error()

void test_range_error ( )

Definition at line 90 of file test_ah_errors.cc.

References ah_range_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_range_error_if()

void test_range_error_if ( )

Definition at line 60 of file test_ah_errors.cc.

References ah_range_error_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_range_error_unless()

void test_range_error_unless ( )

Definition at line 75 of file test_ah_errors.cc.

References ah_range_error_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_runtime_error()

void test_runtime_error ( )

Definition at line 130 of file test_ah_errors.cc.

References ah_runtime_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_runtime_error_if()

void test_runtime_error_if ( )

Definition at line 104 of file test_ah_errors.cc.

References ah_runtime_error_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_runtime_error_unless()

void test_runtime_error_unless ( )

Definition at line 117 of file test_ah_errors.cc.

References ah_runtime_error_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_underflow_error()

void test_underflow_error ( )

Definition at line 208 of file test_ah_errors.cc.

References ah_underflow_error, and TEST_EXCEPTION.

Referenced by main().

◆ test_underflow_error_if()

void test_underflow_error_if ( )

Definition at line 182 of file test_ah_errors.cc.

References ah_underflow_error_if, and TEST_EXCEPTION.

Referenced by main().

◆ test_underflow_error_unless()

void test_underflow_error_unless ( )

Definition at line 195 of file test_ah_errors.cc.

References ah_underflow_error_unless, and TEST_EXCEPTION.

Referenced by main().

◆ test_warning_macros()

void test_warning_macros ( )

Definition at line 429 of file test_ah_errors.cc.

References ah_warning, ah_warning_if, ah_warning_unless, tests_failed, and tests_passed.

Referenced by main().

Variable Documentation

◆ tests_failed

int tests_failed = 0

Definition at line 18 of file test_ah_errors.cc.

Referenced by main(), test_message_formatting(), and test_warning_macros().

◆ tests_passed

int tests_passed = 0

Definition at line 17 of file test_ah_errors.cc.

Referenced by main(), test_message_formatting(), and test_warning_macros().