Back to index

glibc  2.9
Defines | Functions | Variables
bug16.c File Reference
#include <stdio.h>
#include <string.h>
#include "../test-skeleton.c"

Go to the source code of this file.

Defines

#define TEST_FUNCTION   do_test ()

Functions

static int do_test (void)

Variables

struct {
long double val
const char str [4][7]
tests []

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 42 of file bug16.c.


Function Documentation

static int do_test ( void  ) [static]

Definition at line 17 of file bug16.c.

{
  char buf[100];
  int ret = 0;

  for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
    {  
      snprintf (buf, sizeof (buf), "%.0LA", tests[i].val);

      size_t j;
      for (j = 0; j < 4; ++j)
       if (strcmp (buf, tests[i].str[j]) == 0)
         break;

      if (j == 4)
       {
         printf ("%zd: got \"%s\", expected \"%s\" or equivalent\n",
                i, buf, tests[i].str[0]);
         ret = 1;
       }
    }

  return ret;
}

Here is the call graph for this function:


Variable Documentation

struct { ... } tests[]