ReactOS 0.4.15-dev-7934-g1dc8d80
BoundTest Class Reference
Inheritance diagram for BoundTest:
Collaboration diagram for BoundTest:

Protected Member Functions

void lwrbnd1 ()
 
void lwrbnd2 ()
 
void uprbnd1 ()
 
void uprbnd2 ()
 

Static Protected Member Functions

static bool char_str_less (const char *a_, const char *b_)
 

Private Member Functions

 CPPUNIT_TEST_SUITE (BoundTest)
 
 CPPUNIT_TEST (lwrbnd1)
 
 CPPUNIT_TEST (lwrbnd2)
 
 CPPUNIT_TEST (uprbnd1)
 
 CPPUNIT_TEST (uprbnd2)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 13 of file bound_test.cpp.

Member Function Documentation

◆ char_str_less()

static bool BoundTest::char_str_less ( const char a_,
const char b_ 
)
inlinestaticprotected

Definition at line 28 of file bound_test.cpp.

29 {
30 return strcmp(a_, b_) < 0 ? 1 : 0;
31 }
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by lwrbnd2(), and uprbnd2().

◆ CPPUNIT_TEST() [1/4]

BoundTest::CPPUNIT_TEST ( lwrbnd1  )
private

◆ CPPUNIT_TEST() [2/4]

BoundTest::CPPUNIT_TEST ( lwrbnd2  )
private

◆ CPPUNIT_TEST() [3/4]

BoundTest::CPPUNIT_TEST ( uprbnd1  )
private

◆ CPPUNIT_TEST() [4/4]

BoundTest::CPPUNIT_TEST ( uprbnd2  )
private

◆ CPPUNIT_TEST_SUITE()

BoundTest::CPPUNIT_TEST_SUITE ( BoundTest  )
private

◆ CPPUNIT_TEST_SUITE_END()

BoundTest::CPPUNIT_TEST_SUITE_END ( )
private

◆ lwrbnd1()

void BoundTest::lwrbnd1 ( )
protected

Definition at line 59 of file bound_test.cpp.

60{
61 vector <int> v1(20);
62 for (int i = 0; (size_t)i < v1.size(); ++i)
63 {
64 v1[i] = i/4;
65 }
66 // 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4
67 vector<int>::iterator location = lower_bound(v1.begin(), v1.end(), 3);
68
69 CPPUNIT_ASSERT((location - v1.begin())==12);
70}
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algo.h:481
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
__kernel_size_t size_t
Definition: linux.h:237
GLfloat GLfloat v1
Definition: glext.h:6062
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
value_type * iterator
Definition: _vector.h:124

◆ lwrbnd2()

void BoundTest::lwrbnd2 ( )
protected

Definition at line 72 of file bound_test.cpp.

73{
74 char const* str [] = { "a", "a", "b", "b", "q", "w", "z" };
75
76 const unsigned strCt = sizeof(str)/sizeof(str[0]);
77 char const** location = lower_bound((char const**)str, (char const**)str + strCt, (const char *)"d", char_str_less);
78
79 CPPUNIT_ASSERT((location - str) == 4);
80}
static bool char_str_less(const char *a_, const char *b_)
Definition: bound_test.cpp:28
const WCHAR * str

◆ uprbnd1()

void BoundTest::uprbnd1 ( )
protected

Definition at line 39 of file bound_test.cpp.

40{
41 int arr[20];
42 for(int i = 0; i < 20; i++)
43 {
44 arr[i] = i/4;
45 }
46 int location = upper_bound((int*)arr, (int*)arr + 20, 3) - arr;
48}
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algo.h:507

◆ uprbnd2()

void BoundTest::uprbnd2 ( )
protected

Definition at line 50 of file bound_test.cpp.

51{
52 char const* str [] = { "a", "a", "b", "b", "q", "w", "z" };
53
54 const unsigned strCt = sizeof(str)/sizeof(str[0]);
55
56 int location = (upper_bound((char const**)str, (char const**)str + strCt, (const char *)"d", char_str_less) - str);
58}

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