devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Anton Staaf <robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [PATCH v3 3/3] dtc: Add support for variable sized cells
Date: Tue, 27 Sep 2011 10:55:29 +1000	[thread overview]
Message-ID: <20110927005529.GA5361@yookeroo.fritz.box> (raw)
In-Reply-To: <CAF6FioU6HmPw4UTHmiWFJPyXJGR5KtZR_4CW3be++S5vSR0GaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, Sep 26, 2011 at 10:15:48AM -0700, Anton Staaf wrote:
> On Sun, Sep 25, 2011 at 4:04 AM, David Gibson
> <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> > On Fri, Sep 23, 2011 at 11:02:54AM -0700, Anton Staaf wrote:
[snip]
> > Uh, so, this is actually worse than what you had before.  Remember
> > print_error() just prints an error, without aborting the parse.  So
> > now, if bits != 32 it will print the error, then add a phandle marker
> > *and* a bits-sized -1.  So later, when we go through and fix up the
> > REF_PHANDLE markers, we'll assume we're replacing 32-bits of data,
> > which could overrun the end of the data if the element size is less
> > than 32.
> >
> > So, basically the data_add_marker() needs to be in an else clause.
> 
> Yup, you're right.  I should first ask, I couldn't figure out how to write
> a test that tests parse error cases like this.  The closest I found was the
> check tests.  But they are specific to the check messages.  Is there a
> good example of a parse error test?  Or should I create a new type of test?

Yeah, I don't think we really have any tests like this.  In general
I've been less concerned about testing the error paths than the
working path, though testing error paths as well is not a bad idea.

So feel free to make a new test if you can think up one that makes
sense.  A simple "doesn't crash" test would be a start, that doesn't
care about the program's results, as long as it isn't killed by a
signal.  Actually testing that an error message is generated would
require more work though.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  parent reply	other threads:[~2011-09-27  0:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23 18:02 [PATCH v3 0/3] Variable sized cell support Anton Staaf
     [not found] ` <1316800974-30129-1-git-send-email-robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-23 18:02   ` [PATCH v3 1/3] libfdt: Add fdt16_to_cpu utility function Anton Staaf
     [not found]     ` <1316800974-30129-2-git-send-email-robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-24  0:59       ` David Gibson
2011-09-23 18:02   ` [PATCH v3 2/3] dtc: Add data_append_integer function Anton Staaf
     [not found]     ` <1316800974-30129-3-git-send-email-robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-24  1:00       ` David Gibson
2011-09-23 18:02   ` [PATCH v3 3/3] dtc: Add support for variable sized cells Anton Staaf
     [not found]     ` <1316800974-30129-4-git-send-email-robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-25 11:04       ` David Gibson
     [not found]         ` <20110925110454.GP12286-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-26 17:15           ` Anton Staaf
     [not found]             ` <CAF6FioU6HmPw4UTHmiWFJPyXJGR5KtZR_4CW3be++S5vSR0GaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-27  0:55               ` David Gibson [this message]
     [not found]                 ` <20110927005529.GA5361-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-27 16:46                   ` Anton Staaf
2011-09-26 20:48           ` Anton Staaf
     [not found]             ` <CAF6FioUGZV4P10Z9A1U65bdue9Tqr5DyAV++z8ZyJDeLMXGWgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-27  0:58               ` David Gibson
     [not found]                 ` <20110927005821.GB5361-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-27 16:41                   ` Anton Staaf

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=20110927005529.GA5361@yookeroo.fritz.box \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=robotboy-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).