@@ -148,7 +148,7 @@ mod tests {
148
148
use super :: * ;
149
149
150
150
#[ test]
151
- fn equals ( ) {
151
+ fn test_equals ( ) {
152
152
let a = GuestAddress ( 0x300 ) ;
153
153
let b = GuestAddress ( 0x300 ) ;
154
154
let c = GuestAddress ( 0x301 ) ;
@@ -160,7 +160,7 @@ mod tests {
160
160
}
161
161
162
162
#[ test]
163
- fn cmp ( ) {
163
+ fn test_cmp ( ) {
164
164
for i in 1 ..10 {
165
165
for j in 1 ..10 {
166
166
assert_eq ! ( i < j, GuestAddress ( i) < GuestAddress ( j) ) ;
@@ -170,41 +170,41 @@ mod tests {
170
170
}
171
171
172
172
#[ test]
173
- fn add_sub ( ) {
173
+ fn test_add_sub ( ) {
174
174
let a = GuestAddress ( 0x50 ) ;
175
175
let b = GuestAddress ( 0x60 ) ;
176
176
assert_eq ! ( Some ( GuestAddress ( 0xb0 ) ) , a. checked_add( 0x60 ) ) ;
177
177
assert_eq ! ( 0x10 , b. unchecked_offset_from( a) ) ;
178
178
}
179
179
180
180
#[ test]
181
- fn checked_add_overflow ( ) {
181
+ fn test_checked_add_with_overflow ( ) {
182
182
let a = GuestAddress ( 0xffff_ffff_ffff_ff55 ) ;
183
183
assert_eq ! ( Some ( GuestAddress ( 0xffff_ffff_ffff_ff57 ) ) , a. checked_add( 2 ) ) ;
184
184
assert ! ( a. checked_add( 0xf0 ) . is_none( ) ) ;
185
185
}
186
186
187
187
#[ test]
188
- fn checked_sub_underflow ( ) {
188
+ fn test_checked_sub_with_underflow ( ) {
189
189
let a = GuestAddress ( 0xff ) ;
190
190
assert_eq ! ( Some ( GuestAddress ( 0x0f ) ) , a. checked_sub( 0xf0 ) ) ;
191
191
assert ! ( a. checked_sub( 0xffff ) . is_none( ) ) ;
192
192
}
193
193
194
194
#[ test]
195
- fn default ( ) {
195
+ fn test_default ( ) {
196
196
assert_eq ! ( GuestAddress :: default ( ) , GuestAddress ( 0 ) ) ;
197
197
}
198
198
199
199
#[ test]
200
- fn and ( ) {
200
+ fn test_bit_and ( ) {
201
201
let a = GuestAddress ( 0x00 ) ;
202
202
let b = GuestAddress ( 0xff ) ;
203
203
assert_eq ! ( a & b. raw_value( ) , a) ;
204
204
}
205
205
206
206
#[ test]
207
- fn or ( ) {
207
+ fn test_bit_or ( ) {
208
208
let a = GuestAddress ( 0x00 ) ;
209
209
let b = GuestAddress ( 0xff ) ;
210
210
assert_eq ! ( a | b. raw_value( ) , b) ;
0 commit comments