mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Solar Designer <solar@openwall.com>
To: musl@lists.openwall.com
Subject: specification of cluts tests - code or/and data? (was: Weekly reports - B)
Date: Mon, 13 Jun 2011 06:22:31 +0400	[thread overview]
Message-ID: <20110613022231.GA21480@openwall.com> (raw)
In-Reply-To: <20110613021130.GA21268@openwall.com>

Luka, Rich -

On Mon, Jun 13, 2011 at 06:11:30AM +0400, Solar Designer wrote:
> Overall, I think the code could be made prettier.  I'll post an idea
> (which you don't have to use, but you may) in another message.

Here's what I meant:

Rather than write a piece of code for testing every property of every
function, we could consider implementing interpreters or wrapper
functions for common tests, or tables (arrays of structs) listing similar
tests.  A problem here is that call to a string function via a function
pointer might not invoke the same implementation that direct use would
(there could be a macro or a C compiler builtin).  On the other hand,
this also means that whatever approach to program structure we choose,
we could want to test both kinds of uses of string functions (direct and
via function pointer), to test both implementations (which might be
present).

This is not directly relevant, but to illustrate the use of interpreter
or data structure approach to a task where most people tend to write
lots of code instead, see:

http://openwall.info/wiki/people/solar/software/public-domain-source-code/intel-80186-disassembler

This is a complete i80186 disassembler in only 164 bytes of code, plus
some 2.5 KB of data (17 KB source).  Other disassemblers I saw typically
process the different instruction types, addressing modes, etc. in code,
and are much larger (in terms of code+data, as well as their source code).

Maybe this will give you some inspiration for coming up with suitable
data structures to define some classes of tests.  You do not have to
take it to the same "extreme" level - very generic code, data structures
that are tricky to specify in C.  You'll need to find a balance that
works well for cluts.

And you do not have to use an approach like this at all.  You may
continue as you have started.  I just thought I'd mention the option.

Maybe this helps.

Alexander


  parent reply	other threads:[~2011-06-13  2:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 20:20 Weekly reports - B Luka Marčetić
2011-06-12 23:13 ` Rich Felker
2011-06-13  2:11 ` Solar Designer
2011-06-13  2:22   ` Rich Felker
2011-06-13  2:56     ` Solar Designer
2011-06-13  4:54       ` Rich Felker
2011-06-13  6:48         ` Solar Designer
2011-07-06 11:35         ` errno (was: Weekly reports - B) Solar Designer
2011-07-06 12:57           ` Szabolcs Nagy
2011-07-06 13:14             ` errno Solar Designer
2011-07-07  2:56           ` errno (was: Weekly reports - B) Rich Felker
2011-06-26 21:05     ` Weekly reports - X Luka Marčetić
2011-06-26 21:13       ` rich felker
2011-06-27 22:18         ` Solar Designer
2011-07-04 19:30           ` Luka Marčetić
2011-07-04 19:39             ` Rich Felker
2011-06-13  2:22   ` Solar Designer [this message]
2011-06-13  9:19     ` specification of cluts tests - code or/and data? Solar Designer
2011-07-09  6:41 ` cluts repository (was: Weekly reports - B) Solar Designer
2011-07-09 11:31   ` cluts repository Solar Designer

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=20110613022231.GA21480@openwall.com \
    --to=solar@openwall.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).