Add setget test
This commit is contained in:
parent
eb32027546
commit
1a244a3d6b
1 changed files with 32 additions and 0 deletions
|
@ -87,5 +87,37 @@ mod tests {
|
|||
|
||||
assert!(res.is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_setget_gps() {
|
||||
setup_logging();
|
||||
|
||||
let store = get_store();
|
||||
|
||||
let mut entry = store.create(PathBuf::from("test_setget_gps")).unwrap();
|
||||
|
||||
let coordinates = Coordinates {
|
||||
latitude: GPSValue::new(0, 0, 0),
|
||||
longitude: GPSValue::new(0, 0, 0),
|
||||
};
|
||||
|
||||
let res = entry.set_coordinates(coordinates);
|
||||
assert!(res.is_ok());
|
||||
|
||||
let coordinates = entry.get_coordinates();
|
||||
|
||||
assert!(coordinates.is_ok());
|
||||
let coordinates = coordinates.unwrap();
|
||||
|
||||
assert!(coordinates.is_some());
|
||||
let coordinates = coordinates.unwrap();
|
||||
|
||||
assert_eq!(0, coordinates.longitude.degree);
|
||||
assert_eq!(0, coordinates.longitude.minutes);
|
||||
assert_eq!(0, coordinates.longitude.seconds);
|
||||
assert_eq!(0, coordinates.latitude.degree);
|
||||
assert_eq!(0, coordinates.latitude.minutes);
|
||||
assert_eq!(0, coordinates.latitude.seconds);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue