gnu: gegl: Fix CVE-2012-4433.
[jackhill/guix/guix.git] / gnu / packages / patches / ldc-disable-tests.patch
1 This patch fixes a failing unit test by feeding buildNormalizedPath to the
2 tzdata properly. Three other tests are disabled, one assumes /root and the
3 two others use networking. Not bad out of almost 700 tests!
4
5 by Pjotr Prins <pjotr.guix@thebird.nl>
6
7 diff --git a/std/datetime.d b/std/datetime.d
8 index 8e4ed3b..6c15bc5 100644
9 --- a/std/datetime.d
10 +++ b/std/datetime.d
11 @@ -28018,6 +28018,7 @@ public:
12 The default directory where the TZ Database files are. It's empty
13 for Windows, since Windows doesn't have them.
14 +/
15 +
16 enum defaultTZDatabaseDir = "/usr/share/zoneinfo/";
17 }
18 else version(Windows)
19 @@ -28069,14 +28070,13 @@ assert(tz.dstName == "PDT");
20 import std.range : retro;
21 import std.format : format;
22
23 - name = strip(name);
24 -
25 enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
26 enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
27
28 - immutable file = buildNormalizedPath(tzDatabaseDir, name);
29 + auto filename = "./" ~ strip(name); // make sure the prefix is not stripped
30 + immutable file = buildNormalizedPath(tzDatabaseDir, filename);
31
32 - enforce(file.exists(), new DateTimeException(format("File %s does not exist.", file)));
33 + enforce(file.exists(), new DateTimeException(format("File %s does not exist in %s.", file, tzDatabaseDir)));
34 enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
35
36 auto tzFile = File(file);
37 diff --git a/std/path.d b/std/path.d
38 index 254d8f0..b0fc04d 100644
39 --- a/std/path.d
40 +++ b/std/path.d
41 @@ -3080,8 +3080,11 @@ unittest
42 }
43 else
44 {
45 + pragma(msg, "test disabled on GNU Guix");
46 +/*
47 assert(expandTilde("~root") == "/root", expandTilde("~root"));
48 assert(expandTilde("~root/") == "/root/", expandTilde("~root/"));
49 +*/
50 }
51 assert(expandTilde("~Idontexist/hey") == "~Idontexist/hey");
52 }
53 diff --git a/std/socket.d b/std/socket.d
54 index b85d1c9..7fbf346 100644
55 --- a/std/socket.d
56 +++ b/std/socket.d
57 @@ -517,6 +517,8 @@ class Protocol
58
59 unittest
60 {
61 + pragma(msg, "test disabled on GNU Guix");
62 +/*
63 // getprotobyname,number are unimplemented on Android
64 softUnittest({
65 Protocol proto = new Protocol;
66 @@ -530,6 +532,7 @@ unittest
67 assert(proto.name == "tcp");
68 assert(proto.aliases.length == 1 && proto.aliases[0] == "TCP");
69 });
70 +*/
71 }
72
73
74 @@ -859,6 +862,8 @@ class InternetHost
75
76 unittest
77 {
78 + pragma(msg, "test disabled on GNU Guix");
79 + /*
80 InternetHost ih = new InternetHost;
81
82 ih.getHostByAddr(0x7F_00_00_01);
83 @@ -889,6 +894,7 @@ unittest
84 // writefln("aliases[%d] = %s", i, s);
85 // }
86 });
87 + */
88 }
89
90