[mutter] tests/kms-utils: Add some basic 16:16 fixed tests
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] tests/kms-utils: Add some basic 16:16 fixed tests
- Date: Fri, 9 Jul 2021 22:58:02 +0000 (UTC)
commit c2c41bbf0a6c1d0210dee854217e140cb07fc134
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Jul 9 12:38:44 2021 +0200
tests/kms-utils: Add some basic 16:16 fixed tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1927>
src/tests/kms-utils-unit-tests.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/src/tests/kms-utils-unit-tests.c b/src/tests/kms-utils-unit-tests.c
index ae5bb5c818..324166d684 100644
--- a/src/tests/kms-utils-unit-tests.c
+++ b/src/tests/kms-utils-unit-tests.c
@@ -21,6 +21,7 @@
#include <glib.h>
#include "backends/native/meta-kms-utils.h"
+#include "backends/native/meta-kms-update.h"
typedef struct {
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
init_kms_utils_tests (void)
{
g_test_add_func ("/backends/native/kms/refresh-rate",
meta_test_kms_refresh_rate);
+ g_test_add_func ("/backends/native/kms/update/fixed16",
+ meta_test_kms_update_fixed16);
}
int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]