Skip to content

Commit

Permalink
Fix EMSCRIPTEN reallocate test
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian LALU committed Dec 19, 2024
1 parent ccd8f48 commit e60ba00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions interface/core/types/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ static_assert(!is_signed(hud::u32) && is_unsigned(hud::u32), "hud::u32 is signed
static_assert(!is_signed(hud::u64) && is_unsigned(hud::u64), "hud::u64 is signed");
static_assert(is_signed(hud::ansichar) && !is_unsigned(hud::ansichar), "hud::ansichar is not signed");
#if defined(HD_OS_WINDOWS)
static_assert(!is_signed(hud::wchar) && is_unsigned(hud::wchar), "hud::wchar is signed");
static_assert(!is_signed(hud::wchar) && is_unsigned(hud::wchar), "hud::wchar is unsigned");
#else
static_assert(is_signed(hud::wchar) && !is_unsigned(hud::wchar), "hud::wchar is unsigned");
static_assert(is_signed(hud::wchar) && !is_unsigned(hud::wchar), "hud::wchar is signed");
#endif
static_assert(is_signed(hud::iptr) && !is_unsigned(hud::iptr), "hud::iptr is not signed");
static_assert(!is_signed(hud::uptr) && is_unsigned(hud::uptr), "hud::uptr is signed");
Expand Down
4 changes: 4 additions & 0 deletions test/memory/memory_allocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ GTEST_TEST(memory, reallocate)
*(ptr + 1) = 3;
hud_assert_eq(*ptr, 2u);
hud_assert_eq(*(ptr + 1), 3u);
#if defined(HD_COMPILER_EMSCRIPTEN)
hud_assert_ne(hud::memory::reallocate(ptr, 0), nullptr);
#else
hud_assert_eq(hud::memory::reallocate(ptr, 0), nullptr);
#endif

// Do not free, it's already free
guard.leak();
Expand Down

0 comments on commit e60ba00

Please sign in to comment.