about summary refs log tree commit diff
path: root/stdlib/tst-strtod2.c
blob: 925ea9cafab60f824814d927e16d997d842749c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <stdlib.h>

static int
do_test (void)
{
  int status = 0;
  const char s[] = "0x";
  char *ep;
  double r = strtod (s, &ep);
  if (r != 0)
    {
      printf ("r = %g, expect 0\n", r);
      status = 1;
    }
  if (ep != s + 1)
    {
      printf ("strtod parsed %ju characters, expected 1\n", ep - s);
      status = 1;
    }
  return status;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"