mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
event-test: Enforce domain event sync
Use verify to force adding new events by means of static assertions.
This commit is contained in:
parent
09b28782de
commit
dc7aeeade1
@ -6,6 +6,8 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include <verify.h>
|
||||||
|
|
||||||
#define VIR_ENUM_SENTINELS
|
#define VIR_ENUM_SENTINELS
|
||||||
|
|
||||||
#include <libvirt/libvirt.h>
|
#include <libvirt/libvirt.h>
|
||||||
@ -887,6 +889,9 @@ struct domainEventData domainEvents[] = {
|
|||||||
DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED, myDomainEventDeviceRemovalFailedCallback),
|
DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED, myDomainEventDeviceRemovalFailedCallback),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* make sure that the events are kept in sync */
|
||||||
|
verify(ARRAY_CARDINALITY(domainEvents) == VIR_DOMAIN_EVENT_ID_LAST);
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user