mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
memoryformat: Add test for depth merging
We want to ensure a few invariants: - merge (a, a) == a - merge (a, b) == merge (b, a) Add tests to verify that this is now the case.
This commit is contained in:
parent
1bbf5f7a17
commit
4253bb9922
25
testsuite/gdk/memoryformat.c
Normal file
25
testsuite/gdk/memoryformat.c
Normal file
@ -0,0 +1,25 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkmemoryformatprivate.h>
|
||||
|
||||
static void
|
||||
test_depth_merge (void)
|
||||
{
|
||||
for (GdkMemoryDepth depth1 = GDK_MEMORY_U8; depth1 < GDK_N_DEPTHS; depth1++)
|
||||
{
|
||||
g_assert_cmpint (gdk_memory_depth_merge (depth1, depth1), ==, depth1);
|
||||
for (GdkMemoryDepth depth2 = GDK_MEMORY_U8; depth2 < depth1; depth2++)
|
||||
{
|
||||
g_assert_cmpint (gdk_memory_depth_merge (depth1, depth2), ==, gdk_memory_depth_merge (depth2, depth1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
(g_test_init) (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/depth/merge", test_depth_merge);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
@ -63,6 +63,7 @@ internal_tests = [
|
||||
{ 'name': 'texture' },
|
||||
{ 'name': 'gltexture' },
|
||||
{ 'name': 'subsurface' },
|
||||
{ 'name': 'memoryformat' },
|
||||
]
|
||||
|
||||
if os_linux
|
||||
|
Loading…
Reference in New Issue
Block a user