summaryrefslogtreecommitdiff
path: root/test/fence.cpp
AgeCommit message (Collapse)Author
2021-12-13test: fence: Signal fence onceJacopo Mondi
The unit test associates a fence with a framebuffer and makes sure the fence is correctly signalled. Once a fence is correctly signalled, it is released by the core, and the underlying file descriptor closed. The unit test however tries to write on the fence file descriptor every time the designated Request is queued, an error which is now visible as the return value of the fence signalling write() is checked. Fix that by associating a fence with a framebuffer only once. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2021-12-13test: fence: Check write return valueJacopo Mondi
The ::write() function used to signal a framebuffer fence in the unit test is marked with the 'warn_unused_result'. When building in debugoptimized mode not checking for the return value causes issues at build time: /test/fence.cpp:254:2: error: ignoring return value of function declared with 'warn_unused_result' attribute Fix that by checking the ::write() return value and emitting an error message in case the write fails. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reported-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2021-12-11test: fence: Add test for the Fence classJacopo Mondi
Add a test for the Fence class by testing a Fence failure case, and by testing a successfully signalled fence capture cycle. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>