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

Tests for Test Al Vector. More...

#include <gtest/gtest.h>
#include <al-vector.H>
#include <al-domain.H>
#include <ah-errors.H>
#include <cmath>
#include <string>
#include <type_traits>
#include <vector>
Include dependency graph for test_al_vector.cc:

Go to the source code of this file.

Classes

class  VectorTest
 

Functions

 TEST_F (VectorTest, DefaultConstructor)
 
 TEST_F (VectorTest, ConstructorWithCustomEpsilon)
 
 TEST_F (VectorTest, ConstructorFromDynList)
 
 TEST_F (VectorTest, ConstructorFromDynListSizeMismatch)
 
 TEST_F (VectorTest, CopyConstructor)
 
 TEST_F (VectorTest, MoveConstructor)
 
 TEST_F (VectorTest, CopyAssignment)
 
 TEST_F (VectorTest, CopyAssignmentSelfAssignment)
 
 TEST_F (VectorTest, MoveAssignment)
 
 TEST_F (VectorTest, SetAndGetEntry)
 
 TEST_F (VectorTest, SetEntryToZeroRemovesIt)
 
 TEST_F (VectorTest, SetEntriesWithInitializerLists)
 
 TEST_F (VectorTest, SetEntriesSizeMismatch)
 
 TEST_F (VectorTest, SearchEntry)
 
 TEST_F (VectorTest, GetEntryConst)
 
 TEST_F (VectorTest, EpsilonDefaultValue)
 
 TEST_F (VectorTest, SetEpsilon)
 
 TEST_F (VectorTest, EpsilonAffectsZeroComparison)
 
 TEST_F (VectorTest, AreEqual)
 
 TEST_F (VectorTest, VectorAddition)
 
 TEST_F (VectorTest, VectorAdditionInPlace)
 
 TEST_F (VectorTest, VectorSubtraction)
 
 TEST_F (VectorTest, VectorSubtractionInPlace)
 
 TEST_F (VectorTest, ScalarMultiplication)
 
 TEST_F (VectorTest, ScalarMultiplicationFromLeft)
 
 TEST_F (VectorTest, ScalarMultiplicationByZero)
 
 TEST_F (VectorTest, ScalarMultiplicationByOne)
 
 TEST_F (VectorTest, ScalarDivision)
 
 TEST_F (VectorTest, ScalarDivisionByZero)
 
 TEST_F (VectorTest, ScalarDivisionByOne)
 
 TEST_F (VectorTest, UnaryMinus)
 
 TEST_F (VectorTest, ScalarProduct)
 
 TEST_F (VectorTest, ScalarProductOperator)
 
 TEST_F (VectorTest, ScalarProductOrthogonalVectors)
 
 TEST_F (VectorTest, ScalarProductWithZeroVector)
 
 TEST_F (VectorTest, EqualityOperator)
 
 TEST_F (VectorTest, EqualityWithEpsilon)
 
 TEST_F (VectorTest, InequalityOperator)
 
 TEST_F (VectorTest, EqualityZeroVectors)
 
 TEST_F (VectorTest, ProxyReadAccess)
 
 TEST_F (VectorTest, ProxyWriteAccess)
 
 TEST_F (VectorTest, ProxyWriteZero)
 
 TEST_F (VectorTest, ProxyParenthesesOperator)
 
 TEST_F (VectorTest, ProxyAssignmentBetweenEntries)
 
 TEST_F (VectorTest, IteratorBasic)
 
 TEST_F (VectorTest, ToList)
 
 TEST_F (VectorTest, ToStr)
 
 TEST_F (VectorTest, StringDomain)
 
 TEST_F (VectorTest, StringDomainArithmetic)
 
 TEST_F (VectorTest, VerySmallEpsilon)
 
 TEST_F (VectorTest, NegativeValues)
 
 TEST_F (VectorTest, LargeValues)
 
 TEST_F (VectorTest, MixedOperations)
 
 TEST_F (VectorTest, ChainedOperations)
 
 TEST_F (VectorTest, MapAndFilter)
 
 TEST_F (VectorTest, GetDomain)
 
 TEST (VectorFloatTest, FloatType)
 
 TEST (VectorFloatTest, FloatArithmetic)
 
 TEST_F (VectorTest, ComprehensiveIntegrationTest)
 
 TEST (VectorProxy, AssigningAZeroEntryClearsTheTarget)
 
 TEST (VectorProxy, AssignsAnLvalue)
 
 TEST (VectorProxy, KeepsItsOwnKey)
 
 TEST (VectorProxy, ReadsWhatItWasAssigned)
 
 TEST (VectorProxy, SurvivesTheGrowthOfTheTable)
 
 TEST (Vector, IndexesAConstantVector)
 
 TEST (Vector, ToListFollowsTheKeys)
 
 TEST (Vector, KeepsATemporaryDomain)
 
 TEST (Vector, NeedsADomain)
 
int main (int argc, char **argv)
 

Detailed Description

Tests for Test Al Vector.

Comprehensive Google Test suite for al-vector.H.

This test suite covers all major functionality of the Vector class including:

  • Construction and initialization
  • Entry access and modification
  • Arithmetic operations
  • Comparison operations
  • Epsilon-based comparisons
  • Proxy access patterns
  • Edge cases and error conditions
  • Iterator support
  • Move and copy semantics

Definition in file test_al_vector.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1022 of file test_al_vector.cc.

◆ TEST() [1/11]

TEST ( Vector  ,
IndexesAConstantVector   
)

Definition at line 953 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST() [2/11]

◆ TEST() [3/11]

TEST ( Vector  ,
NeedsADomain   
)

Definition at line 1003 of file test_al_vector.cc.

◆ TEST() [4/11]

TEST ( Vector  ,
ToListFollowsTheKeys   
)

Definition at line 966 of file test_al_vector.cc.

References w.

◆ TEST() [5/11]

TEST ( VectorFloatTest  ,
FloatArithmetic   
)

◆ TEST() [6/11]

TEST ( VectorFloatTest  ,
FloatType   
)

◆ TEST() [7/11]

TEST ( VectorProxy  ,
AssigningAZeroEntryClearsTheTarget   
)

◆ TEST() [8/11]

TEST ( VectorProxy  ,
AssignsAnLvalue   
)

◆ TEST() [9/11]

TEST ( VectorProxy  ,
KeepsItsOwnKey   
)

Definition at line 902 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::get_entry(), and w.

◆ TEST() [10/11]

TEST ( VectorProxy  ,
ReadsWhatItWasAssigned   
)

Definition at line 919 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::get_entry().

◆ TEST() [11/11]

TEST ( VectorProxy  ,
SurvivesTheGrowthOfTheTable   
)

◆ TEST_F() [1/57]

TEST_F ( VectorTest  ,
AreEqual   
)

Definition at line 285 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::are_equal().

◆ TEST_F() [2/57]

TEST_F ( VectorTest  ,
ChainedOperations   
)

◆ TEST_F() [3/57]

TEST_F ( VectorTest  ,
ComprehensiveIntegrationTest   
)

◆ TEST_F() [4/57]

TEST_F ( VectorTest  ,
ConstructorFromDynList   
)

◆ TEST_F() [5/57]

TEST_F ( VectorTest  ,
ConstructorFromDynListSizeMismatch   
)

Definition at line 127 of file test_al_vector.cc.

References Aleph::DynList< T >::append().

◆ TEST_F() [6/57]

TEST_F ( VectorTest  ,
ConstructorWithCustomEpsilon   
)

Definition at line 106 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::get_epsilon().

◆ TEST_F() [7/57]

TEST_F ( VectorTest  ,
CopyAssignment   
)

◆ TEST_F() [8/57]

TEST_F ( VectorTest  ,
CopyAssignmentSelfAssignment   
)

◆ TEST_F() [9/57]

TEST_F ( VectorTest  ,
CopyConstructor   
)

◆ TEST_F() [10/57]

TEST_F ( VectorTest  ,
DefaultConstructor   
)

Definition at line 97 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::get_entry().

◆ TEST_F() [11/57]

TEST_F ( VectorTest  ,
EpsilonAffectsZeroComparison   
)

◆ TEST_F() [12/57]

TEST_F ( VectorTest  ,
EpsilonDefaultValue   
)

Definition at line 263 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::get_epsilon().

◆ TEST_F() [13/57]

TEST_F ( VectorTest  ,
EqualityOperator   
)

Definition at line 511 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST_F() [14/57]

TEST_F ( VectorTest  ,
EqualityWithEpsilon   
)

Definition at line 523 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST_F() [15/57]

TEST_F ( VectorTest  ,
EqualityZeroVectors   
)

Definition at line 543 of file test_al_vector.cc.

◆ TEST_F() [16/57]

TEST_F ( VectorTest  ,
GetDomain   
)

Definition at line 769 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::get_domain().

◆ TEST_F() [17/57]

TEST_F ( VectorTest  ,
GetEntryConst   
)

◆ TEST_F() [18/57]

TEST_F ( VectorTest  ,
InequalityOperator   
)

Definition at line 533 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST_F() [19/57]

TEST_F ( VectorTest  ,
IteratorBasic   
)

◆ TEST_F() [20/57]

TEST_F ( VectorTest  ,
LargeValues   
)

◆ TEST_F() [21/57]

TEST_F ( VectorTest  ,
MapAndFilter   
)

◆ TEST_F() [22/57]

TEST_F ( VectorTest  ,
MixedOperations   
)

◆ TEST_F() [23/57]

TEST_F ( VectorTest  ,
MoveAssignment   
)

◆ TEST_F() [24/57]

TEST_F ( VectorTest  ,
MoveConstructor   
)

◆ TEST_F() [25/57]

TEST_F ( VectorTest  ,
NegativeValues   
)

◆ TEST_F() [26/57]

TEST_F ( VectorTest  ,
ProxyAssignmentBetweenEntries   
)

Definition at line 591 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::get_entry().

◆ TEST_F() [27/57]

TEST_F ( VectorTest  ,
ProxyParenthesesOperator   
)

Definition at line 583 of file test_al_vector.cc.

◆ TEST_F() [28/57]

TEST_F ( VectorTest  ,
ProxyReadAccess   
)

Definition at line 554 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST_F() [29/57]

TEST_F ( VectorTest  ,
ProxyWriteAccess   
)

Definition at line 565 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::get_entry().

◆ TEST_F() [30/57]

◆ TEST_F() [31/57]

TEST_F ( VectorTest  ,
ScalarDivision   
)

◆ TEST_F() [32/57]

TEST_F ( VectorTest  ,
ScalarDivisionByOne   
)

◆ TEST_F() [33/57]

TEST_F ( VectorTest  ,
ScalarDivisionByZero   
)

Definition at line 416 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST_F() [34/57]

TEST_F ( VectorTest  ,
ScalarMultiplication   
)

◆ TEST_F() [35/57]

TEST_F ( VectorTest  ,
ScalarMultiplicationByOne   
)

◆ TEST_F() [36/57]

TEST_F ( VectorTest  ,
ScalarMultiplicationByZero   
)

◆ TEST_F() [37/57]

TEST_F ( VectorTest  ,
ScalarMultiplicationFromLeft   
)

◆ TEST_F() [38/57]

TEST_F ( VectorTest  ,
ScalarProduct   
)

◆ TEST_F() [39/57]

TEST_F ( VectorTest  ,
ScalarProductOperator   
)

Definition at line 466 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST_F() [40/57]

TEST_F ( VectorTest  ,
ScalarProductOrthogonalVectors   
)

Definition at line 481 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST_F() [41/57]

TEST_F ( VectorTest  ,
ScalarProductWithZeroVector   
)

Definition at line 495 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entry().

◆ TEST_F() [42/57]

TEST_F ( VectorTest  ,
SearchEntry   
)

◆ TEST_F() [43/57]

TEST_F ( VectorTest  ,
SetAndGetEntry   
)

◆ TEST_F() [44/57]

TEST_F ( VectorTest  ,
SetEntriesSizeMismatch   
)

Definition at line 231 of file test_al_vector.cc.

References Aleph::Vector< T, NumType >::set_entries().

◆ TEST_F() [45/57]

TEST_F ( VectorTest  ,
SetEntriesWithInitializerLists   
)

◆ TEST_F() [46/57]

◆ TEST_F() [47/57]

TEST_F ( VectorTest  ,
SetEpsilon   
)

◆ TEST_F() [48/57]

TEST_F ( VectorTest  ,
StringDomain   
)

◆ TEST_F() [49/57]

TEST_F ( VectorTest  ,
StringDomainArithmetic   
)

◆ TEST_F() [50/57]

◆ TEST_F() [51/57]

TEST_F ( VectorTest  ,
ToStr   
)

◆ TEST_F() [52/57]

TEST_F ( VectorTest  ,
UnaryMinus   
)

◆ TEST_F() [53/57]

TEST_F ( VectorTest  ,
VectorAddition   
)

◆ TEST_F() [54/57]

TEST_F ( VectorTest  ,
VectorAdditionInPlace   
)

◆ TEST_F() [55/57]

TEST_F ( VectorTest  ,
VectorSubtraction   
)

◆ TEST_F() [56/57]

TEST_F ( VectorTest  ,
VectorSubtractionInPlace   
)

◆ TEST_F() [57/57]

TEST_F ( VectorTest  ,
VerySmallEpsilon   
)