0023726: Wrong usage of NCollection_StdAllocator<void> in QANColStdAllocator2
[occt.git] / src / QANCollection / QANCollection_Common.cxx
1 // Created on: 2002-04-30
2 // Created by: Alexander KARTOMIN (akm)
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20 // Purpose:     To test all methods of all NCollection classes
21
22 #include <QANCollection_Common.hxx>
23 #include <stdio.h>
24
25 void PrintItem(const gp_Pnt& thePnt)
26 {
27   printf ("   (%5.1f %5.1f %5.1f)\n", thePnt.X(), thePnt.Y(), thePnt.Z());
28 }
29
30 void PrintItem(const Standard_Real theDbl)
31 {
32   printf ("   (%5.1f)\n", theDbl);
33 }
34
35 void Random (Standard_Real& theValue)
36 {
37   static Standard_Real dfV=0.14159265358979323846;
38   dfV *= 37.;
39   dfV -= Floor(dfV);
40   theValue = dfV;
41   //theValue=drand48();
42 }
43
44 void Random (Standard_Integer& theValue,
45              const Standard_Integer theMax)
46 {
47   Standard_Real dfR;
48   Random(dfR);
49   theValue = RealToInt(theMax*dfR);
50 }
51
52 void Random (gp_Pnt& thePnt)
53 {
54   // thePnt.SetCoord(drand48(),drand48(),drand48());
55   Standard_Real dfX, dfY, dfZ;
56   Random(dfX);
57   Random(dfY);
58   Random(dfZ);
59   thePnt.SetCoord(dfX,dfY,dfZ);
60 }