diff options
author | Richard Linden <none@none> | 2013-08-22 14:21:16 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-08-22 14:21:16 -0700 |
commit | cf014375b8b408d58bd35deb4e58e4369fb3bf62 (patch) | |
tree | bfb24c15324ea76759b6c5fdab85dbee67be5742 /indra/llcommon/tests/llunits_test.cpp | |
parent | 37626bb4a29c39b35fe63971928b76d11faafeb3 (diff) |
SH-4433 FIX: Interesting: Statistics > Ping Sim is always 0 ms
removed bad assert
fixed precision issues during int->unsigned int conversions and vice
versa
Diffstat (limited to 'indra/llcommon/tests/llunits_test.cpp')
-rw-r--r-- | indra/llcommon/tests/llunits_test.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/llcommon/tests/llunits_test.cpp b/indra/llcommon/tests/llunits_test.cpp index b8aef9d15e..292c6122af 100644 --- a/indra/llcommon/tests/llunits_test.cpp +++ b/indra/llcommon/tests/llunits_test.cpp @@ -257,4 +257,20 @@ namespace tut LLUnitImplicit<F32, Latinum> latinum_implicit(2); ensure("implicit units of different types are comparable", latinum_implicit * 2 == quatloos_implicit); } + + // precision tests + template<> template<> + void units_object_t::test<8>() + { + U32Bytes max_bytes(U32_MAX); + S32Megabytes mega_bytes = max_bytes; + ensure("max available precision is used when converting units", mega_bytes == (S32Megabytes)4095); + + mega_bytes = (S32Megabytes)-5 + (U32Megabytes)1; + ensure("can mix signed and unsigned in units addition", mega_bytes == (S32Megabytes)-4); + + mega_bytes = (U32Megabytes)5 + (S32Megabytes)-1; + ensure("can mix unsigned and signed in units addition", mega_bytes == (S32Megabytes)4); + + } } |