mirror of https://github.com/SeanOMik/libki.git
test: Fix narrowing errors in arary initialization
This commit is contained in:
parent
d7f5196a36
commit
2632ef563c
|
@ -20,16 +20,16 @@ TEST_CASE("Control Message Serialization", "[control]")
|
||||||
|
|
||||||
const char expected_bytes[] = {
|
const char expected_bytes[] = {
|
||||||
// Session ID
|
// Session ID
|
||||||
0xCD, 0xAB,
|
'\xCD', '\xAB',
|
||||||
|
|
||||||
// Unknown
|
// Unknown
|
||||||
0x00, 0x00, 0x00, 0x00,
|
'\x00', '\x00', '\x00', '\x00',
|
||||||
|
|
||||||
// Timestamp
|
// Timestamp
|
||||||
0xDD, 0xCC, 0xBB, 0xAA,
|
'\xDD', '\xCC', '\xBB', '\xAA',
|
||||||
|
|
||||||
// Milliseconds
|
// Milliseconds
|
||||||
0xDD, 0xCC, 0xBB, 0xAA
|
'\xDD', '\xCC', '\xBB', '\xAA'
|
||||||
};
|
};
|
||||||
REQUIRE(oss.str() == std::string(expected_bytes, sizeof(expected_bytes)));
|
REQUIRE(oss.str() == std::string(expected_bytes, sizeof(expected_bytes)));
|
||||||
}
|
}
|
||||||
|
@ -41,19 +41,19 @@ TEST_CASE("Control Message Serialization", "[control]")
|
||||||
|
|
||||||
const char expected_bytes[] = {
|
const char expected_bytes[] = {
|
||||||
// Unknown
|
// Unknown
|
||||||
0x00, 0x00,
|
'\x00', '\x00',
|
||||||
|
|
||||||
// Unknown
|
// Unknown
|
||||||
0x00, 0x00, 0x00, 0x00,
|
'\x00', '\x00', '\x00', '\x00',
|
||||||
|
|
||||||
// Timestamp
|
// Timestamp
|
||||||
0xDD, 0xCC, 0xBB, 0xAA,
|
'\xDD', '\xCC', '\xBB', '\xAA',
|
||||||
|
|
||||||
// Milliseconds
|
// Milliseconds
|
||||||
0xDD, 0xCC, 0xBB, 0xAA,
|
'\xDD', '\xCC', '\xBB', '\xAA',
|
||||||
|
|
||||||
// Session ID
|
// Session ID
|
||||||
0xCD, 0xAB
|
'\xCD', '\xAB'
|
||||||
};
|
};
|
||||||
REQUIRE(oss.str() == std::string(expected_bytes, sizeof(expected_bytes)));
|
REQUIRE(oss.str() == std::string(expected_bytes, sizeof(expected_bytes)));
|
||||||
}
|
}
|
||||||
|
@ -65,13 +65,13 @@ TEST_CASE("Control Message Serialization", "[control]")
|
||||||
|
|
||||||
const char expected_bytes[] = {
|
const char expected_bytes[] = {
|
||||||
// Session ID
|
// Session ID
|
||||||
0xCD, 0xAB,
|
'\xCD', '\xAB',
|
||||||
|
|
||||||
// Milliseconds
|
// Milliseconds
|
||||||
0xCD, 0xAB,
|
'\xCD', '\xAB',
|
||||||
|
|
||||||
// Minutes
|
// Minutes
|
||||||
0xCD, 0xAB
|
'\xCD', '\xAB'
|
||||||
};
|
};
|
||||||
REQUIRE(oss.str() == std::string(expected_bytes, sizeof(expected_bytes)));
|
REQUIRE(oss.str() == std::string(expected_bytes, sizeof(expected_bytes)));
|
||||||
}
|
}
|
||||||
|
@ -83,10 +83,10 @@ TEST_CASE("Control Message Serialization", "[control]")
|
||||||
|
|
||||||
const char expected_bytes[] = {
|
const char expected_bytes[] = {
|
||||||
// Unknown
|
// Unknown
|
||||||
0x00, 0x00,
|
'\x00', '\x00',
|
||||||
|
|
||||||
// Timestamp
|
// Timestamp
|
||||||
0xDD, 0xCC, 0xBB, 0xAA
|
'\xDD', '\xCC', '\xBB', '\xAA'
|
||||||
};
|
};
|
||||||
REQUIRE(oss.str() == std::string(expected_bytes, sizeof(expected_bytes)));
|
REQUIRE(oss.str() == std::string(expected_bytes, sizeof(expected_bytes)));
|
||||||
}
|
}
|
||||||
|
@ -98,16 +98,16 @@ TEST_CASE("Control Message Deserialization", "[control]")
|
||||||
{
|
{
|
||||||
const char bytes[] = {
|
const char bytes[] = {
|
||||||
// Session ID
|
// Session ID
|
||||||
0xCD, 0xAB,
|
'\xCD', '\xAB',
|
||||||
|
|
||||||
// Unknown
|
// Unknown
|
||||||
0x00, 0x00, 0x00, 0x00,
|
'\x00', '\x00', '\x00', '\x00',
|
||||||
|
|
||||||
// Timestamp
|
// Timestamp
|
||||||
0xDD, 0xCC, 0xBB, 0xAA,
|
'\xDD', '\xCC', '\xBB', '\xAA',
|
||||||
|
|
||||||
// Milliseconds
|
// Milliseconds
|
||||||
0xDD, 0xCC, 0xBB, 0xAA
|
'\xDD', '\xCC', '\xBB', '\xAA'
|
||||||
};
|
};
|
||||||
std::istringstream iss(std::string(bytes, sizeof(bytes)));
|
std::istringstream iss(std::string(bytes, sizeof(bytes)));
|
||||||
|
|
||||||
|
@ -123,19 +123,19 @@ TEST_CASE("Control Message Deserialization", "[control]")
|
||||||
{
|
{
|
||||||
const char bytes[] = {
|
const char bytes[] = {
|
||||||
// Unknown
|
// Unknown
|
||||||
0x00, 0x00,
|
'\x00', '\x00',
|
||||||
|
|
||||||
// Unknown
|
// Unknown
|
||||||
0x00, 0x00, 0x00, 0x00,
|
'\x00', '\x00', '\x00', '\x00',
|
||||||
|
|
||||||
// Timestamp
|
// Timestamp
|
||||||
0xDD, 0xCC, 0xBB, 0xAA,
|
'\xDD', '\xCC', '\xBB', '\xAA',
|
||||||
|
|
||||||
// Milliseconds
|
// Milliseconds
|
||||||
0xDD, 0xCC, 0xBB, 0xAA,
|
'\xDD', '\xCC', '\xBB', '\xAA',
|
||||||
|
|
||||||
// Session ID
|
// Session ID
|
||||||
0xCD, 0xAB
|
'\xCD', '\xAB'
|
||||||
};
|
};
|
||||||
std::istringstream iss(std::string(bytes, sizeof(bytes)));
|
std::istringstream iss(std::string(bytes, sizeof(bytes)));
|
||||||
|
|
||||||
|
@ -151,13 +151,13 @@ TEST_CASE("Control Message Deserialization", "[control]")
|
||||||
{
|
{
|
||||||
const char bytes[] = {
|
const char bytes[] = {
|
||||||
// Session ID
|
// Session ID
|
||||||
0xCD, 0xAB,
|
'\xCD', '\xAB',
|
||||||
|
|
||||||
// Milliseconds
|
// Milliseconds
|
||||||
0xCD, 0xAB,
|
'\xCD', '\xAB',
|
||||||
|
|
||||||
// Minutes
|
// Minutes
|
||||||
0xCD, 0xAB
|
'\xCD', '\xAB'
|
||||||
};
|
};
|
||||||
std::istringstream iss(std::string(bytes, sizeof(bytes)));
|
std::istringstream iss(std::string(bytes, sizeof(bytes)));
|
||||||
|
|
||||||
|
@ -173,10 +173,10 @@ TEST_CASE("Control Message Deserialization", "[control]")
|
||||||
{
|
{
|
||||||
const char bytes[] = {
|
const char bytes[] = {
|
||||||
// Unknown
|
// Unknown
|
||||||
0x00, 0x00,
|
'\x00', '\x00',
|
||||||
|
|
||||||
// Timestamp
|
// Timestamp
|
||||||
0xDD, 0xCC, 0xBB, 0xAA
|
'\xDD', '\xCC', '\xBB', '\xAA'
|
||||||
};
|
};
|
||||||
std::istringstream iss(std::string(bytes, sizeof(bytes)));
|
std::istringstream iss(std::string(bytes, sizeof(bytes)));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue