Loading...
Searching...
No Matches
PackedArrayTest Class Reference
Inheritance diagram for PackedArrayTest:
[legend]
Collaboration diagram for PackedArrayTest:
[legend]

## Public Member Functions

| PackedArrayTest (const char *title)
void | testBool ()
void | test2Bit ()
void | test4Bit ()
void | testResize ()
void | test ()
Public Member Functions inherited from UnitTest
| UnitTest (const char *title)
void | test ()
int | getPassCount ()
int | getFailureCount ()
const std::string | getTitle () const
| UnitTest (const char *title)
void | test ()
int | getPassCount ()
int | getFailureCount ()
const std::string | getTitle () const

## Additional Inherited Members

Protected Attributes inherited from UnitTest
std::string | m_title
int | m_failures
int | m_testNum

## Detailed Description

Definition at line 27 of file PackedVectorTest.cpp.

## Constructor & Destructor Documentation

## PackedArrayTest()

PackedArrayTest::PackedArrayTest | ( | const char * | title | ) |

inline

Definition at line 30 of file PackedVectorTest.cpp.

: UnitTest(title) {;}
UnitTest
Definition MemoryMapArrayTest.h:21

## Member Function Documentation

## test()

void PackedArrayTest::test | ( |  | ) |

inline

Definition at line 36 of file PackedVectorTest.cpp.

{
testBool();
test2Bit();
test4Bit();
testResize();
}

## test2Bit()

void PackedArrayTest::test2Bit | ( | void |  | ) |

Definition at line 73 of file PackedVectorTest.cpp.

{
PackedVector2Bit_t testVector;
testVector.resize(11);
testVector.set(0,0);
testVector.set(1,1);
testVector.set(2,2);
testVector.set(3,3);
testVector.set(4,3);
testVector.set(5,2);
testVector.set(6,1);
testVector.set(7,0);
testVector.set(8,2);
testVector.set(9,1);
testVector.set(10,3);
check(m_failures, ++m_testNum, "Access 2 bit element 0", 0U, testVector[0]);
check(m_failures, ++m_testNum, "Access 2 bit element 1", 1U, testVector[1]);
check(m_failures, ++m_testNum, "Access 2 bit element 2", 2U, testVector[2]);
check(m_failures, ++m_testNum, "Access 2 bit element 3", 3U, testVector[3]);
check(m_failures, ++m_testNum, "Access 2 bit element 4", 3U, testVector[4]);
check(m_failures, ++m_testNum, "Access 2 bit element 5", 2U, testVector[5]);
check(m_failures, ++m_testNum, "Access 2 bit element 6", 1U, testVector[6]);
check(m_failures, ++m_testNum, "Access 2 bit element 7", 0U, testVector[7]);
check(m_failures, ++m_testNum, "Access 2 bit element 8", 2U, testVector[8]);
check(m_failures, ++m_testNum, "Access 2 bit element 9", 1U, testVector[9]);
check(m_failures, ++m_testNum, "Access 2 bit element 10", 3U, testVector[10]);
}
PackedVector
Definition PackedVector.h:42

## test4Bit()

void PackedArrayTest::test4Bit | ( | void |  | ) |

Definition at line 102 of file PackedVectorTest.cpp.

{
PackedVector4Bit_t testVector;
testVector.resize(11);
testVector.set(0,0);
testVector.set(1,1);
testVector.set(2,2);
testVector.set(3,3);
testVector.set(4,4);
testVector.set(5,5);
testVector.set(6,6);
testVector.set(7,7);
testVector.set(8,8);
testVector.set(9,9);
testVector.set(10,10);
check(m_failures, ++m_testNum, "Access 4 bit element 0", 0U, testVector[0]);
check(m_failures, ++m_testNum, "Access 4 bit element 1", 1U, testVector[1]);
check(m_failures, ++m_testNum, "Access 4 bit element 2", 2U, testVector[2]);
check(m_failures, ++m_testNum, "Access 4 bit element 3", 3U, testVector[3]);
check(m_failures, ++m_testNum, "Access 4 bit element 4", 4U, testVector[4]);
check(m_failures, ++m_testNum, "Access 4 bit element 5", 5U, testVector[5]);
check(m_failures, ++m_testNum, "Access 4 bit element 6", 6U, testVector[6]);
check(m_failures, ++m_testNum, "Access 4 bit element 7", 7U, testVector[7]);
check(m_failures, ++m_testNum, "Access 4 bit element 8", 8U, testVector[8]);
check(m_failures, ++m_testNum, "Access 4 bit element 9", 9U, testVector[9]);
check(m_failures, ++m_testNum, "Access 4 bit element 10", 10U, testVector[10]);
}

## testBool()

void PackedArrayTest::testBool | ( | void |  | ) |

Definition at line 44 of file PackedVectorTest.cpp.

{
PackedVectorBool_t testVector;
testVector.resize(11);
testVector.set(0,0);
testVector.set(1,1);
testVector.set(2,0);
testVector.set(3,1);
testVector.set(4,1);
testVector.set(5,0);
testVector.set(6,1);
testVector.set(7,0);
testVector.set(8,0);
testVector.set(9,0);
testVector.set(10,1);
check(m_failures, ++m_testNum, "Access 1 bit element 0", 0U, testVector[0]);
check(m_failures, ++m_testNum, "Access 1 bit element 1", 1U, testVector[1]);
check(m_failures, ++m_testNum, "Access 1 bit element 2", 0U, testVector[2]);
check(m_failures, ++m_testNum, "Access 1 bit element 3", 1U, testVector[3]);
check(m_failures, ++m_testNum, "Access 1 bit element 4", 1U, testVector[4]);
check(m_failures, ++m_testNum, "Access 1 bit element 5", 0U, testVector[5]);
check(m_failures, ++m_testNum, "Access 1 bit element 6", 1U, testVector[6]);
check(m_failures, ++m_testNum, "Access 1 bit element 7", 0U, testVector[7]);
check(m_failures, ++m_testNum, "Access 1 bit element 8", 0U, testVector[8]);
check(m_failures, ++m_testNum, "Access 1 bit element 9", 0U, testVector[9]);
check(m_failures, ++m_testNum, "Access 1 bit element 10", 1U, testVector[10]);
}

## testResize()

void PackedArrayTest::testResize | ( | void |  | ) |

Definition at line 132 of file PackedVectorTest.cpp.

{
PackedVector4Bit_t testVector;
testVector.resize(0);
check(m_failures, ++m_testNum, "New size is 0", 0U, testVector.size());
testVector.push_back(0);
testVector.push_back(1);
testVector.push_back(2);
testVector.push_back(3);
testVector.push_back(4);
testVector.push_back(5);
testVector.push_back(6);
testVector.push_back(7);
testVector.push_back(8);
testVector.push_back(9);
testVector.push_back(10);
check(m_failures, ++m_testNum, "New size is 11", 11U, testVector.size());
check(m_failures, ++m_testNum, "Access 4 bit element 0", 0U, testVector[0]);
check(m_failures, ++m_testNum, "Access 4 bit element 1", 1U, testVector[1]);
check(m_failures, ++m_testNum, "Access 4 bit element 2", 2U, testVector[2]);
check(m_failures, ++m_testNum, "Access 4 bit element 3", 3U, testVector[3]);
check(m_failures, ++m_testNum, "Access 4 bit element 4", 4U, testVector[4]);
check(m_failures, ++m_testNum, "Access 4 bit element 5", 5U, testVector[5]);
check(m_failures, ++m_testNum, "Access 4 bit element 6", 6U, testVector[6]);
check(m_failures, ++m_testNum, "Access 4 bit element 7", 7U, testVector[7]);
check(m_failures, ++m_testNum, "Access 4 bit element 8", 8U, testVector[8]);
check(m_failures, ++m_testNum, "Access 4 bit element 9", 9U, testVector[9]);
check(m_failures, ++m_testNum, "Access 4 bit element 10", 10U, testVector[10]);
}

The documentation for this class was generated from the following file:

- general/test/packedVectorTest/PackedVectorTest.cpp