blob: be49a1d1cc348573159490836e85ec06f2147259 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#include "number.h"
#include "packedintarray.h"
#include <bu/sio.h>
using namespace Bu;
void packedtest1()
{
println("-==- Packed Int Test -==-");
PackedIntArray a(4);
a.append( 3 );
a.append( 9 );
a.append( 5 );
println("%1").arg( a.toString() );
println("%1").arg( a.toBitString() );
println("%1").arg( PackedIntArray(4, 10).toString() );
PackedIntArray b(5);
for( int j = 0; j < 16; j++ )
{
b.append( 21 );
if( b[j] != 21 )
{
println("Error at position %1").arg( j );
println("Raw: %1 (%2)").arg( b.toBitString() ).arg( b.toString() );
}
}
}
void numbertest1()
{
println("-==- Number test -==-");
Number a("523");
Number b("498");
println("%1 + %2 = %3").
arg( a.toString() ).
arg( b.toString() ).
arg( (a + b).toString() );
}
int main( int argc, char *argv[] )
{
println("CliC");
packedtest1();
// numbertest1();
return 0;
}
|