deal with possible endianness problems in bitmap tests #1627

This commit is contained in:
nick black 2021-05-06 10:09:20 -04:00
parent 02af161b98
commit 6a2ed461df
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -207,7 +207,7 @@ TEST_CASE("Bitmaps") {
// first, assemble a visual equivalent to 1 cell
auto y = nc_->tcache.cellpixy;
auto x = nc_->tcache.cellpixx;
std::vector<uint32_t> v(x * y, htole(0xffffff00));
std::vector<uint32_t> v(x * y, htole(0xffffffff));
auto ncv = ncvisual_from_rgba(v.data(), y, sizeof(decltype(v)::value_type) * x, x);
REQUIRE(nullptr != ncv);
struct ncvisual_options vopts = {
@ -310,7 +310,7 @@ TEST_CASE("Bitmaps") {
};
auto y = nc_->tcache.cellpixy * 6;
auto x = nc_->tcache.cellpixx;
std::vector<uint32_t> v(x * y, htole(0xffffff00));
std::vector<uint32_t> v(x * y, htole(0xffffffff));
auto ncv = ncvisual_from_rgba(v.data(), y, sizeof(decltype(v)::value_type) * x, x);
REQUIRE(nullptr != ncv);
auto child = ncvisual_render(nc_, ncv, &vopts);
@ -352,7 +352,7 @@ TEST_CASE("Bitmaps") {
};
auto y = nc_->tcache.cellpixy * 6;
auto x = nc_->tcache.cellpixx;
std::vector<uint32_t> v(x * y, htole(0xffffff00));
std::vector<uint32_t> v(x * y, htole(0xffffffff));
auto ncv = ncvisual_from_rgba(v.data(), y, sizeof(decltype(v)::value_type) * x, x);
REQUIRE(nullptr != ncv);
auto child = ncvisual_render(nc_, ncv, &vopts);
@ -407,7 +407,7 @@ TEST_CASE("Bitmaps") {
auto x = 2 * nc_->tcache.cellpixx;
std::vector<uint32_t> v(x * y, htole(0xffffffff));
for(auto& e : v){
e -= random() % 0x1000000;
e -= htole(random() % 0x1000000);
}
auto ncv = ncvisual_from_rgba(v.data(), y, sizeof(decltype(v)::value_type) * x, x);
REQUIRE(nullptr != ncv);
@ -445,7 +445,7 @@ TEST_CASE("Bitmaps") {
auto x = 10 * nc_->tcache.cellpixx;
std::vector<uint32_t> v(x * y, htole(0xffffffff));
for(auto& e : v){
e -= random() % 0x1000000;
e -= htole(random() % 0x1000000);
}
auto ncv = ncvisual_from_rgba(v.data(), y, sizeof(decltype(v)::value_type) * x, x);
REQUIRE(nullptr != ncv);