File: fix-unit-tests.patch

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