Skip to content

Commit

Permalink
TESTS: Fix assigning a random pixel pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
HappySeaFox committed May 12, 2024
1 parent 3775cd6 commit 79ee4e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/bindings/c++/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ static MunitResult test_image_create(const MunitParameter params[], void *user_d
}

{
void *pixels = "abcdef";
// Peek a random pointer
void *pixels = &user_data;
sail::image image(pixels, SAIL_PIXEL_FORMAT_BPP24_RGB, 16, 16);
munit_assert(image.pixel_format() == SAIL_PIXEL_FORMAT_BPP24_RGB);
munit_assert_uint(image.width(), ==, 16);
Expand All @@ -68,7 +69,8 @@ static MunitResult test_image_create(const MunitParameter params[], void *user_d
}

{
void *pixels = "abcdef";
// Peek a random pointer
void *pixels = &user_data;
sail::image image(pixels, SAIL_PIXEL_FORMAT_BPP24_RGB, 16, 16, 50);
munit_assert(image.pixel_format() == SAIL_PIXEL_FORMAT_BPP24_RGB);
munit_assert_uint(image.width(), ==, 16);
Expand Down

0 comments on commit 79ee4e7

Please sign in to comment.