Advanced Strategic Command
testversionidentifier.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * This program is free software; you can redistribute it and/or modify *
4  * it under the terms of the GNU General Public License as published by *
5  * the Free Software Foundation; either version 2 of the License, or *
6  * (at your option) any later version. *
7  * *
8  ***************************************************************************/
9 
10 #include "versionidentifier.h"
11 
12 #include "unittestutil.h"
13 
14 
16 {
17  assertOrThrow( VersionIdentifier("1.2.0") == VersionIdentifier("1.2.0") );
19  assertOrThrow( VersionIdentifier("1.2.0") != VersionIdentifier("1.2.1") );
20  assertOrThrow( VersionIdentifier("1.2.0") != VersionIdentifier("1.2.0.1") );
21  assertOrThrow( VersionIdentifier("1.2.0") != VersionIdentifier("11.2.0") );
22 
23  assertOrThrow( VersionIdentifier("1.2.0") <= VersionIdentifier("1.2.0") );
26  assertOrThrow( VersionIdentifier("1.2.0") >= VersionIdentifier("1.2.0") );
27  assertOrThrow( VersionIdentifier("1.3") >= VersionIdentifier("1.2.0.1") );
28  assertOrThrow( VersionIdentifier("1.3.0.0.2.0.1.0") >= VersionIdentifier("1.2.0.1") );
29 
30 
31 
33  assertOrThrow( VersionIdentifier("1.2.0") < VersionIdentifier("1.2.1") );
34  assertOrThrow( VersionIdentifier("1.2.0") < VersionIdentifier("1.2.0.1") );
35 
36  assertOrThrow( !(VersionIdentifier("1.3") < VersionIdentifier("1.2.0") ));
37  assertOrThrow( !(VersionIdentifier("1.2.1") < VersionIdentifier("1.2.0") ));
38  assertOrThrow( !(VersionIdentifier("1.2.0.1") < VersionIdentifier("1.2.0") ));
39 
40 
41 }
#define assertOrThrow(expr)
Definition: errors.h:69
void testVersionIdentifier()