Skip to content

Commit

Permalink
Fixed build.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed Nov 27, 2024
1 parent fae5fe4 commit c8ff296
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
18 changes: 15 additions & 3 deletions tests/handle_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <bx/timer.h>
#include <bx/handlealloc.h>
#include <bx/maputil.h>

#include <tinystl/allocator.h>
#include <tinystl/unordered_map.h>
Expand All @@ -15,6 +14,19 @@
#include <stdio.h>
#include <assert.h>

template<typename MapType>
bool mapRemove(MapType& _map, const typename MapType::value_type::first_type& _first)
{
typename MapType::const_iterator it = _map.find(_first);
if (it != _map.end() )
{
_map.erase(it);
return true;
}

return false;
}

int main()
{
const uint32_t numElements = 4<<10;
Expand All @@ -37,7 +49,7 @@ int main()

for (uint32_t jj = 0; jj < numElements; ++jj)
{
bool ok = bx::mapRemove(map, uint64_t(jj) );
bool ok = mapRemove(map, uint64_t(jj) );
assert(ok); BX_UNUSED(ok);
}

Expand Down Expand Up @@ -65,7 +77,7 @@ int main()

for (uint32_t jj = 0; jj < numElements; ++jj)
{
bool ok = bx::mapRemove(map, uint64_t(jj) );
bool ok = mapRemove(map, uint64_t(jj) );
assert(ok); BX_UNUSED(ok);
}

Expand Down
10 changes: 5 additions & 5 deletions tests/math_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,12 @@ TEST_CASE("fract", "[math][libm]")
TEST_CASE("ldexp", "[math][libm]")
{
STATIC_REQUIRE( 1389.0f == bx::ldexp(86.8125, 4) );
STATIC_REQUIRE(0.437500f == bx::ldexp(7.0f, -4.0f) );
STATIC_REQUIRE(bx::isEqual(-0.0f, bx::ldexp(-0.0f, 10.0f), 0.000000001f) );
STATIC_REQUIRE(0.437500f == bx::ldexp(7.0f, -4) );
STATIC_REQUIRE(bx::isEqual(-0.0f, bx::ldexp(-0.0f, 10), 0.000000001f) );

STATIC_REQUIRE(0x1p127f == bx::ldexp(1.0f, 127.0f) );
STATIC_REQUIRE(0x1p-126f == bx::ldexp(1.0f, -126.0f) );
STATIC_REQUIRE(0x1p24f == bx::ldexp(1.0f, 24.0f) );
STATIC_REQUIRE(0x1p127f == bx::ldexp(1.0f, 127) );
STATIC_REQUIRE(0x1p-126f == bx::ldexp(1.0f, -126) );
STATIC_REQUIRE(0x1p24f == bx::ldexp(1.0f, 24) );

bx::WriterI* writer = bx::getNullOut();
bx::Error err;
Expand Down

0 comments on commit c8ff296

Please sign in to comment.