Skip to content

Commit

Permalink
Fix the autotest failure caused by github random runners.
Browse files Browse the repository at this point in the history
  • Loading branch information
domchen committed Oct 26, 2023
1 parent b90f7ac commit 7536090
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/autotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:

jobs:
mac:
runs-on: macos-latest
# the macos-latest may randomly give us macos-12.6.9 or macos-12.7.0 which may break the autotest.
runs-on: macos-13
steps:
- name: Check Out Repo
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion test/baseline/version.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"PixelMap_RGBA_to_RGBA_100_-100": "d010fb8",
"PixelMap_RGBA_to_RGBA_100_100": "d010fb8",
"PixelMap_RGBA_to_RGBA_1010102": "d010fb8",
"PixelMap_RGBA_to_RGBA_F16": "c433c89",
"PixelMap_RGBA_to_RGBA_F16": "926727c",
"PixelMap_RGBA_to_bgr_A": "d010fb8",
"PixelMap_RGBA_to_rgb_A": "d010fb8",
"PixelMap_alpha_to_BGRA": "d010fb8",
Expand Down
7 changes: 2 additions & 5 deletions test/src/ReadPixelsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TGFX_TEST(ReadPixelsTest, PixelMap) {
auto RGBAInfo = ImageInfo::Make(width, height, ColorType::RGBA_8888, AlphaType::Unpremultiplied);
auto byteSize = RGBAInfo.byteSize();
Buffer pixelsA(byteSize);
Buffer pixelsB(byteSize * 3);
Buffer pixelsB(byteSize * 2);
auto result = codec->readPixels(RGBAInfo, pixelsA.data());
EXPECT_TRUE(result);

Expand All @@ -65,10 +65,7 @@ TGFX_TEST(ReadPixelsTest, PixelMap) {
CHECK_PIXELS(Gray8Info, pixelsB.data(), "PixelMap_RGBA_to_Gray8");

pixelsB.clear();
// Set the rowByte != width * 8 to force the RGBA_F16 PixelMap converted to RGBA_8888 when doing
// baseline comparing. Otherwise, the RGBA_F16 data may have floating error when compared.
auto f16RowBytes = (width + 1) * 8;
auto RGBAF16Info = RGBAInfo.makeColorType(ColorType::RGBA_F16, f16RowBytes);
auto RGBAF16Info = RGBAInfo.makeColorType(ColorType::RGBA_F16);
result = RGBAMap.readPixels(RGBAF16Info, pixelsB.data());
ASSERT_TRUE(result);
CHECK_PIXELS(RGBAF16Info, pixelsB.data(), "PixelMap_RGBA_to_RGBA_F16");
Expand Down

0 comments on commit 7536090

Please sign in to comment.