ReactOS 0.4.16-dev-178-g8ba6102
LogicTest Class Reference
Inheritance diagram for LogicTest:
Collaboration diagram for LogicTest:

Protected Member Functions

void logicand ()
 
void logicnot ()
 
void logicor ()
 

Private Member Functions

 CPPUNIT_TEST_SUITE (LogicTest)
 
 CPPUNIT_TEST (logicand)
 
 CPPUNIT_TEST (logicnot)
 
 CPPUNIT_TEST (logicor)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 14 of file logic_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/3]

LogicTest::CPPUNIT_TEST ( logicand  )
private

◆ CPPUNIT_TEST() [2/3]

LogicTest::CPPUNIT_TEST ( logicnot  )
private

◆ CPPUNIT_TEST() [3/3]

LogicTest::CPPUNIT_TEST ( logicor  )
private

◆ CPPUNIT_TEST_SUITE()

LogicTest::CPPUNIT_TEST_SUITE ( LogicTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

LogicTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ logicand()

void LogicTest::logicand ( )
protected

Definition at line 33 of file logic_test.cpp.

34{
35 bool input1 [4] = { true, true, false, true };
36 bool input2 [4] = { false, true, false, false };
37
38 bool output [4];
39 transform((bool*)input1, (bool*)input1 + 4, (bool*)input2, (bool*)output, logical_and<bool>());
40
41 CPPUNIT_ASSERT(output[0]==false);
42 CPPUNIT_ASSERT(output[1]==true);
43 CPPUNIT_ASSERT(output[2]==false);
44 CPPUNIT_ASSERT(output[3]==false);
45}
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLuint GLenum GLenum transform
Definition: glext.h:9407

◆ logicnot()

void LogicTest::logicnot ( )
protected

Definition at line 46 of file logic_test.cpp.

47{
48 bool input [7] = { 1, 0, 0, 1, 1, 1, 1 };
49
50 int n = count_if(input, input + 7, logical_not<bool>());
51 CPPUNIT_ASSERT( n == 2 );
52}
_STLP_INLINE_LOOP void count_if(_InputIter __first, _InputIter __last, _Predicate __pred, _Size &__n)
Definition: _algo.h:115
GLdouble n
Definition: glext.h:7729
GLenum GLenum GLenum input
Definition: glext.h:9031

◆ logicor()

void LogicTest::logicor ( )
protected

Definition at line 53 of file logic_test.cpp.

54{
55 bool input1 [4] = { true, true, false, true };
56 bool input2 [4] = { false, true, false, false };
57
58 bool output [4];
59 transform((bool*)input1, (bool*)input1 + 4, (bool*)input2, (bool*)output, logical_or<bool>());
60
61 CPPUNIT_ASSERT(output[0]==true);
62 CPPUNIT_ASSERT(output[1]==true);
63 CPPUNIT_ASSERT(output[2]==false);
64 CPPUNIT_ASSERT(output[3]==true);
65}

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