Skip to content

Commit b221d31

Browse files
author
Serban Iorga
committed
[GuestAddress] fix unit tests naming
1 parent 6b34020 commit b221d31

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

memory_model/src/guest_address.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ mod tests {
148148
use super::*;
149149

150150
#[test]
151-
fn equals() {
151+
fn test_equals() {
152152
let a = GuestAddress(0x300);
153153
let b = GuestAddress(0x300);
154154
let c = GuestAddress(0x301);
@@ -160,7 +160,7 @@ mod tests {
160160
}
161161

162162
#[test]
163-
fn cmp() {
163+
fn test_cmp() {
164164
for i in 1..10 {
165165
for j in 1..10 {
166166
assert_eq!(i < j, GuestAddress(i) < GuestAddress(j));
@@ -170,41 +170,41 @@ mod tests {
170170
}
171171

172172
#[test]
173-
fn add_sub() {
173+
fn test_add_sub() {
174174
let a = GuestAddress(0x50);
175175
let b = GuestAddress(0x60);
176176
assert_eq!(Some(GuestAddress(0xb0)), a.checked_add(0x60));
177177
assert_eq!(0x10, b.unchecked_offset_from(a));
178178
}
179179

180180
#[test]
181-
fn checked_add_overflow() {
181+
fn test_checked_add_with_overflow() {
182182
let a = GuestAddress(0xffff_ffff_ffff_ff55);
183183
assert_eq!(Some(GuestAddress(0xffff_ffff_ffff_ff57)), a.checked_add(2));
184184
assert!(a.checked_add(0xf0).is_none());
185185
}
186186

187187
#[test]
188-
fn checked_sub_underflow() {
188+
fn test_checked_sub_with_underflow() {
189189
let a = GuestAddress(0xff);
190190
assert_eq!(Some(GuestAddress(0x0f)), a.checked_sub(0xf0));
191191
assert!(a.checked_sub(0xffff).is_none());
192192
}
193193

194194
#[test]
195-
fn default() {
195+
fn test_default() {
196196
assert_eq!(GuestAddress::default(), GuestAddress(0));
197197
}
198198

199199
#[test]
200-
fn and() {
200+
fn test_bit_and() {
201201
let a = GuestAddress(0x00);
202202
let b = GuestAddress(0xff);
203203
assert_eq!(a & b.raw_value(), a);
204204
}
205205

206206
#[test]
207-
fn or() {
207+
fn test_bit_or() {
208208
let a = GuestAddress(0x00);
209209
let b = GuestAddress(0xff);
210210
assert_eq!(a | b.raw_value(), b);

0 commit comments

Comments
 (0)