mirror of
https://github.com/brl/mutter.git
synced 2024-12-18 00:52:05 +00:00
tests/kms-utils: Add some basic 16:16 fixed tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1927>
This commit is contained in:
parent
021a401bc8
commit
c2c41bbf0a
@ -21,6 +21,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include "backends/native/meta-kms-utils.h"
|
#include "backends/native/meta-kms-utils.h"
|
||||||
|
#include "backends/native/meta-kms-update.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
drmModeModeInfo drm_mode;
|
drmModeModeInfo drm_mode;
|
||||||
@ -137,11 +138,22 @@ meta_test_kms_refresh_rate (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_test_kms_update_fixed16 (void)
|
||||||
|
{
|
||||||
|
g_assert_cmpint (meta_fixed_16_from_int (12345), ==, 809041920);
|
||||||
|
g_assert_cmpint (meta_fixed_16_to_int (809041920), ==, 12345);
|
||||||
|
g_assert_cmpint (meta_fixed_16_from_int (-12345), ==, -809041920);
|
||||||
|
g_assert_cmpint (meta_fixed_16_to_int (-809041920), ==, -12345);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_kms_utils_tests (void)
|
init_kms_utils_tests (void)
|
||||||
{
|
{
|
||||||
g_test_add_func ("/backends/native/kms/refresh-rate",
|
g_test_add_func ("/backends/native/kms/refresh-rate",
|
||||||
meta_test_kms_refresh_rate);
|
meta_test_kms_refresh_rate);
|
||||||
|
g_test_add_func ("/backends/native/kms/update/fixed16",
|
||||||
|
meta_test_kms_update_fixed16);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user