-/* $OpenBSD: fmt_test.c,v 1.10 2012/11/12 14:10:48 halex Exp $ */
+/* $OpenBSD: fmt_test.c,v 1.11 2016/08/14 23:08:09 guenther Exp $ */
/*
* Combined tests for fmt_scaled and scan_scaled.
static void print_errno(int e);
static int assert_int(int testnum, int checknum, int expect, int result);
static int assert_errno(int testnum, int checknum, int expect, int result);
-static int assert_quad_t(int testnum, int checknum, quad_t expect, quad_t result);
+static int assert_llong(int testnum, int checknum, long long expect, long long result);
static int assert_str(int testnum, int checknum, char * expect, char * result);
extern char *__progname;
/************** tests for fmt_scaled *******************/
static struct { /* the test cases */
- quad_t input;
+ long long input;
char *expect;
int err;
} ddata[] = {
struct { /* the test cases */
char *input;
- quad_t result;
+ long long result;
int err;
} sdata[] = {
{ "0", 0, 0 },
/** Print one result */
static void
-print(char *input, quad_t result, int ret)
+print(char *input, long long result, int ret)
{
int e = errno;
printf("\"%10s\" --> %lld (%d)", input, result, ret);
{
unsigned int i, errs = 0, e;
int ret;
- quad_t result;
+ long long result;
for (i = 0; i < SDATA_LENGTH; i++) {
result = IMPROBABLE;
if (sdata[i].err)
errs += assert_errno(i, 2, sdata[i].err, errno);
else
- errs += assert_quad_t(i, 3, sdata[i].result, result);
+ errs += assert_llong(i, 3, sdata[i].result, result);
}
return errs;
}
}
static int
-assert_quad_t(int testnum, int check, quad_t expect, quad_t result)
+assert_llong(int testnum, int check, long long expect, long long result)
{
if (expect == result)
return 0;