ReactOS 0.4.16-dev-122-g325d74c
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
32enum { kBufferSize = 100 };
33
35{
38 gTestController.SetCurrentTestName("uninitialized_copy()");
39 }
40
42
44 {
45 EH_STD::uninitialized_copy((TestClass*)stuff, (TestClass*)end_of_stuff, buffer );
46 EH_ASSERT( EH_STD::equal( (TestClass*)stuff, (TestClass*)end_of_stuff, buffer ) );
48 }
49
50private:
53};
54
56{
58 gTestController.SetCurrentTestName("uninitialized_fill()");
59 }
60
62 {
63 TestClass* buf_end = buffer + kBufferSize;
64 EH_STD::uninitialized_fill( buffer, buf_end, testValue );
65 for ( EH_CSTD::size_t i = 0; i < kBufferSize; i++ )
67 stl_destroy( buffer, buf_end );
68 }
69private:
71};
72
74{
76 gTestController.SetCurrentTestName("uninitialized_fill_n()");
77 }
79 {
81 EH_STD::uninitialized_fill_n( buffer, (EH_CSTD::size_t)kBufferSize, testValue );
82 for ( EH_CSTD::size_t i = 0; i < kBufferSize; i++ )
85 }
86private:
88};
89
91{
92 // force alignment
93 double arr[ sizeof(TestClass) * kBufferSize ];
94 TestClass* c = (TestClass*)arr;
98}
void WeakCheck(const Value &v, const Operation &op, long max_iters=2000000)
Definition: LeakCheck.h:65
#define EH_ASSERT
Definition: Prefix.h:37
#define stl_destroy
Definition: Prefix.h:114
GLuint GLuint end
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
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
TestController gTestController
Definition: nc_alloc.cpp:46
static void SetCurrentTestName(const char *str)
Definition: nc_alloc.h:172
void operator()(TestClass *buffer) const
void operator()(TestClass *buffer) const
void operator()(TestClass *buffer) const
void test_algobase()
@ kBufferSize
#define new(TYPE, numElems)
Definition: treelist.c:54