mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +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 <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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user