diff options
author | Andreas Henriksson <andreas@fatal.se> | 2018-12-30 22:43:22 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2019-01-08 20:31:00 +0100 |
commit | 0c49abcd8a8f88be6e53fd4c85a95ac487cfa4fb (patch) | |
tree | 37ec72b89b42a0118d2cad7f4780b2bab50eec34 /plugins/color/gcm-self-test.c | |
parent | b9488aa039df330bddecc688571ebb1cc896f34f (diff) | |
download | gnome-settings-daemon-0c49abcd8a8f88be6e53fd4c85a95ac487cfa4fb.tar.gz |
color: tests allow Goldstar and LG as vendor name
Since hwdb (systemd) 240, the old Goldstar name has been
replaced by LG.
Introduce a helper function to allow both old and new name
to pass the assertion check.
Fixes: #126
Diffstat (limited to 'plugins/color/gcm-self-test.c')
-rw-r--r-- | plugins/color/gcm-self-test.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/color/gcm-self-test.c b/plugins/color/gcm-self-test.c index f26e8b04..5cdcf987 100644 --- a/plugins/color/gcm-self-test.c +++ b/plugins/color/gcm-self-test.c @@ -218,6 +218,18 @@ gcm_test_night_light (void) g_assert_false (gsd_night_light_get_disabled_until_tmw (nlight)); } +static const gboolean +gcm_vendor_is_goldstar (const char * const vendor) { + if (g_strcmp0 (vendor, "Goldstar Company Ltd") == 0) + return TRUE; + /* Goldstar was changed to LG in hwdb (systemd) 240. + * https://github.com/systemd/systemd/commit/c6d7a5e9a3836f8 + */ + if (g_strcmp0 (vendor, "LG Electronics") == 0) + return TRUE; + return FALSE; +} + static void gcm_test_edid_func (void) { @@ -240,7 +252,7 @@ gcm_test_edid_func (void) g_assert (ret); g_assert_cmpstr (gcm_edid_get_monitor_name (edid), ==, "L225W"); - g_assert_cmpstr (gcm_edid_get_vendor_name (edid), ==, "Goldstar Company Ltd"); + g_assert_true (gcm_vendor_is_goldstar (gcm_edid_get_vendor_name (edid))); g_assert_cmpstr (gcm_edid_get_serial_number (edid), ==, "34398"); g_assert_cmpstr (gcm_edid_get_eisa_id (edid), ==, NULL); g_assert_cmpstr (gcm_edid_get_checksum (edid), ==, "0bb44865bb29984a4bae620656c31368"); |