mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-06 04:15:59 -04:00
Fix local variable shadowing
This commit is contained in:
parent
a8ec68a625
commit
9c89af064d
@ -116,6 +116,7 @@ BEGIN_TEST()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Short test for ContainerRWops
|
// Short test for ContainerRWops
|
||||||
|
{
|
||||||
{
|
{
|
||||||
const std::vector<char> buffer = { 'a', 'b', 'c', 'd' };
|
const std::vector<char> buffer = { 'a', 'b', 'c', 'd' };
|
||||||
|
|
||||||
@ -140,13 +141,15 @@ BEGIN_TEST()
|
|||||||
EXPECT_TRUE(rw.Write(buf, 1, 4) == 0);
|
EXPECT_TRUE(rw.Write(buf, 1, 4) == 0);
|
||||||
EXPECT_TRUE(rw.Write(buf, 4, 1) == 0);
|
EXPECT_TRUE(rw.Write(buf, 4, 1) == 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Write to non-const container
|
|
||||||
std::vector<char> vec;
|
std::vector<char> vec;
|
||||||
|
|
||||||
RWops rw((ContainerRWops<std::vector<char>>(vec)));
|
RWops rw((ContainerRWops<std::vector<char>>(vec)));
|
||||||
|
|
||||||
|
{
|
||||||
|
// Write to non-const container
|
||||||
char buf[4] = {'a', 'b', 'c', 'd'};
|
char buf[4] = {'a', 'b', 'c', 'd'};
|
||||||
|
|
||||||
EXPECT_TRUE(rw.Write(buf, 1, 4) == 4);
|
EXPECT_TRUE(rw.Write(buf, 1, 4) == 4);
|
||||||
@ -159,6 +162,7 @@ BEGIN_TEST()
|
|||||||
EXPECT_TRUE(std::string(vec.data(), 8) == "ababcdcd");
|
EXPECT_TRUE(std::string(vec.data(), 8) == "ababcdcd");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Test for StreamRWops
|
// Test for StreamRWops
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user