mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2025-01-13 20:01:35 +01:00
test: add liftoff_mock_commit_count
This allows tests to read the number of atomic commits performed by the library.
This commit is contained in:
parent
6849a6af1f
commit
ca0cbbee02
2 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
#include <xf86drmMode.h>
|
#include <xf86drmMode.h>
|
||||||
|
|
||||||
extern uint32_t liftoff_mock_drm_crtc_id;
|
extern uint32_t liftoff_mock_drm_crtc_id;
|
||||||
|
extern size_t liftoff_mock_commit_count;
|
||||||
|
|
||||||
struct liftoff_layer;
|
struct liftoff_layer;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#define MAX_PROPS 64
|
#define MAX_PROPS 64
|
||||||
|
|
||||||
uint32_t liftoff_mock_drm_crtc_id = 0xCC000000;
|
uint32_t liftoff_mock_drm_crtc_id = 0xCC000000;
|
||||||
|
size_t liftoff_mock_commit_count = 0;
|
||||||
|
|
||||||
struct liftoff_mock_plane {
|
struct liftoff_mock_plane {
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
|
@ -200,6 +201,8 @@ int drmModeAtomicCommit(int fd, drmModeAtomicReq *req, uint32_t flags,
|
||||||
assert_drm_fd(fd);
|
assert_drm_fd(fd);
|
||||||
assert(flags == DRM_MODE_ATOMIC_TEST_ONLY);
|
assert(flags == DRM_MODE_ATOMIC_TEST_ONLY);
|
||||||
|
|
||||||
|
liftoff_mock_commit_count++;
|
||||||
|
|
||||||
for (i = 0; i < MAX_PLANES; i++) {
|
for (i = 0; i < MAX_PLANES; i++) {
|
||||||
plane = &mock_planes[i];
|
plane = &mock_planes[i];
|
||||||
if (plane->id == 0) {
|
if (plane->id == 0) {
|
||||||
|
|
Loading…
Reference in a new issue