mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
Merge pull request #244 from link2xt/dc_location_vec
Replace some dc_array_t with Vec<dc_location>
This commit is contained in:
@@ -827,24 +827,24 @@ fn test_dc_kml_parse() {
|
||||
assert!(!kml.addr.is_null());
|
||||
assert_eq!(as_str(kml.addr as *const libc::c_char), "user@example.org",);
|
||||
|
||||
assert_eq!(dc_array_get_cnt(kml.locations), 2);
|
||||
let locations_ref = &kml.locations.as_ref().unwrap();
|
||||
assert_eq!(locations_ref.len(), 2);
|
||||
|
||||
assert!(dc_array_get_latitude(kml.locations, 0) > 53.6f64);
|
||||
assert!(dc_array_get_latitude(kml.locations, 0) < 53.8f64);
|
||||
assert!(dc_array_get_longitude(kml.locations, 0) > 9.3f64);
|
||||
assert!(dc_array_get_longitude(kml.locations, 0) < 9.5f64);
|
||||
assert!(dc_array_get_accuracy(kml.locations, 0) > 31.9f64);
|
||||
assert!(dc_array_get_accuracy(kml.locations, 0) < 32.1f64);
|
||||
assert_eq!(dc_array_get_timestamp(kml.locations, 0), 1551906597);
|
||||
assert!(locations_ref[0].latitude > 53.6f64);
|
||||
assert!(locations_ref[0].latitude < 53.8f64);
|
||||
assert!(locations_ref[0].longitude > 9.3f64);
|
||||
assert!(locations_ref[0].longitude < 9.5f64);
|
||||
assert!(locations_ref[0].accuracy > 31.9f64);
|
||||
assert!(locations_ref[0].accuracy < 32.1f64);
|
||||
assert_eq!(locations_ref[0].timestamp, 1551906597);
|
||||
|
||||
assert!(dc_array_get_latitude(kml.locations, 1) > 63.6f64);
|
||||
assert!(dc_array_get_latitude(kml.locations, 1) < 63.8f64);
|
||||
assert!(dc_array_get_longitude(kml.locations, 1) > 19.3f64);
|
||||
assert!(dc_array_get_longitude(kml.locations, 1) < 19.5f64);
|
||||
assert!(dc_array_get_accuracy(kml.locations, 1) > 2.4f64);
|
||||
assert!(dc_array_get_accuracy(kml.locations, 1) < 2.6f64);
|
||||
|
||||
assert_eq!(dc_array_get_timestamp(kml.locations, 1), 1544739072);
|
||||
assert!(locations_ref[1].latitude > 63.6f64);
|
||||
assert!(locations_ref[1].latitude < 63.8f64);
|
||||
assert!(locations_ref[1].longitude > 19.3f64);
|
||||
assert!(locations_ref[1].longitude < 19.5f64);
|
||||
assert!(locations_ref[1].accuracy > 2.4f64);
|
||||
assert!(locations_ref[1].accuracy < 2.6f64);
|
||||
assert_eq!(locations_ref[1].timestamp, 1544739072);
|
||||
|
||||
dc_kml_unref(&mut kml);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user