Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Are there any *printf (and *scanf) unit tests

605 views
Skip to first unread message

Daryle Walker

unread,
Jun 2, 2003, 4:29:15 PM6/2/03
to
I've been thinking of writing a *printf rip-off function. I'm wondering
if there are any unit tests for the printf function. How do the library
writer test their code? (I searched with <http://groups.google.com> and found posts with code _using_ printf in their unit tests. But I
want unit tests of printf itself.)

Is there a similar test suite for scanf?

Daryle

Dan Pop

unread,
Jun 3, 2003, 7:05:55 AM6/3/03
to

Check Plauger's book (The Standard C Library) and glibc's test suite.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Dan...@ifh.de

Fred J. Tydeman

unread,
Jun 3, 2003, 9:10:42 AM6/3/03
to

Go to the public FTP site:
ftp://jump.net/pub/tybor/
and get the file tbin2dec.c
It is one of several tests I have posted on that public site.
That particular test is of %e and %f of printf for the property:
"The value is rounded to the appropriate number of digits."

---
Fred J. Tydeman Tydeman Consulting
tyd...@tybor.com Programming, testing, numerics
+1 (775) 287-5904 Vice-chair of J11 (ANSI "C")
Sample C99+FPCE tests: ftp://jump.net/pub/tybor/
Savers sleep well, investors eat well, spenders work forever.

0 new messages