Skip to content

Commit 7e0194b

Browse files
Parameterize tray icon update test
Convert the multiple-icon update unit test to a parameterized test (TEST_P) using TrayIconTest/GetParam. Set the initial testTray.icon from the parameter, use the parameter's alternateIcon for the first update, add WaitForTrayReady and captureScreenshot using the parameter name, then restore the original icon. This enables running the same test across different icon variants and capturing screenshots for each.
1 parent 2b7b7f6 commit 7e0194b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tests/unit/test_tray.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,16 +513,21 @@ TEST_F(TrayTest, TestCheckboxStates) {
513513
testTray.menu[1].checked = 1;
514514
}
515515

516-
TEST_F(TrayTest, TestMultipleIconUpdates) {
516+
TEST_P(TrayIconTest, TestMultipleIconUpdates) {
517+
const auto &iconParam = GetParam();
518+
testTray.icon = iconParam.icon;
519+
517520
int initResult = tray_init(&testTray);
518521
trayRunning = (initResult == 0);
519522
ASSERT_EQ(initResult, 0);
520523

521524
// Update icon multiple times
522-
testTray.icon = TRAY_ICON2;
525+
testTray.icon = iconParam.alternateIcon;
523526
tray_update(&testTray);
527+
WaitForTrayReady();
528+
EXPECT_TRUE(captureScreenshot(std::string("tray_icon_update_") + iconParam.name));
524529

525-
testTray.icon = TRAY_ICON1;
530+
testTray.icon = iconParam.icon;
526531
tray_update(&testTray);
527532
}
528533

0 commit comments

Comments
 (0)