event-test: Enforce domain event sync

Use verify to force adding new events by means of static assertions.
This commit is contained in:
Peter Krempa 2016-04-14 17:41:19 +02:00
parent 09b28782de
commit dc7aeeade1

View File

@ -6,6 +6,8 @@
#include <signal.h>
#include <inttypes.h>
#include <verify.h>
#define VIR_ENUM_SENTINELS
#include <libvirt/libvirt.h>
@ -887,6 +889,9 @@ struct domainEventData domainEvents[] = {
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
main(int argc, char **argv)
{