From d9028d21dab79733db437140469e8abfcf6d37bc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 12 Jun 2023 15:52:10 +0200 Subject: [PATCH] start adding tests --- src/cfdp/tlv.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cfdp/tlv.rs b/src/cfdp/tlv.rs index d4ae3fa..71830b8 100644 --- a/src/cfdp/tlv.rs +++ b/src/cfdp/tlv.rs @@ -436,7 +436,8 @@ impl<'first_name, 'second_name> FilestoreRequestTlv<'first_name, 'second_name> { #[cfg(test)] mod tests { - use crate::cfdp::tlv::{Tlv, TlvType, TlvTypeField}; + use crate::cfdp::lv::Lv; + use crate::cfdp::tlv::{FilestoreRequestTlv, Tlv, TlvType, TlvTypeField}; use crate::cfdp::TlvLvError; use crate::util::{UbfU8, UnsignedEnum}; @@ -560,4 +561,12 @@ mod tests { assert_eq!(tlv.len_value(), 1); assert_eq!(tlv.len_full(), 3); } + + #[test] + fn test_fs_request_basic() { + let first_name = Lv::new_from_str("hello.txt").unwrap(); + let fs_request = FilestoreRequestTlv::new_create_file(first_name); + assert!(fs_request.is_ok()); + let fs_request = fs_request.unwrap(); + } }