mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
chore(build): resolve MSVC warnings
This commit is contained in:
parent
df14314ea1
commit
92b0c4778f
6 changed files with 19 additions and 10 deletions
|
|
@ -1,11 +1,14 @@
|
|||
#include "storm/Handle.hpp"
|
||||
#include "test/Test.hpp"
|
||||
|
||||
#define UNUSED(x) ((void)x)
|
||||
|
||||
TEST_CASE("DECLARE_STORM_HANDLE", "[handle]") {
|
||||
SECTION("declares handle") {
|
||||
DECLARE_STORM_HANDLE(HTEST);
|
||||
HTEST test;
|
||||
|
||||
UNUSED(test);
|
||||
SUCCEED();
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +21,8 @@ TEST_CASE("DECLARE_STORM_CHILD_HANDLE", "[handle]") {
|
|||
HPARENT parent;
|
||||
HCHILD child;
|
||||
|
||||
UNUSED(parent);
|
||||
UNUSED(child);
|
||||
SUCCEED();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "storm/Hash.hpp"
|
||||
#include "storm/Thread.hpp"
|
||||
#include "test/Test.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
struct TestHashObject : TSHashObject<TestHashObject, HASHKEY_STRI> {
|
||||
uint32_t index = 255;
|
||||
|
|
@ -11,15 +12,16 @@ struct TestExportObject : TSHashObject<TestHashObject, HASHKEY_NONE> {
|
|||
};
|
||||
|
||||
typedef void* TestExportObjectHandle;
|
||||
|
||||
typedef void* TestExportLockedHandle;
|
||||
|
||||
#define MAKEINTPTR(x) reinterpret_cast<void*>(static_cast<uintptr_t>(x));
|
||||
|
||||
TEST_CASE("HASHKEY_PTR", "[hash]") {
|
||||
SECTION("constructs correctly") {
|
||||
HASHKEY_PTR key1;
|
||||
REQUIRE(key1.GetPtr() == nullptr);
|
||||
|
||||
void* ptr = reinterpret_cast<void*>(0xDEAFBEEF);
|
||||
void* ptr = MAKEINTPTR(0xDEAFBEEF);
|
||||
HASHKEY_PTR key2 = { ptr };
|
||||
REQUIRE(key2.GetPtr() == ptr);
|
||||
}
|
||||
|
|
@ -27,9 +29,9 @@ TEST_CASE("HASHKEY_PTR", "[hash]") {
|
|||
|
||||
TEST_CASE("HASHKEY_PTR::operator=") {
|
||||
SECTION("assigns from another key") {
|
||||
void* ptr1 = reinterpret_cast<void*>(0xDEAFBEEF);
|
||||
void* ptr1 = MAKEINTPTR(0xDEAFBEEF);
|
||||
HASHKEY_PTR key1 = { ptr1 };
|
||||
void* ptr2 = reinterpret_cast<void*>(0xFEEDFACE);
|
||||
void* ptr2 = MAKEINTPTR(0xFEEDFACE);
|
||||
HASHKEY_PTR key2 = { ptr2 };
|
||||
REQUIRE (!(key1 == key2));
|
||||
|
||||
|
|
@ -40,12 +42,12 @@ TEST_CASE("HASHKEY_PTR::operator=") {
|
|||
|
||||
TEST_CASE("HASHKEY_PTR::operator==") {
|
||||
SECTION("compares to another key") {
|
||||
void* ptr1 = reinterpret_cast<void*>(0xDEAFBEEF);
|
||||
void* ptr1 = MAKEINTPTR(0xDEAFBEEF);
|
||||
HASHKEY_PTR key1 = { ptr1 };
|
||||
HASHKEY_PTR key2 = { ptr1 };
|
||||
REQUIRE(key1 == key2);
|
||||
|
||||
void* ptr2 = reinterpret_cast<void*>(0xFEEDFACE);
|
||||
void* ptr2 = MAKEINTPTR(0xFEEDFACE);
|
||||
HASHKEY_PTR key3 = { ptr2 };
|
||||
REQUIRE(!(key1 == key3));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ TEST_CASE("SUniSGetUTF8", "[unicode]") {
|
|||
int32_t chars = 0;
|
||||
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
|
||||
|
||||
REQUIRE(code == -1u);
|
||||
REQUIRE(code == ~0u);
|
||||
REQUIRE(chars == 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue