On 03/21/2013 12:29 PM, Stefan Berger wrote: > BER visitor tests give us some assurance that the BER visitor > code works, and also end up by extention helping out on our
s/extention/extension/ > code coverage of the filesystem tests. > After the output visitor invocation the resuling buffer is s/resuling/resulting/ > compared against a known byte stream -- this will lock the > implementation into producing specific byte arrays. > > Signed-off-by: Stefan Berger <[email protected]> > Signed-off-by: Joel Schopp <[email protected]> > --- > tests/Makefile | 9 + > tests/test-ber-visitor.c | 746 > +++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 755 insertions(+) > create mode 100644 tests/test-ber-visitor.c > > +tests/test-ber-visitor.o: $(addprefix include/qapi/, ber.h > ber-input-visitor.h ber-output-visitor.h) $(addprefix qapi/, ber-common.c > ber-input-visitor.c ber-output-visitor.c) > +tests/test-ber-visitor$(EXESUF): tests/test-ber-visitor.o $(tools-obj-y) > qapi/ber-output-visitor.o qapi/ber-input-visitor.o qapi/ber-common.o > $(block-obj-y) libqemuutil.a libqemustub.a Long lines - worth using backslash-newline continuation? > +++ b/tests/test-ber-visitor.c > @@ -0,0 +1,746 @@ > +/* > + * BER Output Visitor unit-tests. > + * > + * Copyright (C) 2011 Red Hat Inc. > + * Copyright (C) 2011 IBM Corporation It's 2013 (probably applies to other files earlier in the series, as well). > +static void test_visitor_out_string(TestInputOutputVisitor *data, > + const void *unused) > +{ > + char *string_in = (char *) "Q E M U", *string_out = NULL; Does the fact that you have to cast here... > + Error *errp = NULL; > + > + visit_type_str(data->ov, &string_in, NULL, &errp); ...indicate a lack of const-correctness on visit_type_str()? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
