-
Notifications
You must be signed in to change notification settings - Fork 11
/
Tests.cpp
65 lines (47 loc) · 1.28 KB
/
Tests.cpp
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
55
56
57
58
59
60
61
62
63
64
65
/*
* Tests.cpp
* stackimport
*
* Created by Mr. Z. on 10/06/06.
* Copyright 2006 Mr Z. All rights reserved.
*
*/
#include "CStackFile.h"
#include <assert.h>
void RunTests()
{
CStackBlockIdentifier a( "TEST", 1 );
CStackBlockIdentifier b( "TEST", 2 );
CStackBlockIdentifier wildcardYes( "TEST" );
CStackBlockIdentifier wildcardNo( "TOON" );
// ==
assert((a == b) == false);
assert(a == wildcardYes);
assert(wildcardYes == a);
assert(b == wildcardYes);
assert(b == wildcardYes);
assert((a == wildcardNo) == false);
assert((wildcardNo == a) == false);
assert((b == wildcardNo) == false);
assert((wildcardNo == b) == false);
// <
assert( a < b );
assert( (a < wildcardYes) == false );
assert( (wildcardYes < a) == false );
assert( (b < wildcardYes) == false );
assert( (wildcardYes < b) == false );
assert( a < wildcardNo );
assert( (wildcardNo < a) == false );
assert( b < wildcardNo );
assert( (wildcardNo < b) == false );
// >
assert( (a > b) == false );
assert( (a > wildcardYes) == false );
assert( (wildcardYes > a) == false );
assert( (b > wildcardYes) == false );
assert( (wildcardYes > b) == false );
assert( (a > wildcardNo) == false );
assert( wildcardNo > a );
assert( (b > wildcardNo) == false );
assert( wildcardNo > b );
}