fontconfig/fontconfig-test-delay.patch

57 lines
2.0 KiB
Diff
Raw Normal View History

diff -pruN fontconfig-2.13.1.orig/test/test-bz106632.c fontconfig-2.13.1/test/test-bz106632.c
--- fontconfig-2.13.1.orig/test/test-bz106632.c 2018-08-29 09:55:14.000000000 +0000
+++ fontconfig-2.13.1/test/test-bz106632.c 2018-11-13 11:57:37.822142424 +0000
@@ -197,7 +197,7 @@ main (void)
mkdir_p (cachedir);
fprintf (stderr, "D: Copying %s to %s\n", FONTFILE, fontdir);
- snprintf (cmd, 512, "cp -a %s %s", FONTFILE, fontdir);
+ snprintf (cmd, 512, "sleep 1; cp -a %s %s; sleep 1", FONTFILE, fontdir);
system (cmd);
fprintf (stderr, "D: Loading a config\n");
@@ -226,15 +226,21 @@ main (void)
goto bail;
}
fprintf (stderr, "D: Removing %s\n", fontdir);
- snprintf (cmd, 512, "rm -f %s%s*", fontdir, FC_DIR_SEPARATOR_S);
+ snprintf (cmd, 512, "sleep 1; rm -f %s%s*; sleep 1", fontdir, FC_DIR_SEPARATOR_S);
system (cmd);
fprintf (stderr, "D: Reinitializing\n");
- if (!FcConfigUptoDate (config) || !FcInitReinitialize ())
+ if (FcConfigUptoDate (config))
{
- fprintf (stderr, "E: Unable to reinitialize\n");
+ fprintf (stderr, "E: Config reports up-to-date\n");
ret = 2;
goto bail;
}
+ if (!FcInitReinitialize ())
+ {
+ fprintf (stderr, "E: Unable to reinitialize\n");
+ ret = 3;
+ goto bail;
+ }
if (FcConfigGetCurrent () == config)
{
fprintf (stderr, "E: config wasn't reloaded\n");
@@ -265,10 +271,16 @@ main (void)
goto bail;
}
fprintf (stderr, "D: Copying %s to %s\n", FONTFILE, fontdir);
- snprintf (cmd, 512, "cp -a %s %s", FONTFILE, fontdir);
+ snprintf (cmd, 512, "sleep 1; cp -a %s %s; sleep 1", FONTFILE, fontdir);
system (cmd);
fprintf (stderr, "D: Reinitializing\n");
- if (!FcConfigUptoDate (config) || !FcInitReinitialize ())
+ if (FcConfigUptoDate (config))
+ {
+ fprintf (stderr, "E: Config up-to-date after addition\n");
+ ret = 3;
+ goto bail;
+ }
+ if (!FcInitReinitialize ())
{
fprintf (stderr, "E: Unable to reinitialize\n");
ret = 2;