~ubuntu-branches/ubuntu/natty/libvirt/natty-proposed

« back to all changes in this revision

Viewing changes to gnulib/tests/test-vasprintf.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Léonard
  • Date: 2010-07-06 12:14:33 UTC
  • mto: (3.4.17 sid) (1.2.6 upstream) (0.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 93.
  • Revision ID: james.westby@ubuntu.com-20100706121433-94utbax9zjvmkcsj
Tags: upstream-0.8.2
Import upstream version 0.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
      ASSERT (strcmp (result, "12345") == 0);
59
59
      free (result);
60
60
    }
 
61
 
 
62
  for (repeat = 0; repeat <= 8; repeat++)
 
63
    {
 
64
      char *result;
 
65
      int retval = my_asprintf (&result, "%08lx", 12345UL);
 
66
      ASSERT (retval == 8);
 
67
      ASSERT (result != NULL);
 
68
      ASSERT (strcmp (result, "00003039") == 0);
 
69
      free (result);
 
70
    }
61
71
}
62
72
 
63
73
static void
74
84
      ASSERT (strcmp (result, "12345") == 0);
75
85
      free (result);
76
86
    }
 
87
 
 
88
  for (repeat = 0; repeat <= 8; repeat++)
 
89
    {
 
90
      char *result;
 
91
      int retval = asprintf (&result, "%08lx", 12345UL);
 
92
      ASSERT (retval == 8);
 
93
      ASSERT (result != NULL);
 
94
      ASSERT (strcmp (result, "00003039") == 0);
 
95
      free (result);
 
96
    }
77
97
}
78
98
 
79
99
int