tests/monitor-transform: Also test invert()

Commit e06daa58c3 changed the tested values to use corresponding valid
enum values instead of negative ones. Unfortunately that made one value
become a duplicate of an existing one and also in part defeated the original
intention of checking the implementation of
`meta_output_crtc_to_logical_transform`.

Use `meta_monitor_transform_invert` to fix both shortcomings.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1242
This commit is contained in:
Robert Mader 2020-05-09 02:12:30 +02:00 committed by Jonas Ådahl
parent cfa2d1abf7
commit dec97a6541
2 changed files with 6 additions and 4 deletions

View File

@ -52,6 +52,7 @@ meta_monitor_transform_is_flipped (MetaMonitorTransform transform)
return (transform >= META_MONITOR_TRANSFORM_FLIPPED);
}
META_EXPORT_TEST
MetaMonitorTransform meta_monitor_transform_invert (MetaMonitorTransform transform);
META_EXPORT_TEST

View File

@ -62,22 +62,23 @@ test_transform (void)
},
{
.transform = META_MONITOR_TRANSFORM_NORMAL,
.other = META_MONITOR_TRANSFORM_270,
.other = meta_monitor_transform_invert (META_MONITOR_TRANSFORM_90),
.expect = META_MONITOR_TRANSFORM_270,
},
{
.transform = META_MONITOR_TRANSFORM_FLIPPED,
.other = META_MONITOR_TRANSFORM_270,
.other = meta_monitor_transform_invert (META_MONITOR_TRANSFORM_90),
.expect = META_MONITOR_TRANSFORM_FLIPPED_270,
},
{
.transform = META_MONITOR_TRANSFORM_FLIPPED_180,
.other = META_MONITOR_TRANSFORM_90,
.other = meta_monitor_transform_invert (META_MONITOR_TRANSFORM_270),
.expect = META_MONITOR_TRANSFORM_FLIPPED_270,
},
{
.transform = META_MONITOR_TRANSFORM_FLIPPED_180,
.other = META_MONITOR_TRANSFORM_FLIPPED_180,
.other =
meta_monitor_transform_invert (META_MONITOR_TRANSFORM_FLIPPED_180),
.expect = META_MONITOR_TRANSFORM_NORMAL,
},
};