ReactOS  0.4.15-dev-5097-g328cc41
UnaryTest Class Reference
Inheritance diagram for UnaryTest:
Collaboration diagram for UnaryTest:

Protected Member Functions

void ucompos1 ()
 
void ucompos2 ()
 
void unegate1 ()
 
void unegate2 ()
 
void unegate3 ()
 

Private Member Functions

 CPPUNIT_TEST_SUITE (UnaryTest)
 
 CPPUNIT_TEST (ucompos1)
 
 CPPUNIT_TEST (ucompos2)
 
 CPPUNIT_TEST (unegate1)
 
 CPPUNIT_TEST (unegate2)
 
 CPPUNIT_TEST (unegate3)
 
 CPPUNIT_TEST_SUITE_END ()
 

Private Attributes

 CPPUNIT_IGNORE
 
 CPPUNIT_STOP_IGNORE
 

Detailed Description

Definition at line 14 of file unary_test.cpp.

Member Function Documentation

◆ CPPUNIT_TEST() [1/5]

UnaryTest::CPPUNIT_TEST ( ucompos1  )
private

◆ CPPUNIT_TEST() [2/5]

UnaryTest::CPPUNIT_TEST ( ucompos2  )
private

◆ CPPUNIT_TEST() [3/5]

UnaryTest::CPPUNIT_TEST ( unegate1  )
private

◆ CPPUNIT_TEST() [4/5]

UnaryTest::CPPUNIT_TEST ( unegate2  )
private

◆ CPPUNIT_TEST() [5/5]

UnaryTest::CPPUNIT_TEST ( unegate3  )
private

◆ CPPUNIT_TEST_SUITE()

UnaryTest::CPPUNIT_TEST_SUITE ( UnaryTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

UnaryTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ ucompos1()

void UnaryTest::ucompos1 ( )
protected

Definition at line 73 of file unary_test.cpp.

74 {
75 #if defined (STLPORT) && !defined (_STLP_NO_EXTENSIONS)
76  int input [3] = { -1, -4, -16 };
77 
78  double output[3];
80 
81  CPPUNIT_ASSERT(output[0]==1);
82  CPPUNIT_ASSERT(output[1]==2);
83  CPPUNIT_ASSERT(output[2]==4);
84 #endif
85 }
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLenum GLenum GLenum input
Definition: glext.h:9031
GLuint GLenum GLenum transform
Definition: glext.h:9407

◆ ucompos2()

void UnaryTest::ucompos2 ( )
protected

Definition at line 86 of file unary_test.cpp.

87 {
88 #if defined (STLPORT) && !defined (_STLP_NO_EXTENSIONS)
89  int input [3] = { -1, -4, -16 };
90 
91  double output [3];
92  transform((int*)input, (int*)input + 3, output, compose1(square_root(), negate<int>()));
93 
94  CPPUNIT_ASSERT(output[0]==1);
95  CPPUNIT_ASSERT(output[1]==2);
96  CPPUNIT_ASSERT(output[2]==4);
97 #endif
98 }
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
unary_compose< _Operation1, _Operation2 > compose1(const _Operation1 &__fn1, const _Operation2 &__fn2)
Definition: _function.h:285
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLenum GLenum GLenum input
Definition: glext.h:9031
GLuint GLenum GLenum transform
Definition: glext.h:9407

◆ unegate1()

void UnaryTest::unegate1 ( )
protected

Definition at line 44 of file unary_test.cpp.

45 {
46  int array [3] = { 1, 2, 3 };
47  //unary_negate<odd>::argument_type arg_val = 0;
48  int* p = find_if((int*)array, (int*)array + 3, unary_negate<odd>(odd()));
49  CPPUNIT_ASSERT((p != array + 3));
50  CPPUNIT_ASSERT(*p==2);
51 }
_STLP_MOVE_TO_STD_NAMESPACE _InputIter find_if(_InputIter __first, _InputIter __last, _Predicate __pred)
Definition: _algobase.c:214
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLfloat GLfloat p
Definition: glext.h:8902
#define odd(x)
Definition: bidi.c:51

◆ unegate2()

void UnaryTest::unegate2 ( )
protected

Definition at line 52 of file unary_test.cpp.

53 {
54  int array [3] = { 1, 2, 3 };
55  int* p = find_if((int*)array, (int*)array + 3, not1(odd()));
56  CPPUNIT_ASSERT(p != array + 3);
57  CPPUNIT_ASSERT(*p==2);
58 }
_STLP_MOVE_TO_STD_NAMESPACE _InputIter find_if(_InputIter __first, _InputIter __last, _Predicate __pred)
Definition: _algobase.c:214
unary_negate< _Predicate > not1(const _Predicate &__pred)
Definition: _function.h:154
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
GLfloat GLfloat p
Definition: glext.h:8902
#define odd(x)
Definition: bidi.c:51

◆ unegate3()

void UnaryTest::unegate3 ( )
protected

Definition at line 63 of file unary_test.cpp.

64 {
65 #if !defined (STLPORT) || defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
66  int array [3] = { 1, 2, 3 };
67  int* p = find_if((int*)array, (int*)array + 3, not1(ptr_fun(test_func)));
68  CPPUNIT_ASSERT(p != array + 3);
69  CPPUNIT_ASSERT(*p==3);
70 #endif
71 }
pointer_to_unary_function< _Arg, _Result > ptr_fun(_Result(*__f)(_Arg))
_STLP_MOVE_TO_STD_NAMESPACE _InputIter find_if(_InputIter __first, _InputIter __last, _Predicate __pred)
Definition: _algobase.c:214
unary_negate< _Predicate > not1(const _Predicate &__pred)
Definition: _function.h:154
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
bool test_func(int param)
Definition: unary_test.cpp:60
GLfloat GLfloat p
Definition: glext.h:8902

Member Data Documentation

◆ CPPUNIT_IGNORE

UnaryTest::CPPUNIT_IGNORE
private

Definition at line 18 of file unary_test.cpp.

◆ CPPUNIT_STOP_IGNORE

UnaryTest::CPPUNIT_STOP_IGNORE
private

Definition at line 22 of file unary_test.cpp.


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