From ce23e798f1ef4d2bd3a84c72bc3c54b11e05daf6 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 12 Feb 2024 15:12:54 +0100 Subject: [PATCH] fix all tests --- satrs-mib/codegen/tests/basic.rs | 2 +- satrs-mib/codegen/tests/basic_with_info.rs | 2 +- satrs-mib/codegen/tests/verify_gen_struct.rs | 2 +- satrs-mib/src/res_code.rs | 6 +++--- satrs-shared/src/res_code.rs | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/satrs-mib/codegen/tests/basic.rs b/satrs-mib/codegen/tests/basic.rs index 13d7b54..c5ffb08 100644 --- a/satrs-mib/codegen/tests/basic.rs +++ b/satrs-mib/codegen/tests/basic.rs @@ -3,6 +3,6 @@ use satrs_mib::resultcode; use satrs_shared::res_code::ResultU16; #[resultcode] -const _TEST_RESULT: ResultU16 = ResultU16::const_new(0, 1); +const _TEST_RESULT: ResultU16 = ResultU16::new(0, 1); fn main() {} diff --git a/satrs-mib/codegen/tests/basic_with_info.rs b/satrs-mib/codegen/tests/basic_with_info.rs index 9945e65..d9a8a3a 100644 --- a/satrs-mib/codegen/tests/basic_with_info.rs +++ b/satrs-mib/codegen/tests/basic_with_info.rs @@ -3,6 +3,6 @@ use satrs_mib::resultcode; use satrs_shared::res_code::ResultU16; #[resultcode(info = "This is a test result where the first parameter is foo")] -const _TEST_RESULT: ResultU16 = ResultU16::const_new(0, 1); +const _TEST_RESULT: ResultU16 = ResultU16::new(0, 1); fn main() {} diff --git a/satrs-mib/codegen/tests/verify_gen_struct.rs b/satrs-mib/codegen/tests/verify_gen_struct.rs index eb8d3c0..6f371e8 100644 --- a/satrs-mib/codegen/tests/verify_gen_struct.rs +++ b/satrs-mib/codegen/tests/verify_gen_struct.rs @@ -3,7 +3,7 @@ use satrs_mib::resultcode; use satrs_shared::res_code::ResultU16; #[resultcode(info = "This is a test result where the first parameter is foo")] -const TEST_RESULT: ResultU16 = ResultU16::const_new(0, 1); +const TEST_RESULT: ResultU16 = ResultU16::new(0, 1); // Create named reference of auto-generated struct, which can be used by IDEs etc. const TEST_RESULT_EXT_REF: &ResultU16Info = &TEST_RESULT_EXT; diff --git a/satrs-mib/src/res_code.rs b/satrs-mib/src/res_code.rs index fed9da2..c7d0656 100644 --- a/satrs-mib/src/res_code.rs +++ b/satrs-mib/src/res_code.rs @@ -106,12 +106,12 @@ mod tests { } #[resultcode] - pub const INVALID_PUS_SERVICE: ResultU16 = ResultU16::const_new(GroupId::Tmtc as u8, 0); + pub const INVALID_PUS_SERVICE: ResultU16 = ResultU16::new(GroupId::Tmtc as u8, 0); #[resultcode] - pub const INVALID_PUS_SUBSERVICE: ResultU16 = ResultU16::const_new(GroupId::Tmtc as u8, 1); + pub const INVALID_PUS_SUBSERVICE: ResultU16 = ResultU16::new(GroupId::Tmtc as u8, 1); #[resultcode(info = "Not enough data inside the TC application data field")] - pub const NOT_ENOUGH_APP_DATA: ResultU16 = ResultU16::const_new(GroupId::Tmtc as u8, 2); + pub const NOT_ENOUGH_APP_DATA: ResultU16 = ResultU16::new(GroupId::Tmtc as u8, 2); pub const TMTC_RESULTS: &[ResultU16Info] = &[ INVALID_PUS_SERVICE_EXT, diff --git a/satrs-shared/src/res_code.rs b/satrs-shared/src/res_code.rs index 9d0ce91..0603adf 100644 --- a/satrs-shared/src/res_code.rs +++ b/satrs-shared/src/res_code.rs @@ -69,8 +69,8 @@ mod tests { #[test] pub fn test_basic() { let result_code = ResultU16::new(1, 1); - assert_eq!(result_code.unique_id(), 0); - assert_eq!(result_code.group_id(), 0); + assert_eq!(result_code.unique_id(), 1); + assert_eq!(result_code.group_id(), 1); assert_eq!(result_code, RESULT_CODE_CONST); assert_eq!(result_code.raw(), (1_u16 << 8) | 1); assert_eq!(result_code.pfc(), 16);