generated from StraykerPL/PaternRepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tester.c
194 lines (126 loc) · 4.98 KB
/
tester.c
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/*
VerLib
Copyright © 2019 Daniel Strayker Nowak
Tester for VerLib development
*/
#include <stdio.h>
#include "verlib.h"
int main()
{
printf(" - VerLib Tester - \n");
printf(" - For version 1.0.0 -\n\n");
// Set version value for "1.0.0" Build 1 with SetVersionString function:
printf("Version '1.0.0' Build 1 with SetVersionString function:\n");
char version[] = { '1', '.', '0', '.', '0', '.', '1', '\0' };
SetVersionString(version);
ConsoleLogVersion();
printf("\n\n");
// Set version value for "3.0.0" Build 1 with SetVersionMajor function:
printf("Version '3.0.0' Build 1 with SetVersionMajor function:\n");
SetVersionMajor(3);
ConsoleLogVersion();
printf("\n\n");
// Set version value for "3.1.0" Build 1 with SetVersionMinor function:
printf("Version '3.1.0' Build 1 with SetVersionMinor function:\n");
SetVersionMinor(1);
ConsoleLogVersion();
printf("\n\n");
// Set version value for "3.1.2" Build 1 with SetVersionRelease function:
printf("Version '3.1.2' Build 1 with SetVersionRelease function:\n");
SetVersionRelease(2);
ConsoleLogVersion();
printf("\n\n");
// Set version value for "3.2.1" Build 50 with SetVersionBuild function:
printf("Version '3.1.2' Build 50 with SetVersionBuild function:\n");
SetVersionBuild(50);
ConsoleLogVersion();
printf("\n\n");
// Get full version value with GetVersionFull function:
printf("Get full version value with GetVersionFull function:\n");
printf("Full version, without dots: %i", GetVersionFull());
printf("\n\n");
// Get version Major value with GetVersionMajor function:
printf("Getting version Major value with SetVersionBuild function:\n");
printf("Version Major number: %i", GetVersionMajor());
printf("\n\n");
// Get version Minor value with GetVersionMinor function:
printf("Getting version Minor value with GetVersionMinor function:\n");
printf("Version Minor number: %i", GetVersionMinor());
printf("\n\n");
// Get version Release value with GetVersionRelease function:
printf("Getting version Release value with GetVersionRelease function:\n");
printf("Version Release number: %i", GetVersionRelease());
printf("\n\n");
// Get version Build value with GetVersionBuild function:
printf("Getting version Build value with GetVersionBuild function:\n");
printf("Version Build number: %i", GetVersionBuild());
printf("\n\n");
// Increment Major version value with IncrementMajor function:
printf("Incrementing Major version value with IncrementMajor function:\n");
IncrementMajor();
ConsoleLogVersion();
printf("\n\n");
// Increment Minor version value with IncrementMinor function:
printf("Incrementing Minor version value with IncrementMinor function:\n");
IncrementMinor();
ConsoleLogVersion();
printf("\n\n");
// Increment Release version value with IncrementRelease function:
printf("Incrementing Minor version value with IncrementRelease function:\n");
IncrementRelease();
ConsoleLogVersion();
printf("\n\n");
// Increment Build version value with IncrementBuild function:
printf("Incrementing Minor version value with IncrementBuild function:\n");
IncrementBuild();
ConsoleLogVersion();
printf("\n\n");
// Decrement Major version value with DecrementMajor function:
printf("Decrementing Major version value with DecrementMajor function:\n");
DecrementMajor();
ConsoleLogVersion();
printf("\n\n");
// Decrement Minor version value with DecrementMinor function:
printf("Decrementing Major version value with DecrementMinor function:\n");
DecrementMinor();
ConsoleLogVersion();
printf("\n\n");
// Decrement Release version value with DecrementRelease function:
printf("Decrementing Major version value with DecrementRelease function:\n");
DecrementRelease();
ConsoleLogVersion();
printf("\n\n");
// Decrement Build version value with DecrementBuild function:
printf("Decrementing Major version value with DecrementBuild function:\n");
DecrementBuild();
ConsoleLogVersion();
printf("\n\n");
// Log version number with LogVersionString function:
printf("Logging version number with LogVersionString function:\n");
printf("Version log: %s", LogVersionString());
printf("\n\n");
// Compare version "1.2.4 Build 122" with "2.0.5 Build 108". This comparison should throw false output:
printf("Comparing version '1.2.4 Build 122' with '2.0.5 Build 108'. This comparison should throw false output:\n");
Version version1;
version1.Major = 1;
version1.Minor = 2;
version1.Release = 4;
version1.Build = 122;
Version version2;
version2.Major = 2;
version2.Minor = 0;
version2.Release = 5;
version2.Build = 108;
bool cmpvar = CompareVersions(version1, version2); // Here's false,
printf("First comparison result: %i\n", cmpvar);
version2.Major = 1;
version2.Minor = 2;
version2.Release = 4;
version2.Build = 122;
cmpvar = CompareVersions(version1, version2); // Here's true,
printf("Second comparison result: %i\n", cmpvar);
printf("\n");
printf("Press Enter to exit!");
getchar();
return 0;
}