mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-02 09:40:15 +00:00
rgba/bgra from memory tests need htole() #1714
This commit is contained in:
parent
d4264586a0
commit
7f2635ced1
@ -170,7 +170,8 @@ TEST_CASE("Visual") {
|
|||||||
SUBCASE("LoadRGBAFromMemory") {
|
SUBCASE("LoadRGBAFromMemory") {
|
||||||
int dimy, dimx;
|
int dimy, dimx;
|
||||||
ncplane_dim_yx(ncp_, &dimy, &dimx);
|
ncplane_dim_yx(ncp_, &dimy, &dimx);
|
||||||
std::vector<uint32_t> rgba(dimx * dimy * 2, 0xff88bbcc);
|
// alpha, then b, g, r
|
||||||
|
std::vector<uint32_t> rgba(dimx * dimy * 2, htole(0xff88bbcc));
|
||||||
auto ncv = ncvisual_from_rgba(rgba.data(), dimy * 2, dimx * 4, dimx);
|
auto ncv = ncvisual_from_rgba(rgba.data(), dimy * 2, dimx * 4, dimx);
|
||||||
REQUIRE(ncv);
|
REQUIRE(ncv);
|
||||||
struct ncvisual_options opts{};
|
struct ncvisual_options opts{};
|
||||||
@ -195,7 +196,9 @@ TEST_CASE("Visual") {
|
|||||||
SUBCASE("LoadBGRAFromMemory") {
|
SUBCASE("LoadBGRAFromMemory") {
|
||||||
int dimy, dimx;
|
int dimy, dimx;
|
||||||
ncplane_dim_yx(ncp_, &dimy, &dimx);
|
ncplane_dim_yx(ncp_, &dimy, &dimx);
|
||||||
std::vector<uint32_t> rgba(dimx * dimy * 2, 0xff88bbcc);
|
// A should be at the highest memory address, which would be the most
|
||||||
|
// significant byte on little-endian. then r, g, b.
|
||||||
|
std::vector<uint32_t> rgba(dimx * dimy * 2, htole(0xff88bbcc));
|
||||||
auto ncv = ncvisual_from_bgra(rgba.data(), dimy * 2, dimx * 4, dimx);
|
auto ncv = ncvisual_from_bgra(rgba.data(), dimy * 2, dimx * 4, dimx);
|
||||||
REQUIRE(ncv);
|
REQUIRE(ncv);
|
||||||
struct ncvisual_options opts{};
|
struct ncvisual_options opts{};
|
||||||
|
Loading…
Reference in New Issue
Block a user