qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 9/9] ASN.1 specific test cases


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v4 9/9] ASN.1 specific test cases
Date: Thu, 21 Mar 2013 16:05:53 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

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 <address@hidden>
> Signed-off-by: Joel Schopp <address@hidden>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]