+#include <string.h>
+
#include "thread_options.h"
static void string_to_cpu(char **dst, const uint8_t *src)
}
+/*
+ * Basic conversion test. We'd really need to fill in more of the options
+ * to have a thorough test. Even better, we should auto-generate the
+ * converter functions...
+ */
+int fio_test_cconv(struct thread_options *__o)
+{
+ struct thread_options o;
+ struct thread_options_pack top1, top2;
+
+ memset(&top1, 0, sizeof(top1));
+ memset(&top2, 0, sizeof(top2));
+
+ convert_thread_options_to_net(&top1, __o);
+ memset(&o, 0, sizeof(o));
+ convert_thread_options_to_cpu(&o, &top1);
+ convert_thread_options_to_net(&top2, &o);
+
+ return memcmp(&top1, &top2, sizeof(top1));
+}
return 0;
}
+extern int fio_check_options(struct thread_options *);
+
int parse_options(int argc, char *argv[])
{
int job_files, i;
if (fio_init_options())
return 1;
+ if (fio_test_cconv(&def_thread.o))
+ log_err("fio: failed internal cconv test\n");
job_files = parse_cmd_line(argc, argv);
extern void convert_thread_options_to_cpu(struct thread_options *o, struct thread_options_pack *top);
extern void convert_thread_options_to_net(struct thread_options_pack *top, struct thread_options *);
+extern int fio_test_cconv(struct thread_options *);
#endif