/[cvs]/api/Classes/Examples/Array/ArrayTest.cpp
ViewVC logotype

Annotation of /api/Classes/Examples/Array/ArrayTest.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Sun Jul 1 20:47:58 2001 UTC (23 years, 4 months ago) by bearsoft
Branch point for: lazy, MAIN
Initial revision

1 bearsoft 1.1 #include "../../String/String.h"
2     #include "../../String/StringInput.h"
3     #include "../../System/System.h"
4     #include "../../Array/IntArray.h"
5     #include "../../Array/FloatArray.h"
6     #include "ArrayTest.h"
7     #include "../../System/SystemDefine.h"
8    
9    
10     ArrayTest::ArrayTest(){}
11     ArrayTest::~ArrayTest(){}
12    
13     void ArrayTest::run()
14     {
15     IntArray *intArray=new IntArray(3);
16    
17     intArray->setInt(2,0);
18     intArray->setInt(1,1);
19     intArray->setInt(3,2);
20    
21     String arrayInfo="intValue: ";
22    
23     for ( int r=0; r<intArray->size ; r++ )
24     {
25     System::println(arrayInfo + "nonSorted " + intArray->getInt(r));
26     }
27    
28     intArray->sortSmallestOrder();
29    
30     for ( int r2=0; r2<intArray->size ; r2++ )
31     {
32     System::println(arrayInfo + " sorted " + intArray->getInt(r2));
33     }
34    
35    
36     delete intArray;
37    
38    
39     IntArray *intArray2=new IntArray();
40    
41     intArray2->addLast(2);
42     intArray2->addLast(1);
43     intArray2->addLast(3);
44    
45     String arrayInfo2="intValue: ";
46    
47     for ( int t=0; t<intArray2->size ; t++ )
48     {
49     System::println(arrayInfo2 + "nonSorted " + intArray2->getInt(t));
50     }
51    
52     intArray2->sortLargestOrder();
53    
54     for ( int t2=0; t2<intArray2->size ; t2++ )
55     {
56     System::println(arrayInfo2 + " sorted " + intArray2->getInt(t2));
57     }
58    
59    
60     delete intArray2;
61    
62    
63    
64    
65     }

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26