Debian Codegraph @

debian/patches/fix-unit-tests.patch

raw
1 diff --git a/tests/base.rs b/tests/base.rs
2 index 0d65a2b..06d7cff 100644
3 --- a/tests/base.rs
4 +++ b/tests/base.rs
5 @@ -6,6 +6,7 @@
6 use core::str::FromStr;
7
8 /// CVE-2013-1937
9 +#[cfg(feature = "default")]
10 #[test]
11 fn cve_2013_1937() {
12 let cvss_for_cve_2013_1937 = "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N";
13 @@ -15,6 +16,7 @@ fn cve_2013_1937() {
14 }
15
16 /// Missing CVSS:3.1 prefix
17 +#[cfg(feature = "default")]
18 #[test]
19 fn bad_prefix() {
20 let cvss_for_cve_2013_1937e = "AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N";
21 @@ -22,6 +24,7 @@ fn bad_prefix() {
22 }
23
24 /// CVSS:3.0 prefix (parse these as for the purposes of this library they're identical)
25 +#[cfg(feature = "default")]
26 #[test]
27 fn cvss_v3_0_prefix() {
28 let cvss_for_cve_2013_1937 = "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N";
29 @@ -31,6 +34,7 @@ fn cvss_v3_0_prefix() {
30 }
31
32 /// CVE-2013-0375
33 +#[cfg(feature = "default")]
34 #[test]
35 fn cve_2013_0375() {
36 let cvss_for_cve_2013_0375 = "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N";
37 @@ -40,6 +44,7 @@ fn cve_2013_0375() {
38 }
39
40 /// CVE-2014-3566
41 +#[cfg(feature = "default")]
42 #[test]
43 fn cve_2014_3566() {
44 let cvss_for_cve_2014_3566 = "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N";
45 @@ -49,6 +54,7 @@ fn cve_2014_3566() {
46 }
47
48 /// CVE-2012-1516
49 +#[cfg(feature = "default")]
50 #[test]
51 fn cve_2012_1516() {
52 let cvss_for_cve_2012_1516 = "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H";
53 @@ -58,6 +64,7 @@ fn cve_2012_1516() {
54 }
55
56 /// CVE-2009-0783
57 +#[cfg(feature = "default")]
58 #[test]
59 fn cve_2009_0783() {
60 let cvss_for_cve_2009_0783 = "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:L";
61 @@ -67,6 +74,7 @@ fn cve_2009_0783() {
62 }
63
64 /// CVE-2012-0384
65 +#[cfg(feature = "default")]
66 #[test]
67 fn cve_2012_0384() {
68 let cvss_for_cve_2012_0384 = "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H";
69 @@ -76,6 +84,7 @@ fn cve_2012_0384() {
70 }
71
72 /// CVE-2015-1098
73 +#[cfg(feature = "default")]
74 #[test]
75 fn cve_2015_1098() {
76 let cvss_for_cve_2015_1098 = "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H";
77 @@ -85,6 +94,7 @@ fn cve_2015_1098() {
78 }
79
80 /// CVE-2014-0160
81 +#[cfg(feature = "default")]
82 #[test]
83 fn cve_2014_0160() {
84 let cvss_for_cve_2014_0160 = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N";
85 @@ -94,6 +104,7 @@ fn cve_2014_0160() {
86 }
87
88 /// CVE-2014-6271
89 +#[cfg(feature = "default")]
90 #[test]
91 fn cve_2014_6271() {
92 let cvss_for_cve_2014_6271 = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H";
93 @@ -103,6 +114,7 @@ fn cve_2014_6271() {
94 }
95
96 /// CVE-2008-1447
97 +#[cfg(feature = "default")]
98 #[test]
99 fn cve_2008_1447() {
100 let cvss_for_cve_2008_1447 = "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N";
101 @@ -112,6 +124,7 @@ fn cve_2008_1447() {
102 }
103
104 /// CVE-2014-2005
105 +#[cfg(feature = "default")]
106 #[test]
107 fn cve_2014_2005() {
108 let cvss_for_cve_2014_2005 = "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H";
109 @@ -121,6 +134,7 @@ fn cve_2014_2005() {
110 }
111
112 /// CVE-2010-0467
113 +#[cfg(feature = "default")]
114 #[test]
115 fn cve_2010_0467() {
116 let cvss_for_cve_2010_0467 = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N";
117 @@ -130,6 +144,7 @@ fn cve_2010_0467() {
118 }
119
120 /// CVE-2012-1342
121 +#[cfg(feature = "default")]
122 #[test]
123 fn cve_2012_1342() {
124 let cvss_for_cve_2012_1342 = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N";
125 @@ -139,6 +154,7 @@ fn cve_2012_1342() {
126 }
127
128 /// CVE-2013-6014
129 +#[cfg(feature = "default")]
130 #[test]
131 fn cve_2013_6014() {
132 let cvss_for_cve_2013_6014 = "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:H";
133 @@ -148,6 +164,7 @@ fn cve_2013_6014() {
134 }
135
136 /// CVE-2014-9253
137 +#[cfg(feature = "default")]
138 #[test]
139 fn cve_2014_9253() {
140 let cvss_for_cve_2014_9253 = "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N";
141 @@ -157,6 +174,7 @@ fn cve_2014_9253() {
142 }
143
144 /// CVE-2009-0658
145 +#[cfg(feature = "default")]
146 #[test]
147 fn cve_2009_0658() {
148 let cvss_for_cve_2009_0658 = "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H";
149 @@ -166,6 +184,7 @@ fn cve_2009_0658() {
150 }
151
152 /// CVE-2011-1265
153 +#[cfg(feature = "default")]
154 #[test]
155 fn cve_2011_1265() {
156 let cvss_for_cve_2011_1265 = "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H";
157 @@ -175,6 +194,7 @@ fn cve_2011_1265() {
158 }
159
160 /// CVE-2014-2019
161 +#[cfg(feature = "default")]
162 #[test]
163 fn cve_2014_2019() {
164 let cvss_for_cve_2014_2019 = "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N";
165 @@ -184,6 +204,7 @@ fn cve_2014_2019() {
166 }
167
168 /// CVE-2015-0970
169 +#[cfg(feature = "default")]
170 #[test]
171 fn cve_2015_0970() {
172 let cvss_for_cve_2015_0970 = "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H";
173 @@ -193,6 +214,7 @@ fn cve_2015_0970() {
174 }
175
176 /// CVE-2014-0224
177 +#[cfg(feature = "default")]
178 #[test]
179 fn cve_2014_0224() {
180 let cvss_for_cve_2014_0224 = "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N";
181 @@ -202,6 +224,7 @@ fn cve_2014_0224() {
182 }
183
184 /// CVE-2012-5376
185 +#[cfg(feature = "default")]
186 #[test]
187 fn cve_2012_5376() {
188 let cvss_for_cve_2012_5376 = "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H";
189 @@ -211,6 +234,7 @@ fn cve_2012_5376() {
190 }
191
192 /// No impact scope changed
193 +#[cfg(feature = "default")]
194 #[test]
195 fn no_impact_scope_changed() {
196 // https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:N => 0.0
197 @@ -221,6 +245,7 @@ fn no_impact_scope_changed() {
198 }
199
200 /// No impact scope unchanged
201 +#[cfg(feature = "default")]
202 #[test]
203 fn no_impact_scope_unchanged() {
204 // https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N => 0.0
205 @@ -230,6 +255,7 @@ fn no_impact_scope_unchanged() {
206 assert_eq!(base.score().value(), 0.0);
207 }
208
209 +#[cfg(feature = "default")]
210 #[test]
211 fn low_scope_unchanged() {
212 // https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:L => 1.6
213 @@ -239,6 +265,7 @@ fn low_scope_unchanged() {
214 assert_eq!(base.score().value(), 1.6);
215 }
216
217 +#[cfg(feature = "default")]
218 #[test]
219 fn low_scope_changed() {
220 // https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:P/AC:H/PR:H/UI:R/S:C/C:N/I:N/A:L => 1.8