From febd5fe2dd02f294514262dc5c019736ad90b3d4 Mon Sep 17 00:00:00 2001 From: Teknique Date: Wed, 31 May 2023 16:26:28 -0700 Subject: [PATCH] Added veilid_log tests. --- .../src/veilid_api/tests/test_serialize_json.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/veilid-core/src/veilid_api/tests/test_serialize_json.rs b/veilid-core/src/veilid_api/tests/test_serialize_json.rs index d2829df6..edd34f5b 100644 --- a/veilid-core/src/veilid_api/tests/test_serialize_json.rs +++ b/veilid-core/src/veilid_api/tests/test_serialize_json.rs @@ -187,7 +187,22 @@ pub async fn test_partialtunnel() { assert_eq!(orig, copy); } +pub async fn test_veilidloglevel() { + let orig = VeilidLogLevel::Info; + let copy = deserialize_json(&serialize_json(&orig)).unwrap(); + assert_eq!(orig, copy); +} +pub async fn test_veilidlog() { + let orig = VeilidLog { + log_level: VeilidLogLevel::Debug, + message: "A log! A log!".to_string(), + backtrace: Some("Func1 -> Func2 -> Func3".to_string()), + }; + let copy = deserialize_json(&serialize_json(&orig)).unwrap(); + + assert_eq!(orig, copy); +} pub async fn test_all() { test_round_trip_peerinfo().await; test_alignedu64().await; @@ -204,4 +219,6 @@ pub async fn test_all() { test_tunnelendpoint().await; test_fulltunnel().await; test_partialtunnel().await; + test_veilidloglevel().await; + test_veilidlog().await; }