diff --git a/src/asn1der.rs b/src/asn1der.rs index e873ef3e..d3fdf7ef 100644 --- a/src/asn1der.rs +++ b/src/asn1der.rs @@ -93,7 +93,7 @@ impl<'a> Decode<'a> for Unit { // Testing the encoding and decoding of an Epoch inherently also tests the encoding and decoding of a Duration #[test] fn test_encdec() { - for ts_u8 in 0..=7 { + for ts_u8 in 0..=8 { let ts: TimeScale = ts_u8.into(); let epoch = if ts == TimeScale::UTC { diff --git a/tests/epoch.rs b/tests/epoch.rs index 4becd71c..0cdd882f 100644 --- a/tests/epoch.rs +++ b/tests/epoch.rs @@ -1551,6 +1551,13 @@ fn test_time_of_week() { epoch_utc ); + // GPST and QZSST share the same properties at all times + let epoch_qzsst = epoch.in_time_scale(TimeScale::QZSST); + assert_eq!(epoch.to_gregorian_utc(), epoch_qzsst.to_gregorian_utc()); + + let gps_qzss_offset = TimeScale::GPST.ref_epoch() - TimeScale::QZSST.ref_epoch(); + assert_eq!(gps_qzss_offset.total_nanoseconds(), 0); // no offset + // 06/01/1980 01:00:00 = 1H into GPST <=> (0, 3_618_000_000_000) let epoch = Epoch::from_time_of_week(0, 3_618_000_000_000, TimeScale::GPST); assert_eq!(epoch.to_gregorian_utc(), (1980, 01, 06, 01, 00, 0 + 18, 00));