Browse Source

test: add rust codec test sample

legacy
Dnomd343 2 years ago
parent
commit
9541639586
  1. 10
      src/rust_ffi/src/codec/common_code.rs
  2. 6
      src/rust_ffi/src/codec/raw_code.rs
  3. 9
      src/rust_ffi/src/codec/short_code.rs

10
src/rust_ffi/src/codec/common_code.rs

@ -228,3 +228,13 @@ impl CommonCode {
) )
} }
} }
#[cfg(test)]
mod tests {
const TEST_CODE: u64 = 0x1_A9BF_0C00;
const TEST_CODE_STR: &str = "1A9BF0C00";
const TEST_CODE_STR_SHR: &str = "1A9BF0C";
const TEST_CODE_ERR: u64 = 0x1_A9BF_FC00;
const TEST_CODE_STR_ERR: &str = "123J432A9";
}

6
src/rust_ffi/src/codec/raw_code.rs

@ -313,3 +313,9 @@ impl RawCode {
) )
} }
} }
#[cfg(test)]
mod tests {
const TEST_CODE: u64 = 0x0_603_EDF_5CA_FFF_5E2;
const TEST_CODE_ERR: u64 = 0x0_A34_182_B38_102_D21;
}

9
src/rust_ffi/src/codec/short_code.rs

@ -258,3 +258,12 @@ impl ShortCode {
codec_ffi::short_code_enable_fast(); codec_ffi::short_code_enable_fast();
} }
} }
#[cfg(test)]
mod tests {
const TEST_CODE: u32 = 4091296;
const TEST_CODE_STR: &str = "4WVE1";
const TEST_CODE_ERR: u32 = 29670987;
const TEST_CODE_STR_ERR: &str = "R50EH";
}

Loading…
Cancel
Save