diff --git a/tests/Makefile.am b/tests/Makefile.am index 0f417f7..7df10d0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -172,6 +172,8 @@ endif # ENABLE_GLX TESTS_EGL = TESTS_EGL += testegldisplay.sh TESTS_EGL += testegldevice.sh +TESTS_EGL += testegldeviceadd_querydevices.sh +TESTS_EGL += testegldeviceadd_returndevice.sh TESTS_EGL += testeglgetprocaddress.sh TESTS_EGL += testeglmakecurrent.sh TESTS_EGL += testeglerror.sh @@ -193,6 +195,12 @@ testegldevice_SOURCES = \ egl_test_utils.c testegldevice_LDADD = $(top_builddir)/src/EGL/libEGL.la @LIB_DL@ +check_PROGRAMS += testegldeviceadd +testegldeviceadd_SOURCES = \ + testegldeviceadd.c \ + egl_test_utils.c +testegldeviceadd_LDADD = $(top_builddir)/src/EGL/libEGL.la @LIB_DL@ + check_PROGRAMS += testeglgetprocaddress testeglgetprocaddress_SOURCES = \ testeglgetprocaddress.c \ diff --git a/tests/meson.build b/tests/meson.build index 2173b48..8be6cf3 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -215,5 +215,22 @@ if get_option('egl') depends : libEGL_dummy, ) endforeach + + exe_egldeviceadd = executable( + 'egldeviceadd', + ['testegldeviceadd.c', 'egl_test_utils.c'], + include_directories : [inc_include], + link_with : [libEGL], + dependencies : [dep_dl], + ) + foreach t : [ 'querydevices', 'returndevice' ] + test( + 'egldeviceadd (@0@)'.format(t), + exe_egldeviceadd, + args : [t], + env : env_egl, + suite : ['egl'], + ) + endforeach endif diff --git a/tests/testegldeviceadd.c b/tests/testegldeviceadd.c new file mode 100644 index 0000000..3c10e31 --- /dev/null +++ b/tests/testegldeviceadd.c @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * unaltered in all copies or substantial portions of the Materials. + * Any additions, deletions, or changes to the original source files + * must be clearly indicated in accompanying documentation. + * + * If only executable code is distributed, then the accompanying + * documentation must state that "this software is based in part on the + * work of the Khronos Group." + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + */ + +#include +#include +#include +#include +#include + +#include "dummy/EGL_dummy.h" +#include "egl_test_utils.h" + +#define DEVICE_ARRAY_SIZE (DUMMY_EGL_MAX_DEVICE_COUNT * DUMMY_VENDOR_COUNT) + +EGLBoolean CheckDeviceHandles(EGLDeviceEXT *devices, EGLint count) +{ + EGLint i, j; + + for (i=0; i