#include "qemu-common.h"
#include "qapi/error.h"
#include "qapi/string-output-visitor.h"
-#include "test-qapi-types.h"
#include "test-qapi-visit.h"
-#include "qapi/qmp/types.h"
typedef struct TestOutputVisitorData {
Visitor *ov;
Error *err = NULL;
char *str;
- for (i = 0; i < sizeof(value) / sizeof(value[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(value); i++) {
*tmp = g_malloc0(sizeof(**tmp));
(*tmp)->value = value[i];
tmp = &(*tmp)->next;
str = visitor_get(data);
if (data->human) {
- char *str_human = g_strdup_printf("\"%s\"", EnumOne_lookup[i]);
+ char *str_human = g_strdup_printf("\"%s\"", EnumOne_str(i));
g_assert_cmpstr(str, ==, str_human);
g_free(str_human);
} else {
- g_assert_cmpstr(str, ==, EnumOne_lookup[i]);
+ g_assert_cmpstr(str, ==, EnumOne_str(i));
}
visitor_reset(data);
}