|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Comprehensive test suite for DynMatrix<T> More...
#include <gtest/gtest.h>#include <string>#include <memory>#include <vector>#include <stdexcept>#include <cmath>#include <tpl_dynMat.H>#include <ahFunctional.H>Go to the source code of this file.
Classes | |
| struct | SmallIntMatrix |
| Fixture with a small integer matrix. More... | |
| struct | FilledMatrix |
| Fixture with a pre-filled matrix. More... | |
| struct | SquareMatrix |
| Fixture with a square matrix. More... | |
| struct | Counted |
| Type that counts constructions/destructions. More... | |
Functions | |
| TEST (DynMatrix, default_constructor_creates_empty_matrix) | |
| TEST (DynMatrix, parametrized_constructor_creates_correct_dimensions) | |
| TEST (DynMatrix, parametrized_constructor_with_custom_default_value) | |
| TEST (DynMatrix, constructor_throws_on_zero_dimensions) | |
| TEST (DynMatrix, constructor_with_various_types) | |
| TEST_F (FilledMatrix, copy_constructor_creates_independent_copy) | |
| TEST (DynMatrix, copy_constructor_empty_matrix) | |
| TEST_F (SmallIntMatrix, copy_constructor_sparse_matrix) | |
| TEST_F (FilledMatrix, move_constructor_transfers_ownership) | |
| TEST (DynMatrix, move_constructor_empty_matrix) | |
| TEST (DynMatrix, move_constructor_is_noexcept) | |
| TEST_F (FilledMatrix, copy_assignment_replaces_contents) | |
| TEST_F (FilledMatrix, copy_assignment_self_assignment_is_safe) | |
| TEST (DynMatrix, copy_assignment_different_dimensions) | |
| TEST_F (FilledMatrix, move_assignment_transfers_ownership) | |
| TEST (DynMatrix, move_assignment_is_noexcept) | |
| TEST (DynMatrix, swap_exchanges_contents) | |
| TEST (DynMatrix, swap_with_empty_matrix) | |
| TEST (DynMatrix, swap_is_noexcept) | |
| TEST_F (SmallIntMatrix, rows_returns_correct_value) | |
| TEST_F (SmallIntMatrix, cols_returns_correct_value) | |
| TEST_F (SmallIntMatrix, size_returns_product_of_dimensions) | |
| TEST (DynMatrix, is_square_true_for_square_matrix) | |
| TEST (DynMatrix, is_square_false_for_non_square_matrix) | |
| TEST (DynMatrix, is_empty_true_for_default_constructed) | |
| TEST_F (SmallIntMatrix, is_empty_false_for_initialized_matrix) | |
| TEST_F (SmallIntMatrix, write_and_read_single_entry) | |
| TEST_F (SmallIntMatrix, read_unwritten_entry_returns_default) | |
| TEST_F (SmallIntMatrix, write_returns_reference_to_entry) | |
| TEST_F (SmallIntMatrix, read_throws_on_out_of_bounds) | |
| TEST_F (SmallIntMatrix, write_throws_on_out_of_bounds) | |
| TEST_F (SmallIntMatrix, read_ne_no_bounds_check) | |
| TEST (DynMatrix, write_with_move_semantics) | |
| TEST_F (SmallIntMatrix, access_after_allocate) | |
| TEST_F (SmallIntMatrix, access_const_version) | |
| TEST_F (FilledMatrix, operator_parens_read_write) | |
| TEST_F (SmallIntMatrix, fill_sets_all_entries) | |
| TEST (DynMatrix, fill_overwrites_existing_values) | |
| TEST_F (FilledMatrix, transpose_swaps_dimensions) | |
| TEST_F (FilledMatrix, transpose_swaps_values) | |
| TEST_F (SquareMatrix, transpose_diagonal_unchanged) | |
| TEST (DynMatrix, transpose_sparse_matrix) | |
| TEST_F (FilledMatrix, set_dimension_clears_data) | |
| TEST_F (SmallIntMatrix, set_dimension_preserves_default_value) | |
| TEST_F (SmallIntMatrix, set_default_initial_value) | |
| TEST (DynMatrix, default_value_affects_unwritten_reads) | |
| TEST (DynMatrix, changing_default_affects_future_reads) | |
| TEST (DynMatrix, equality_same_matrices) | |
| TEST (DynMatrix, equality_different_dimensions) | |
| TEST (DynMatrix, equality_different_values) | |
| TEST_F (FilledMatrix, equality_with_copy) | |
| TEST_F (SmallIntMatrix, iterator_basic_traversal) | |
| TEST_F (FilledMatrix, iterator_visits_in_row_major_order) | |
| TEST_F (SmallIntMatrix, iterator_get_curr_throws_when_exhausted) | |
| TEST_F (SmallIntMatrix, iterator_next_throws_when_exhausted) | |
| TEST_F (SmallIntMatrix, iterator_reset) | |
| TEST_F (FilledMatrix, traverse_visits_all_elements) | |
| TEST_F (FilledMatrix, traverse_can_stop_early) | |
| TEST_F (SmallIntMatrix, traverse_on_sparse_matrix) | |
| TEST_F (SmallIntMatrix, traverse_allocated_visits_allocated_blocks) | |
| TEST_F (FilledMatrix, for_each_visits_all) | |
| TEST_F (FilledMatrix, all_returns_true_when_all_match) | |
| TEST_F (FilledMatrix, all_returns_false_when_any_fails) | |
| TEST_F (FilledMatrix, exists_returns_true_when_found) | |
| TEST_F (FilledMatrix, exists_returns_false_when_not_found) | |
| TEST_F (FilledMatrix, foldl_accumulates) | |
| TEST (DynMatrix, type_aliases_are_correct) | |
| TEST (DynMatrix, destructor_frees_all_memory) | |
| TEST (DynMatrix, allocate_reserves_all_entries) | |
| TEST (DynMatrix, single_element_matrix) | |
| TEST (DynMatrix, single_row_matrix) | |
| TEST (DynMatrix, single_column_matrix) | |
| TEST (DynMatrix, very_sparse_matrix) | |
| TEST (DynMatrix, stress_large_matrix) | |
| TEST (DynMatrix, stress_copy_large_matrix) | |
| TEST (DynMatrix, floating_point_matrix) | |
| TEST (DynMatrix, string_matrix) | |
| TEST (DynMatrix, regression_equality_different_shaped_same_size) | |
| TEST (DynMatrix, regression_move_assignment_returns_reference) | |
| int | main (int argc, char **argv) |
Variables | |
| constexpr size_t | SMALL_N = 3 |
| constexpr size_t | SMALL_M = 4 |
| constexpr size_t | MEDIUM_N = 10 |
| constexpr size_t | MEDIUM_M = 15 |
| constexpr size_t | LARGE_N = 100 |
Comprehensive test suite for DynMatrix<T>
This test file provides exhaustive coverage of DynMatrix functionality:
Definition in file dynmat_test.cc.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 1058 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| allocate_reserves_all_entries | |||
| ) |
Definition at line 895 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::allocate(), and Aleph::maps().
| TEST | ( | DynMatrix | , |
| changing_default_affects_future_reads | |||
| ) |
Definition at line 617 of file dynmat_test.cc.
References Aleph::maps(), Aleph::DynMatrix< T >::read(), and Aleph::DynMatrix< T >::set_default_initial_value().
| TEST | ( | DynMatrix | , |
| constructor_throws_on_zero_dimensions | |||
| ) |
Definition at line 190 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| constructor_with_various_types | |||
| ) |
Definition at line 197 of file dynmat_test.cc.
References Aleph::DynList< T >::empty(), and Aleph::maps().
| TEST | ( | DynMatrix | , |
| copy_assignment_different_dimensions | |||
| ) |
Definition at line 306 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| copy_constructor_empty_matrix | |||
| ) |
Definition at line 230 of file dynmat_test.cc.
References Aleph::copy(), and Aleph::maps().
| TEST | ( | DynMatrix | , |
| default_constructor_creates_empty_matrix | |||
| ) |
Definition at line 161 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::cols(), Aleph::DynMatrix< T >::is_empty(), Aleph::maps(), Aleph::DynMatrix< T >::rows(), and Aleph::DynMatrix< T >::size().
| TEST | ( | DynMatrix | , |
| default_value_affects_unwritten_reads | |||
| ) |
Definition at line 609 of file dynmat_test.cc.
References Aleph::maps(), and Aleph::DynMatrix< T >::read().
| TEST | ( | DynMatrix | , |
| destructor_frees_all_memory | |||
| ) |
Definition at line 879 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::allocate(), Counted::constructions, Counted::destructions, Aleph::maps(), Counted::reset(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| equality_different_dimensions | |||
| ) |
Definition at line 642 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| equality_different_values | |||
| ) |
Definition at line 651 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| equality_same_matrices | |||
| ) |
Definition at line 633 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| fill_overwrites_existing_values | |||
| ) |
Definition at line 523 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::fill(), Aleph::maps(), Aleph::DynMatrix< T >::read(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| floating_point_matrix | |||
| ) |
Definition at line 1005 of file dynmat_test.cc.
References Aleph::maps(), Aleph::DynMatrix< T >::read(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| is_empty_true_for_default_constructed | |||
| ) |
Definition at line 409 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::is_empty(), and Aleph::maps().
| TEST | ( | DynMatrix | , |
| is_square_false_for_non_square_matrix | |||
| ) |
Definition at line 403 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::is_square(), and Aleph::maps().
| TEST | ( | DynMatrix | , |
| is_square_true_for_square_matrix | |||
| ) |
Definition at line 397 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::is_square(), and Aleph::maps().
| TEST | ( | DynMatrix | , |
| move_assignment_is_noexcept | |||
| ) |
Definition at line 333 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| move_constructor_empty_matrix | |||
| ) |
Definition at line 269 of file dynmat_test.cc.
References Aleph::HTList::is_empty(), and Aleph::maps().
| TEST | ( | DynMatrix | , |
| move_constructor_is_noexcept | |||
| ) |
Definition at line 277 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| parametrized_constructor_creates_correct_dimensions | |||
| ) |
Definition at line 170 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::cols(), Aleph::DynMatrix< T >::is_empty(), Aleph::DynMatrix< T >::is_square(), Aleph::maps(), Aleph::DynMatrix< T >::rows(), and Aleph::DynMatrix< T >::size().
| TEST | ( | DynMatrix | , |
| parametrized_constructor_with_custom_default_value | |||
| ) |
Definition at line 181 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::get_default_value(), Aleph::maps(), and Aleph::DynMatrix< T >::read().
| TEST | ( | DynMatrix | , |
| regression_equality_different_shaped_same_size | |||
| ) |
Definition at line 1035 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| regression_move_assignment_returns_reference | |||
| ) |
Definition at line 1044 of file dynmat_test.cc.
References Aleph::maps().
| TEST | ( | DynMatrix | , |
| single_column_matrix | |||
| ) |
Definition at line 937 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::cols(), Aleph::maps(), Aleph::DynMatrix< T >::read(), Aleph::DynMatrix< T >::rows(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| single_element_matrix | |||
| ) |
Definition at line 912 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::cols(), Aleph::DynMatrix< T >::is_square(), Aleph::maps(), Aleph::DynMatrix< T >::read(), Aleph::DynMatrix< T >::rows(), and Aleph::DynMatrix< T >::size().
| TEST | ( | DynMatrix | , |
| single_row_matrix | |||
| ) |
Definition at line 923 of file dynmat_test.cc.
References Aleph::DynMatrix< T >::cols(), Aleph::DynMatrix< T >::is_square(), Aleph::maps(), Aleph::DynMatrix< T >::read(), Aleph::DynMatrix< T >::rows(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| stress_copy_large_matrix | |||
| ) |
Definition at line 986 of file dynmat_test.cc.
References Aleph::copy(), LARGE_N, and Aleph::maps().
| TEST | ( | DynMatrix | , |
| stress_large_matrix | |||
| ) |
Definition at line 969 of file dynmat_test.cc.
References LARGE_N, Aleph::maps(), Aleph::DynMatrix< T >::read(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| string_matrix | |||
| ) |
Definition at line 1018 of file dynmat_test.cc.
References Aleph::maps(), Aleph::DynMatrix< T >::read(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| swap_exchanges_contents | |||
| ) |
Definition at line 342 of file dynmat_test.cc.
References Aleph::maps(), and Aleph::DynList< T >::swap().
| TEST | ( | DynMatrix | , |
| swap_is_noexcept | |||
| ) |
Definition at line 372 of file dynmat_test.cc.
References Aleph::maps(), and Aleph::DynList< T >::swap().
| TEST | ( | DynMatrix | , |
| swap_with_empty_matrix | |||
| ) |
Definition at line 361 of file dynmat_test.cc.
References Aleph::HTList::is_empty(), Aleph::maps(), and Aleph::DynList< T >::swap().
| TEST | ( | DynMatrix | , |
| transpose_sparse_matrix | |||
| ) |
Definition at line 563 of file dynmat_test.cc.
References Aleph::maps(), Aleph::DynMatrix< T >::transpose(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| type_aliases_are_correct | |||
| ) |
Definition at line 866 of file dynmat_test.cc.
| TEST | ( | DynMatrix | , |
| very_sparse_matrix | |||
| ) |
Definition at line 950 of file dynmat_test.cc.
References Aleph::maps(), Aleph::DynMatrix< T >::read(), and Aleph::DynMatrix< T >::write().
| TEST | ( | DynMatrix | , |
| write_with_move_semantics | |||
| ) |
Definition at line 466 of file dynmat_test.cc.
References Aleph::maps(), Aleph::DynMatrix< T >::read(), and Aleph::DynMatrix< T >::write().
| TEST_F | ( | FilledMatrix | , |
| all_returns_false_when_any_fails | |||
| ) |
Definition at line 835 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| all_returns_true_when_all_match | |||
| ) |
Definition at line 828 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| copy_assignment_replaces_contents | |||
| ) |
Definition at line 286 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | FilledMatrix | , |
| copy_assignment_self_assignment_is_safe | |||
| ) |
Definition at line 298 of file dynmat_test.cc.
References Aleph::maps(), and SMALL_N.
| TEST_F | ( | FilledMatrix | , |
| copy_constructor_creates_independent_copy | |||
| ) |
Definition at line 214 of file dynmat_test.cc.
References Aleph::copy(), Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | FilledMatrix | , |
| equality_with_copy | |||
| ) |
Definition at line 662 of file dynmat_test.cc.
References Aleph::copy(), and Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| exists_returns_false_when_not_found | |||
| ) |
Definition at line 848 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| exists_returns_true_when_found | |||
| ) |
Definition at line 842 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| foldl_accumulates | |||
| ) |
Definition at line 854 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, SMALL_N, and Aleph::sum().
| TEST_F | ( | FilledMatrix | , |
| for_each_visits_all | |||
| ) |
Definition at line 819 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, SMALL_N, and Aleph::sum().
| TEST_F | ( | FilledMatrix | , |
| iterator_visits_in_row_major_order | |||
| ) |
Definition at line 690 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | FilledMatrix | , |
| move_assignment_transfers_ownership | |||
| ) |
Definition at line 322 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| move_constructor_transfers_ownership | |||
| ) |
Definition at line 255 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| operator_parens_read_write | |||
| ) |
Definition at line 499 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| set_dimension_clears_data | |||
| ) |
Definition at line 580 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| transpose_swaps_dimensions | |||
| ) |
Definition at line 538 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | FilledMatrix | , |
| transpose_swaps_values | |||
| ) |
Definition at line 546 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | FilledMatrix | , |
| traverse_can_stop_early | |||
| ) |
Definition at line 763 of file dynmat_test.cc.
References Aleph::count(), and Aleph::maps().
| TEST_F | ( | FilledMatrix | , |
| traverse_visits_all_elements | |||
| ) |
Definition at line 744 of file dynmat_test.cc.
References Aleph::count(), Aleph::maps(), SMALL_M, SMALL_N, and Aleph::sum().
| TEST_F | ( | SmallIntMatrix | , |
| access_after_allocate | |||
| ) |
Definition at line 481 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| access_const_version | |||
| ) |
Definition at line 490 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| cols_returns_correct_value | |||
| ) |
Definition at line 387 of file dynmat_test.cc.
References Aleph::maps(), and SMALL_M.
| TEST_F | ( | SmallIntMatrix | , |
| copy_constructor_sparse_matrix | |||
| ) |
Definition at line 238 of file dynmat_test.cc.
References Aleph::copy(), and Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| fill_sets_all_entries | |||
| ) |
Definition at line 514 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | SmallIntMatrix | , |
| is_empty_false_for_initialized_matrix | |||
| ) |
Definition at line 415 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| iterator_basic_traversal | |||
| ) |
Definition at line 673 of file dynmat_test.cc.
References Aleph::count(), and Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| iterator_get_curr_throws_when_exhausted | |||
| ) |
Definition at line 707 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| iterator_next_throws_when_exhausted | |||
| ) |
Definition at line 718 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| iterator_reset | |||
| ) |
Definition at line 728 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| read_ne_no_bounds_check | |||
| ) |
Definition at line 459 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| read_throws_on_out_of_bounds | |||
| ) |
Definition at line 446 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | SmallIntMatrix | , |
| read_unwritten_entry_returns_default | |||
| ) |
Definition at line 431 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| rows_returns_correct_value | |||
| ) |
Definition at line 382 of file dynmat_test.cc.
References Aleph::maps(), and SMALL_N.
| TEST_F | ( | SmallIntMatrix | , |
| set_default_initial_value | |||
| ) |
Definition at line 602 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| set_dimension_preserves_default_value | |||
| ) |
Definition at line 590 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| size_returns_product_of_dimensions | |||
| ) |
Definition at line 392 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | SmallIntMatrix | , |
| traverse_allocated_visits_allocated_blocks | |||
| ) |
Definition at line 792 of file dynmat_test.cc.
References Aleph::count(), Aleph::maps(), and Aleph::sum().
| TEST_F | ( | SmallIntMatrix | , |
| traverse_on_sparse_matrix | |||
| ) |
Definition at line 777 of file dynmat_test.cc.
References Aleph::maps(), and Aleph::sum().
| TEST_F | ( | SmallIntMatrix | , |
| write_and_read_single_entry | |||
| ) |
Definition at line 424 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| write_returns_reference_to_entry | |||
| ) |
Definition at line 437 of file dynmat_test.cc.
References Aleph::maps().
| TEST_F | ( | SmallIntMatrix | , |
| write_throws_on_out_of_bounds | |||
| ) |
Definition at line 453 of file dynmat_test.cc.
References Aleph::maps(), SMALL_M, and SMALL_N.
| TEST_F | ( | SquareMatrix | , |
| transpose_diagonal_unchanged | |||
| ) |
Definition at line 555 of file dynmat_test.cc.
References Aleph::maps().
|
constexpr |
Definition at line 71 of file dynmat_test.cc.
|
constexpr |
Definition at line 70 of file dynmat_test.cc.
|
constexpr |
Definition at line 69 of file dynmat_test.cc.
|
constexpr |