mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
deal with possible endianness problems in bitmap tests #1627
This commit is contained in:
parent
02af161b98
commit
6a2ed461df
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user