aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Adam Greig <adam@adamgreig.com> 2021-12-31 17:44:33 +0000
committerGravatar GitHub <noreply@github.com> 2021-12-31 17:44:33 +0000
commit819f8be6c64c233ce65b12f27e0efd82833a6897 (patch)
tree1f3cf84dbe58ac8efbc1619f292c0dc485c08ece /xtask/src/lib.rs
parent255faf75de84f72389a45e3d99b824e0a4599bed (diff)
parent08452a9de25e4bc66fb80015e0c78c08eb967237 (diff)
downloadcortex-m-819f8be6c64c233ce65b12f27e0efd82833a6897.tar.gz
cortex-m-819f8be6c64c233ce65b12f27e0efd82833a6897.tar.zst
cortex-m-819f8be6c64c233ce65b12f27e0efd82833a6897.zip
Merge branch 'master' into patch-1
Diffstat (limited to 'xtask/src/lib.rs')
-rw-r--r--xtask/src/lib.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs
index a7b85e7..c3d8356 100644
--- a/xtask/src/lib.rs
+++ b/xtask/src/lib.rs
@@ -208,3 +208,24 @@ pub fn check_blobs() {
println!("Blobs identical.");
}
+
+// Check that serde and PartialOrd works with VectActive
+pub fn check_host_side() {
+ use cortex_m::peripheral::scb::VectActive;
+
+ // check serde
+ {
+ let v = VectActive::from(22).unwrap();
+ let json = serde_json::to_string(&v).expect("Failed to serialize VectActive");
+ let deser_v: VectActive =
+ serde_json::from_str(&json).expect("Failed to deserialize VectActive");
+ assert_eq!(deser_v, v);
+ }
+
+ // check PartialOrd
+ {
+ let a = VectActive::from(19).unwrap();
+ let b = VectActive::from(20).unwrap();
+ assert_eq!(a < b, true);
+ }
+}