From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>
Cc: mst@redhat.com, coreyb@linux.vnet.ibm.com,
mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org,
jschopp@linux.vnet.ibm.com, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH v4 9/9] ASN.1 specific test cases
Date: Fri, 22 Mar 2013 13:07:49 -0400 [thread overview]
Message-ID: <514C8FE5.2030801@linux.vnet.ibm.com> (raw)
In-Reply-To: <514B8441.7050408@redhat.com>
On 03/21/2013 06:05 PM, Eric Blake wrote:
> On 03/21/2013 12:29 PM, Stefan Berger wrote:
>> +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?
Yes. Others are long but these lines are now the longest.
>
>> +++ 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()?
>
The visitor interface is used for serialization and de-serialization.
Upon de-serialization the underlying visitor can allocate memory for the
string it found while decoding, so you can pass in a pointer to a NULL
pointer and will get a valid pointer to the string back.
Stefan
prev parent reply other threads:[~2013-03-22 17:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-21 18:29 [Qemu-devel] [PATCH v4 0/9] Subject: Implement and test ASN.1 BER visitors Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 1/9] Move some contents of savevm.c to qemu-file.c Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 2/9] 3 new file wrappers Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 3/9] QEMUSizedBuffer Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 4/9] QAPI: add type_sized_buffer Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 5/9] ASN.1 output visitor Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 6/9] ASN.1 input visitor Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 7/9] Extend test-visitor-serialization with ASN.1 visitor(s) Stefan Berger
2013-03-21 21:59 ` Eric Blake
2013-03-21 22:06 ` Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 8/9] Update MAINTAINERS Stefan Berger
2013-03-21 18:29 ` [Qemu-devel] [PATCH v4 9/9] ASN.1 specific test cases Stefan Berger
2013-03-21 22:05 ` Eric Blake
2013-03-22 17:07 ` Stefan Berger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=514C8FE5.2030801@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=anthony@codemonkey.ws \
--cc=coreyb@linux.vnet.ibm.com \
--cc=eblake@redhat.com \
--cc=jschopp@linux.vnet.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.