diff options
author | Richard Hughes <richard@hughsie.com> | 2014-08-14 14:51:51 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-08-14 14:51:51 +0100 |
commit | 7cc97189ea76bf78fb086cc4d86f834d0248180c (patch) | |
tree | 05c64ec7d92956e172259ff40deedc3ebb66a0bc | |
parent | 5a9987bda3a83e2bd93a1834d466eb4664b661e0 (diff) | |
download | colord-7cc97189ea76bf78fb086cc4d86f834d0248180c.tar.gz |
trivial: Add another self test with a broken EDID
-rw-r--r-- | data/tests/DELL-U2713H.bin | bin | 0 -> 256 bytes | |||
-rw-r--r-- | data/tests/Makefile.am | 1 | ||||
-rw-r--r-- | lib/colord/cd-test-private.c | 24 |
3 files changed, 25 insertions, 0 deletions
diff --git a/data/tests/DELL-U2713H.bin b/data/tests/DELL-U2713H.bin Binary files differnew file mode 100644 index 0000000..3121f32 --- /dev/null +++ b/data/tests/DELL-U2713H.bin diff --git a/data/tests/Makefile.am b/data/tests/Makefile.am index b2b894d..e60a492 100644 --- a/data/tests/Makefile.am +++ b/data/tests/Makefile.am @@ -1,4 +1,5 @@ test_files = \ + DELL-U2713H.bin.bin \ LG-L225W-External.bin \ Lenovo-T61-Internal.bin \ calibration.ccmx \ diff --git a/lib/colord/cd-test-private.c b/lib/colord/cd-test-private.c index cdf88aa..bb36ee5 100644 --- a/lib/colord/cd-test-private.c +++ b/lib/colord/cd-test-private.c @@ -1989,6 +1989,30 @@ colord_edid_func (void) g_assert_cmpfloat (cd_edid_get_gamma (edid), <, 2.2f + 0.01); g_free (data); + /* Dell external Panel */ + filename = cd_test_get_filename ("DELL-U2713H.bin"); + g_assert (filename != NULL); + ret = g_file_get_contents (filename, &data, &length, &error); + g_assert_no_error (error); + g_assert (ret); + data_edid = g_bytes_new (data, length); + ret = cd_edid_parse (edid, data_edid, &error); + g_assert_no_error (error); + g_assert (ret); + g_free (filename); + g_bytes_unref (data_edid); + g_assert_cmpstr (cd_edid_get_monitor_name (edid), ==, "DELL U2713H"); + g_assert_cmpstr (cd_edid_get_vendor_name (edid), ==, "Dell"); + g_assert_cmpstr (cd_edid_get_serial_number (edid), ==, "C6F0K34T1CWL"); + g_assert_cmpstr (cd_edid_get_eisa_id (edid), ==, NULL); + g_assert_cmpstr (cd_edid_get_checksum (edid), ==, "ac6dab5272cfbd2e87dd9c635f4c0e9d"); + g_assert_cmpstr (cd_edid_get_pnp_id (edid), ==, "DEL"); + g_assert_cmpint (cd_edid_get_height (edid), ==, 34); + g_assert_cmpint (cd_edid_get_width (edid), ==, 60); + g_assert_cmpfloat (cd_edid_get_gamma (edid), >=, 2.2f - 0.01); + g_assert_cmpfloat (cd_edid_get_gamma (edid), <, 2.2f + 0.01); + g_free (data); + g_object_unref (edid); } |