Bug 945121: Use DebugOnly to fix opt-only 'unused variable' build warning in TestCeilingFloor.cpp. r=Waldo

This commit is contained in:
Daniel Holbert 2013-12-20 13:41:48 -08:00
parent 42cc7a3660
commit b14ef78544

View File

@ -3,9 +3,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file, * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/DebugOnly.h"
#include "mozilla/MathAlgorithms.h" #include "mozilla/MathAlgorithms.h"
using mozilla::CeilingLog2; using mozilla::CeilingLog2;
using mozilla::DebugOnly;
using mozilla::FloorLog2; using mozilla::FloorLog2;
using mozilla::RoundUpPow2; using mozilla::RoundUpPow2;
@ -69,7 +71,7 @@ TestRoundUpPow2()
MOZ_ASSERT(RoundUpPow2(32) == 32); MOZ_ASSERT(RoundUpPow2(32) == 32);
MOZ_ASSERT(RoundUpPow2(33) == 64); MOZ_ASSERT(RoundUpPow2(33) == 64);
size_t MaxPow2 = size_t(1) << (sizeof(size_t) * CHAR_BIT - 1); DebugOnly<size_t> MaxPow2 = size_t(1) << (sizeof(size_t) * CHAR_BIT - 1);
MOZ_ASSERT(RoundUpPow2(MaxPow2 - 1) == MaxPow2); MOZ_ASSERT(RoundUpPow2(MaxPow2 - 1) == MaxPow2);
MOZ_ASSERT(RoundUpPow2(MaxPow2) == MaxPow2); MOZ_ASSERT(RoundUpPow2(MaxPow2) == MaxPow2);
// not valid to round up when past the max power of two // not valid to round up when past the max power of two