mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
Add tests.
2006-06-16 Matthias Clasen <mclasen@redhat.com> * tests/file-test.c (test_mkstemp): Add tests. * glib/gfileutils.c (g_mkstemp): Allow the XXXXXX to occur inside the template, not just at the end.
This commit is contained in:
committed by
Matthias Clasen
parent
dd106106dc
commit
6cc8a27894
@@ -60,7 +60,13 @@ test_mkstemp (void)
|
||||
strcpy (template, "foobar");
|
||||
fd = g_mkstemp (template);
|
||||
if (fd != -1)
|
||||
g_warning ("g_mkstemp works even if template doesn't end in XXXXXX");
|
||||
g_warning ("g_mkstemp works even if template doesn't contain XXXXXX");
|
||||
close (fd);
|
||||
|
||||
strcpy (template, "foobarXXX");
|
||||
fd = g_mkstemp (template);
|
||||
if (fd != -1)
|
||||
g_warning ("g_mkstemp works even if template contains less than six X");
|
||||
close (fd);
|
||||
|
||||
strcpy (template, "fooXXXXXX");
|
||||
@@ -80,6 +86,13 @@ test_mkstemp (void)
|
||||
|
||||
close (fd);
|
||||
remove (template);
|
||||
|
||||
strcpy (template, "fooXXXXXX.pdf");
|
||||
fd = g_mkstemp (template);
|
||||
g_assert (fd != -1 && "g_mkstemp didn't work for template fooXXXXXX.pdf");
|
||||
|
||||
close (fd);
|
||||
remove (template);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user