ReactOS  0.4.15-dev-1150-g593bcce
test_algobase.cpp
Go to the documentation of this file.
1 /***********************************************************************************
2  test_algobase.cpp
3 
4  * Copyright (c) 1997
5  * Mark of the Unicorn, Inc.
6  *
7  * Permission to use, copy, modify, distribute and sell this software
8  * and its documentation for any purpose is hereby granted without fee,
9  * provided that the above copyright notice appear in all copies and
10  * that both that copyright notice and this permission notice appear
11  * in supporting documentation. Mark of the Unicorn makes no
12  * representations about the suitability of this software for any
13  * purpose. It is provided "as is" without express or implied warranty.
14 
15 ***********************************************************************************/
16 
17 # include "Prefix.h"
18 # if defined (EH_NEW_HEADERS)
19 # ifdef __SUNPRO_CC
20 # include <stdio.h>
21 # endif
22 #include <algorithm>
23 # else
24 #include <algo.h>
25 # endif
26 #include "Tests.h"
27 #include "LeakCheck.h"
28 #include "TestClass.h"
29 
30 // EH_USE_STD
31 
32 enum { kBufferSize = 100 };
33 
35 {
38  gTestController.SetCurrentTestName("uninitialized_copy()");
39  }
40 
42 
43  void operator()( TestClass* buffer ) const
44  {
48  }
49 
50 private:
53 };
54 
56 {
58  gTestController.SetCurrentTestName("uninitialized_fill()");
59  }
60 
61  void operator()( TestClass* buffer ) const
62  {
63  TestClass* buf_end = buffer + kBufferSize;
65  for ( EH_CSTD::size_t i = 0; i < kBufferSize; i++ )
66  EH_ASSERT( buffer[i] == testValue );
67  stl_destroy( buffer, buf_end );
68  }
69 private:
71 };
72 
74 {
76  gTestController.SetCurrentTestName("uninitialized_fill_n()");
77  }
78  void operator()( TestClass* buffer ) const
79  {
82  for ( EH_CSTD::size_t i = 0; i < kBufferSize; i++ )
83  EH_ASSERT( buffer[i] == testValue );
85  }
86 private:
88 };
89 
91 {
92  // force alignment
93  double arr[ sizeof(TestClass) * kBufferSize ];
94  TestClass* c = (TestClass*)arr;
98 }
#define new(TYPE, numElems)
Definition: treelist.c:54
TestController gTestController
Definition: nc_alloc.cpp:46
void WeakCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:65
#define equal(x, y)
Definition: reader.cc:56
GLuint buffer
Definition: glext.h:5915
GLuint GLuint end
Definition: gl.h:1545
void operator()(TestClass *buffer) const
static void SetCurrentTestName(const char *str)
Definition: nc_alloc.h:172
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
void operator()(TestClass *buffer) const
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result)
__kernel_size_t size_t
Definition: linux.h:237
void operator()(TestClass *buffer) const
const GLubyte * c
Definition: glext.h:8905
#define EH_ASSERT
Definition: Prefix.h:37
_STLP_MOVE_TO_STD_NAMESPACE void uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp &__x)
#define stl_destroy
Definition: Prefix.h:114
_STLP_MOVE_TO_STD_NAMESPACE void uninitialized_fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__x)
void test_algobase()