Subject: [tap] TAP in C.

From: Michael G Schwern <[email-masked]>
Date: Sat, 13 Sep 2008 02:52:47 -0700

This tickled me, implementing skip_all() using #ifdefs in C, so I thought I'd
share it.  Also there hasn't been much traffic in a while, what's up?

#include <errno.h>
#include "localtime64.h"
#include "tap.c"

int main(void) {
    Time64_T time = 0x0FFFFFFFFFFFFFFFLL;;
    struct tm date;
    struct tm *error;

#ifndef EOVERFLOW
    skip_all( "EOVERFLOW not defined on this system" );
#else
    if( sizeof(date.tm_year) > 4 )
        skip_all( "tm_year is too large to overflow (yay!)" );

    error = gmtime64_r(&time, &date);

    ok( error == NULL,          "gmtime64_r() returned null on overflow" );
    is_int( errno, EOVERFLOW,   "  errno set to EOVERFLOW" );

    done_testing();
#endif

    return 0;
}

I'm also tickled by how simple it is to implement a basic TAP library in C.
http://code.google.com/p/y2038/source/browse/trunk/tap.c

-- 
Stabbing you in the face so you don't have to.

_______________________________________________
tap mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/tap

---

From: Paul Johnson <[email-masked]>
Date: Sat, 13 Sep 2008 23:32:29 +0200

> http://code.google.com/p/y2038/source/browse/trunk/tap.c

I noticed your comment:

    Added diag() to TAP but it's not very useful because it's hard to
    pass in sprintf'd strings.  It needs to do the sprintfing.

Perhaps a diagf() function would be useful calling vfprintf() instead of
fprintf() ?

And perhaps an okf() and other *f() variants would be useful?

Or perhaps YAGNI?

-- 
Paul Johnson - [email-masked]
http://www.pjcj.net
_______________________________________________
tap mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/tap

---

From: Michael G Schwern <[email-masked]>
Date: Sat, 13 Sep 2008 14:57:07 -0700

> Perhaps a diagf() function would be useful calling vfprintf() instead of

Ahh, vfprintf!  That's what I was missing.  Thanks.

> And perhaps an okf() and other *f() variants would be useful?

Nahh, just make everything take sprintf() formats and args for the test
description.

> Or perhaps YAGNI?

Oh, no, I definitely NI.

-- 
Hating the web since 1994.
_______________________________________________
tap mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/tap