提交 dc7aeead 编写于 作者: P Peter Krempa

event-test: Enforce domain event sync

Use verify to force adding new events by means of static assertions.
上级 09b28782
...@@ -6,6 +6,8 @@ ...@@ -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[] = { ...@@ -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)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册