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:
Simon Ser 2019-10-14 18:34:32 +03:00
parent 6849a6af1f
commit ca0cbbee02
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 4 additions and 0 deletions

View file

@ -6,6 +6,7 @@
#include <xf86drmMode.h>
extern uint32_t liftoff_mock_drm_crtc_id;
extern size_t liftoff_mock_commit_count;
struct liftoff_layer;

View file

@ -13,6 +13,7 @@
#define MAX_PROPS 64
uint32_t liftoff_mock_drm_crtc_id = 0xCC000000;
size_t liftoff_mock_commit_count = 0;
struct liftoff_mock_plane {
uint32_t id;
@ -200,6 +201,8 @@ int drmModeAtomicCommit(int fd, drmModeAtomicReq *req, uint32_t flags,
assert_drm_fd(fd);
assert(flags == DRM_MODE_ATOMIC_TEST_ONLY);
liftoff_mock_commit_count++;
for (i = 0; i < MAX_PLANES; i++) {
plane = &mock_planes[i];
if (plane->id == 0) {