Vault  4.1
vassert.cpp
Go to the documentation of this file.
00001 /*
00002 Copyright c1997-2014 Trygve Isaacson. All rights reserved.
00003 This file is part of the Code Vault version 4.1
00004 http://www.bombaydigital.com/
00005 License: MIT. See LICENSE.md in the Vault top level directory.
00006 */
00007 
00010 #include "vassert.h"
00011 
00012 #include "vlogger.h"
00013 #include "vexception.h"
00014 
00015 static void _failedAssert(const VString& failMessage, const char* file, int line) {
00016     VLOGGER_LEVEL_FILELINE(VLoggerLevel::ERROR, failMessage, file, line);
00017 #ifdef V_ASSERT_THROWS_EXCEPTION
00018     throw VStackTraceException(failMessage);
00019 #endif /* V_ASSERT_THROWS_EXCEPTION */
00020 }
00021 
00022 static void _failedAssertEqual(const VString& valueA, const VString& valueB, const char* expressionA, const char* expressionB, const char* file, int line) {
00023     const VString failMessage(VSTRING_ARGS("Equal assertion failed. (%s = %s) (%s = %s)", expressionA, valueA.chars(), expressionB, valueB.chars()), file, line);
00024     _failedAssert(failMessage, file, line);
00025 }
00026 
00027 static void _failedAssertNotEqual(const VString& commonValue, const char* expressionA, const char* expressionB, const char* file, int line) {
00028     const VString failMessage(VSTRING_ARGS("Not Equal assertion failed. (%s = %s = %s)", expressionA, expressionB, commonValue.chars()), file, line);
00029     _failedAssert(failMessage, file, line);
00030 }
00031 
00032 static void _failedLessOrGreaterThan(bool comparingLessThan, bool comparingOrEqualTo, const VString& valueA, const VString& valueB, const char* expressionA, const char* expressionB, const char* file, int line) {
00033     const VString failMessage(VSTRING_ARGS("%s%s assertion failed. (%s = %s) (%s = %s)", (comparingLessThan ? "Less Than" : "Greater Than"), (comparingOrEqualTo ? " Or Equal To" : ""), expressionA, valueA.chars(), expressionB, valueB.chars()), file, line);
00034     _failedAssert(failMessage, file, line);
00035 }
00036 
00037 static void _failedAssertRangeCheck(const VString& val, const VString& minVal, const VString& maxVal, const char* expressionVal, const char* expressionMinVal, const char* expressionMaxVal, const char* file, int line) {
00038     const VString failMessage(VSTRING_ARGS("Range assertion failed. (%s = %s) (MIN: %s = %s) (MAX: %s = %s)", expressionVal, val.chars(), expressionMinVal, minVal.chars(), expressionMaxVal, maxVal.chars()), file, line);
00039     _failedAssert(failMessage, file, line);
00040 }
00041 
00042 // static
00043 void VAssert::failedAssert(const char* expression, const char* file, int line) {
00044     _failedAssert(VSTRING_FORMAT("Assertion failed: %s.", expression), file, line);
00045 }
00046 
00047 // static
00048 void VAssert::failedAssertValue(const char* expression, const char* valName, const VString& valString, const char* file, int line) {
00049     _failedAssert(VSTRING_FORMAT("Assertion failed: %s (%s = %s)", expression, valName, valString.chars()), file, line);
00050 }
00051 
00052 // static
00053 void VAssert::failedAssertNull(const void* p, const char* expression, const char* file, int line) {
00054     _failedAssert(VSTRING_FORMAT("Null assertion failed. (%s = " VSTRING_FORMATTER_PTR ")", expression, p), file, line);
00055 }
00056 
00057 // static
00058 void VAssert::failedAssertNotNull(const char* expression, const char* file, int line) {
00059     _failedAssert(VSTRING_FORMAT("Not Null assertion failed. (%s = NULL)", expression), file, line);
00060 }
00061 
00062 // static
00063 void VAssert::failedAssertZero(Vs64 i, const char* expression, const char* file, int line) {
00064     _failedAssert(VSTRING_FORMAT("Zero assertion failed. (%s = " VSTRING_FORMATTER_S64 ")", expression, i), file, line);
00065 }
00066 
00067 // static
00068 void VAssert::failedAssertNonZero(const char* expression, const char* file, int line) {
00069     _failedAssert(VSTRING_FORMAT("Non-zero assertion failed. (%s = 0)", expression), file, line);
00070 }
00071 
00072 // static
00073 void VAssert::failedAssertEqual(int a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00074     _failedAssertEqual(VSTRING_INT(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00075 }
00076 
00077 // static
00078 void VAssert::failedAssertEqual(unsigned int a, unsigned int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00079     _failedAssertEqual(VSTRING_UINT(a), VSTRING_UINT(b), expressionA, expressionB, file, line);
00080 }
00081 
00082 // static
00083 void VAssert::failedAssertEqual(unsigned int a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00084     _failedAssertEqual(VSTRING_UINT(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00085 }
00086 
00087 // static
00088 void VAssert::failedAssertEqual(const void* a, const void* b, const char* expressionA, const char* expressionB, const char* file, int line) {
00089     _failedAssertEqual(VSTRING_PTR(a), VSTRING_PTR(b), expressionA, expressionB, file, line);
00090 }
00091 
00092 // static
00093 void VAssert::failedAssertEqual(bool a, bool b, const char* expressionA, const char* expressionB, const char* file, int line) {
00094     _failedAssertEqual(VSTRING_BOOL(a), VSTRING_BOOL(b), expressionA, expressionB, file, line);
00095 }
00096 
00097 // static
00098 void VAssert::failedAssertEqual(Vs8 a, Vs8 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00099     _failedAssertEqual(VSTRING_S8(a), VSTRING_S8(b), expressionA, expressionB, file, line);
00100 }
00101 
00102 // static
00103 void VAssert::failedAssertEqual(Vs8 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00104     _failedAssertEqual(VSTRING_S8(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00105 }
00106 
00107 // static
00108 void VAssert::failedAssertEqual(Vu8 a, Vu8 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00109     _failedAssertEqual(VSTRING_U8(a), VSTRING_U8(b), expressionA, expressionB, file, line);
00110 }
00111 
00112 // static
00113 void VAssert::failedAssertEqual(Vu8 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00114     _failedAssertEqual(VSTRING_U8(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00115 }
00116 
00117 // static
00118 void VAssert::failedAssertEqual(Vs16 a, Vs16 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00119     _failedAssertEqual(VSTRING_S16(a), VSTRING_S16(b), expressionA, expressionB, file, line);
00120 }
00121 
00122 // static
00123 void VAssert::failedAssertEqual(Vs16 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00124     _failedAssertEqual(VSTRING_S16(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00125 }
00126 
00127 // static
00128 void VAssert::failedAssertEqual(Vu16 a, Vu16 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00129     _failedAssertEqual(VSTRING_U16(a), VSTRING_U16(b), expressionA, expressionB, file, line);
00130 }
00131 
00132 // static
00133 void VAssert::failedAssertEqual(Vu16 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00134     _failedAssertEqual(VSTRING_U16(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00135 }
00136 
00137 #ifndef Vx32_IS_xINT /* don't redefine if types are same */
00138 // static
00139 void VAssert::failedAssertEqual(Vs32 a, Vs32 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00140     _failedAssertEqual(VSTRING_S32(a), VSTRING_S32(b), expressionA, expressionB, file, line);
00141 }
00142 
00143 // static
00144 void VAssert::failedAssertEqual(Vs32 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00145     _failedAssertEqual(VSTRING_S32(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00146 }
00147 
00148 // static
00149 void VAssert::failedAssertEqual(Vu32 a, Vu32 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00150     _failedAssertEqual(VSTRING_U32(a), VSTRING_U32(b), expressionA, expressionB, file, line);
00151 }
00152 
00153 // static
00154 void VAssert::failedAssertEqual(Vu32 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00155     _failedAssertEqual(VSTRING_U32(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00156 }
00157 #endif /* not Vx32_IS_xINT */
00158 
00159 #ifndef Vx64_IS_xINT /* don't redefine if types are same */
00160 // static
00161 void VAssert::failedAssertEqual(Vs64 a, Vs64 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00162     _failedAssertEqual(VSTRING_S64(a), VSTRING_S64(b), expressionA, expressionB, file, line);
00163 }
00164 
00165 // static
00166 void VAssert::failedAssertEqual(Vs64 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00167     _failedAssertEqual(VSTRING_S64(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00168 }
00169 
00170 // static
00171 void VAssert::failedAssertEqual(Vu64 a, Vu64 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00172     _failedAssertEqual(VSTRING_U64(a), VSTRING_U64(b), expressionA, expressionB, file, line);
00173 }
00174 
00175 // static
00176 void VAssert::failedAssertEqual(Vu64 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00177     _failedAssertEqual(VSTRING_U64(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00178 }
00179 #endif /* not Vx64_IS_xINT */
00180 
00181 // static
00182 void VAssert::failedAssertEqual(VDouble a, VDouble b, const char* expressionA, const char* expressionB, const char* file, int line) {
00183     _failedAssertEqual(VSTRING_DOUBLE(a), VSTRING_DOUBLE(b), expressionA, expressionB, file, line);
00184 }
00185 
00186 // static
00187 void VAssert::failedAssertEqual(const VString& a, const VString& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00188     _failedAssertEqual(a, b, expressionA, expressionB, file, line);
00189 }
00190 
00191 // static
00192 void VAssert::failedAssertEqual(const VString& a, const char* b, const char* expressionA, const char* expressionB, const char* file, int line) {
00193     _failedAssertEqual(a, b, expressionA, expressionB, file, line);
00194 }
00195 
00196 // static
00197 void VAssert::failedAssertEqual(const char* a, const VString& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00198     _failedAssertEqual(a, b, expressionA, expressionB, file, line);
00199 }
00200 
00201 // static
00202 void VAssert::failedAssertEqual(const VCodePoint& a, const VCodePoint& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00203     _failedAssertEqual(a, b, expressionA, expressionB, file, line);
00204 }
00205 
00206 // static
00207 void VAssert::failedAssertEqual(const VChar& a, const VChar& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00208     _failedAssertEqual(a, b, expressionA, expressionB, file, line);
00209 }
00210 
00211 // static
00212 void VAssert::failedAssertEqual(const VChar& a, char b, const char* expressionA, const char* expressionB, const char* file, int line) {
00213     _failedAssertEqual(a, VString(b), expressionA, expressionB, file, line);
00214 }
00215 
00216 // static
00217 void VAssert::failedAssertEqual(const VDuration& a, const VDuration& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00218     _failedAssertEqual(a.getDurationString(), b.getDurationString(), expressionA, expressionB, file, line);
00219 }
00220 
00221 // static
00222 void VAssert::failedAssertEqual(const VInstant& a, const VInstant& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00223     _failedAssertEqual(a.getLocalString(), b.getLocalString(), expressionA, expressionB, file, line);
00224 }
00225 
00226 // static
00227 void VAssert::failedAssertEqual(const VColor& a, const VColor& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00228     _failedAssertEqual(a.getCSSColor(), b.getCSSColor(), expressionA, expressionB, file, line);
00229 }
00230 
00231 // static
00232 void VAssert::failedAssertEqual(const VColorPair& a, const VColorPair& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00233     _failedAssertEqual(a.getCSSColor(), b.getCSSColor(), expressionA, expressionB, file, line);
00234 }
00235 
00236 // static
00237 void VAssert::failedAssertNotEqual(int val, const char* expressionA, const char* expressionB, const char* file, int line) {
00238     _failedAssertNotEqual(VSTRING_INT(val), expressionA, expressionB, file, line);
00239 }
00240 
00241 // static
00242 void VAssert::failedAssertNotEqual(unsigned int val, const char* expressionA, const char* expressionB, const char* file, int line) {
00243     _failedAssertNotEqual(VSTRING_UINT(val), expressionA, expressionB, file, line);
00244 }
00245 
00246 // static
00247 void VAssert::failedAssertNotEqual(const void* val, const char* expressionA, const char* expressionB, const char* file, int line) {
00248     _failedAssertNotEqual(VSTRING_PTR(val), expressionA, expressionB, file, line);
00249 }
00250 
00251 // static
00252 void VAssert::failedAssertNotEqual(bool val, const char* expressionA, const char* expressionB, const char* file, int line) {
00253     _failedAssertNotEqual(VSTRING_BOOL(val), expressionA, expressionB, file, line);
00254 }
00255 
00256 // static
00257 void VAssert::failedAssertNotEqual(Vs8 val, const char* expressionA, const char* expressionB, const char* file, int line) {
00258     _failedAssertNotEqual(VSTRING_S8(val), expressionA, expressionB, file, line);
00259 }
00260 
00261 // static
00262 void VAssert::failedAssertNotEqual(Vu8 val, const char* expressionA, const char* expressionB, const char* file, int line) {
00263     _failedAssertNotEqual(VSTRING_U8(val), expressionA, expressionB, file, line);
00264 }
00265 
00266 // static
00267 void VAssert::failedAssertNotEqual(Vs16 val, const char* expressionA, const char* expressionB, const char* file, int line) {
00268     _failedAssertNotEqual(VSTRING_S16(val), expressionA, expressionB, file, line);
00269 }
00270 
00271 // static
00272 void VAssert::failedAssertNotEqual(Vu16 val, const char* expressionA, const char* expressionB, const char* file, int line) {
00273     _failedAssertNotEqual(VSTRING_U16(val), expressionA, expressionB, file, line);
00274 }
00275 
00276 #ifndef Vx32_IS_xINT /* don't redefine if types are same */
00277 // static
00278 void VAssert::failedAssertNotEqual(Vs32 val, const char* expressionA, const char* expressionB, const char* file, int line) {
00279     _failedAssertNotEqual(VSTRING_S32(val), expressionA, expressionB, file, line);
00280 }
00281 
00282 // static
00283 void VAssert::failedAssertNotEqual(Vu32 val, const char* expressionA, const char* expressionB, const char* file, int line) {
00284     _failedAssertNotEqual(VSTRING_U32(val), expressionA, expressionB, file, line);
00285 }
00286 #endif /* not Vx32_IS_xINT */
00287 
00288 #ifndef Vx64_IS_xINT /* don't redefine if types are same */
00289 // static
00290 void VAssert::failedAssertNotEqual(Vs64 val, const char* expressionA, const char* expressionB, const char* file, int line) {
00291     _failedAssertNotEqual(VSTRING_S64(val), expressionA, expressionB, file, line);
00292 }
00293 
00294 // static
00295 void VAssert::failedAssertNotEqual(Vu64 val, const char* expressionA, const char* expressionB, const char* file, int line) {
00296     _failedAssertNotEqual(VSTRING_U64(val), expressionA, expressionB, file, line);
00297 }
00298 #endif /* not Vx64_IS_xINT */
00299 
00300 // static
00301 void VAssert::failedAssertNotEqual(VDouble val, const char* expressionA, const char* expressionB, const char* file, int line) {
00302     _failedAssertNotEqual(VSTRING_DOUBLE(val), expressionA, expressionB, file, line);
00303 }
00304 
00305 // static
00306 void VAssert::failedAssertNotEqual(const VString& val, const char* expressionA, const char* expressionB, const char* file, int line) {
00307     _failedAssertNotEqual(val, expressionA, expressionB, file, line);
00308 }
00309 
00310 // static
00311 void VAssert::failedAssertNotEqual(const VCodePoint& val, const char* expressionA, const char* expressionB, const char* file, int line) {
00312     _failedAssertNotEqual(val, expressionA, expressionB, file, line);
00313 }
00314 
00315 // static
00316 void VAssert::failedAssertNotEqual(const VChar& val, const char* expressionA, const char* expressionB, const char* file, int line) {
00317     _failedAssertNotEqual(val, expressionA, expressionB, file, line);
00318 }
00319 
00320 // static
00321 void VAssert::failedAssertNotEqual(const VDuration& val, const char* expressionA, const char* expressionB, const char* file, int line) {
00322     _failedAssertNotEqual(val.getDurationString(), expressionA, expressionB, file, line);
00323 }
00324 
00325 // static
00326 void VAssert::failedAssertNotEqual(const VInstant& val, const char* expressionA, const char* expressionB, const char* file, int line) {
00327     _failedAssertNotEqual(val.getLocalString(), expressionA, expressionB, file, line);
00328 }
00329 
00330 // static
00331 void VAssert::failedAssertNotEqual(const VColor& val, const char* expressionA, const char* expressionB, const char* file, int line) {
00332     _failedAssertNotEqual(val.getCSSColor(), expressionA, expressionB, file, line);
00333 }
00334 
00335 // static
00336 void VAssert::failedAssertNotEqual(const VColorPair& val, const char* expressionA, const char* expressionB, const char* file, int line) {
00337     _failedAssertNotEqual(val.getCSSColor(), expressionA, expressionB, file, line);
00338 }
00339 
00340 // static
00341 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, int a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00342     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_INT(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00343 }
00344 
00345 // static
00346 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, unsigned int a, unsigned int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00347     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_UINT(a), VSTRING_UINT(b), expressionA, expressionB, file, line);
00348 }
00349 
00350 // static
00351 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, unsigned int a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00352     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_UINT(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00353 }
00354 
00355 // static
00356 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vs8 a, Vs8 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00357     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_S8(a), VSTRING_S8(b), expressionA, expressionB, file, line);
00358 }
00359 
00360 // static
00361 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vs8 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00362     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_S8(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00363 }
00364 
00365 // static
00366 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vu8 a, Vu8 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00367     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_U8(a), VSTRING_U8(b), expressionA, expressionB, file, line);
00368 }
00369 
00370 // static
00371 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vu8 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00372     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_U8(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00373 }
00374 
00375 // static
00376 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vs16 a, Vs16 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00377     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_S16(a), VSTRING_S16(b), expressionA, expressionB, file, line);
00378 }
00379 
00380 // static
00381 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vs16 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00382     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_S16(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00383 }
00384 
00385 // static
00386 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vu16 a, Vu16 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00387     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_U16(a), VSTRING_U16(b), expressionA, expressionB, file, line);
00388 }
00389 
00390 // static
00391 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vu16 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00392     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_U16(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00393 }
00394 
00395 #ifndef Vx32_IS_xINT /* don't redefine if types are same */
00396 // static
00397 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vs32 a, Vs32 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00398     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_S32(a), VSTRING_S32(b), expressionA, expressionB, file, line);
00399 }
00400 
00401 // static
00402 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vs32 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00403     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_S32(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00404 }
00405 
00406 // static
00407 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vu32 a, Vu32 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00408     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_U32(a), VSTRING_U32(b), expressionA, expressionB, file, line);
00409 }
00410 
00411 // static
00412 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vu32 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00413     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_U32(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00414 }
00415 #endif /* not Vx32_IS_xINT */
00416 
00417 #ifndef Vx64_IS_xINT /* don't redefine if types are same */
00418 // static
00419 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vs64 a, Vs64 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00420     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_S64(a), VSTRING_S64(b), expressionA, expressionB, file, line);
00421 }
00422 
00423 // static
00424 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vs64 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00425     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_S64(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00426 }
00427 
00428 // static
00429 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vu64 a, Vu64 b, const char* expressionA, const char* expressionB, const char* file, int line) {
00430     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_U64(a), VSTRING_U64(b), expressionA, expressionB, file, line);
00431 }
00432 
00433 // static
00434 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, Vu64 a, int b, const char* expressionA, const char* expressionB, const char* file, int line) {
00435     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_U64(a), VSTRING_INT(b), expressionA, expressionB, file, line);
00436 }
00437 #endif /* not Vx64_IS_xINT */
00438 
00439 // static
00440 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, VDouble a, VDouble b, const char* expressionA, const char* expressionB, const char* file, int line) {
00441     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, VSTRING_DOUBLE(a), VSTRING_DOUBLE(b), expressionA, expressionB, file, line);
00442 }
00443 
00444 // static
00445 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, const VString& a, const VString& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00446     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, a, b, expressionA, expressionB, file, line);
00447 }
00448 
00449 // static
00450 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, const VString& a, const char* b, const char* expressionA, const char* expressionB, const char* file, int line) {
00451     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, a, b, expressionA, expressionB, file, line);
00452 }
00453 
00454 // static
00455 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, const char* a, const VString& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00456     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, a, b, expressionA, expressionB, file, line);
00457 }
00458 
00459 // static
00460 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, const VCodePoint& a, const VCodePoint& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00461     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, a, b, expressionA, expressionB, file, line);
00462 }
00463 
00464 // static
00465 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, const VChar& a, const VChar& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00466     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, a, b, expressionA, expressionB, file, line);
00467 }
00468 
00469 // static
00470 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, const VChar& a, char b, const char* expressionA, const char* expressionB, const char* file, int line) {
00471     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, a, VString(b), expressionA, expressionB, file, line);
00472 }
00473 
00474 // static
00475 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, const VDuration& a, const VDuration& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00476     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, a.getDurationString(), b.getDurationString(), expressionA, expressionB, file, line);
00477 }
00478 
00479 // static
00480 void VAssert::failedLessGreaterComparison(bool comparingLessThan, bool comparingOrEqualTo, const VInstant& a, const VInstant& b, const char* expressionA, const char* expressionB, const char* file, int line) {
00481     _failedLessOrGreaterThan(comparingLessThan, comparingOrEqualTo, a.getLocalString(), b.getLocalString(), expressionA, expressionB, file, line);
00482 }
00483 
00484 // static
00485 void VAssert::failedRangeCheck(int val, int minVal, int maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00486     _failedAssertRangeCheck(VSTRING_INT(val), VSTRING_INT(minVal), VSTRING_INT(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00487 }
00488 
00489 // static
00490 void VAssert::failedRangeCheck(unsigned int val, unsigned int minVal, unsigned int maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00491     _failedAssertRangeCheck(VSTRING_UINT(val), VSTRING_UINT(minVal), VSTRING_UINT(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00492 }
00493 
00494 // static
00495 void VAssert::failedRangeCheck(unsigned int val, int minVal, int maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00496     _failedAssertRangeCheck(VSTRING_UINT(val), VSTRING_INT(minVal), VSTRING_INT(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00497 }
00498 
00499 #ifndef Vx32_IS_xINT /* don't redefine if types are same */
00500 // static
00501 void VAssert::failedRangeCheck(Vs32 val, Vs32 minVal, Vs32 maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00502     _failedAssertRangeCheck(VSTRING_S32(val), VSTRING_S32(minVal), VSTRING_S32(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00503 }
00504 
00505 // static
00506 void VAssert::failedRangeCheck(Vs32 val, int minVal, int maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00507     _failedAssertRangeCheck(VSTRING_S32(val), VSTRING_INT(minVal), VSTRING_INT(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00508 }
00509 
00510 // static
00511 void VAssert::failedRangeCheck(Vu32 val, Vu32 minVal, Vu32 maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00512     _failedAssertRangeCheck(VSTRING_U32(val), VSTRING_U32(minVal), VSTRING_U32(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00513 }
00514 
00515 // static
00516 void VAssert::failedRangeCheck(Vu32 val, int minVal, int maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00517     _failedAssertRangeCheck(VSTRING_U32(val), VSTRING_INT(minVal), VSTRING_INT(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00518 }
00519 #endif /* not Vx32_IS_xINT */
00520 
00521 #ifndef Vx64_IS_xINT /* don't redefine if types are same */
00522 // static
00523 void VAssert::failedRangeCheck(Vs64 val, Vs64 minVal, Vs64 maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00524     _failedAssertRangeCheck(VSTRING_S64(val), VSTRING_S64(minVal), VSTRING_S64(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00525 }
00526 
00527 // static
00528 void VAssert::failedRangeCheck(Vs64 val, int minVal, int maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00529     _failedAssertRangeCheck(VSTRING_S64(val), VSTRING_INT(minVal), VSTRING_INT(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00530 }
00531 
00532 // static
00533 void VAssert::failedRangeCheck(Vu64 val, Vu64 minVal, Vu64 maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00534     _failedAssertRangeCheck(VSTRING_U64(val), VSTRING_U64(minVal), VSTRING_U64(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00535 }
00536 
00537 // static
00538 void VAssert::failedRangeCheck(Vu64 val, int minVal, int maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00539     _failedAssertRangeCheck(VSTRING_U64(val), VSTRING_INT(minVal), VSTRING_INT(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00540 }
00541 #endif /* not Vx64_IS_xINT */
00542 
00543 // static
00544 void VAssert::failedRangeCheck(VDouble val, VDouble minVal, VDouble maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00545     _failedAssertRangeCheck(VSTRING_DOUBLE(val), VSTRING_DOUBLE(minVal), VSTRING_DOUBLE(maxVal), valExpression, minValExpression, maxValExpression, file, line);
00546 }
00547 
00548 // static
00549 void VAssert::failedRangeCheck(const VString& val, const VString& minVal, const VString& maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00550     _failedAssertRangeCheck(val, minVal, maxVal, valExpression, minValExpression, maxValExpression, file, line);
00551 }
00552 
00553 // static
00554 void VAssert::failedRangeCheck(const VCodePoint& val, const VCodePoint& minVal, const VCodePoint& maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00555     _failedAssertRangeCheck(val, minVal, maxVal, valExpression, minValExpression, maxValExpression, file, line);
00556 }
00557 
00558 // static
00559 void VAssert::failedRangeCheck(const VChar& val, const VChar& minVal, const VChar& maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00560     _failedAssertRangeCheck(val, minVal, maxVal, valExpression, minValExpression, maxValExpression, file, line);
00561 }
00562 
00563 // static
00564 void VAssert::failedRangeCheck(const VDuration& val, const VDuration& minVal, const VDuration& maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00565     _failedAssertRangeCheck(val.getDurationString(), minVal.getDurationString(), maxVal.getDurationString(), valExpression, minValExpression, maxValExpression, file, line);
00566 }
00567 
00568 // static
00569 void VAssert::failedRangeCheck(const VInstant& val, const VInstant& minVal, const VInstant& maxVal, const char* valExpression, const char* minValExpression, const char* maxValExpression, const char* file, int line) {
00570     _failedAssertRangeCheck(val.getLocalString(), minVal.getLocalString(), maxVal.getLocalString(), valExpression, minValExpression, maxValExpression, file, line);
00571 }
00572 

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.