mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-29 02:08:13 -07:00
hardcode build_log_mask_request() unit test input
Instead of having to change the expected value every time we add a log type to our list, let's just hardcode it to a known value.
This commit is contained in:
committed by
Will Greenberg
parent
967e823805
commit
ff290a9d19
@@ -129,7 +129,7 @@ impl Timestamp {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub(crate) mod test {
|
pub(crate) mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{diag::*, hdlc};
|
use crate::{diag::*, hdlc, log_codes};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_logs() {
|
fn test_logs() {
|
||||||
@@ -235,7 +235,17 @@ pub(crate) mod test {
|
|||||||
let req = build_log_mask_request(
|
let req = build_log_mask_request(
|
||||||
log_type,
|
log_type,
|
||||||
bitsize,
|
bitsize,
|
||||||
&crate::diag_device::LOG_CODES_FOR_RAW_PACKET_LOGGING,
|
&[
|
||||||
|
log_codes::LOG_GSM_RR_SIGNALING_MESSAGE_C,
|
||||||
|
log_codes::WCDMA_SIGNALLING_MESSAGE,
|
||||||
|
log_codes::LOG_LTE_RRC_OTA_MSG_LOG_C,
|
||||||
|
log_codes::LOG_NR_RRC_OTA_MSG_LOG_C,
|
||||||
|
log_codes::LOG_UMTS_NAS_OTA_MESSAGE_LOG_PACKET_C,
|
||||||
|
log_codes::LOG_LTE_NAS_ESM_OTA_IN_MSG_LOG_C,
|
||||||
|
log_codes::LOG_LTE_NAS_ESM_OTA_OUT_MSG_LOG_C,
|
||||||
|
log_codes::LOG_LTE_NAS_EMM_OTA_IN_MSG_LOG_C,
|
||||||
|
log_codes::LOG_LTE_NAS_EMM_OTA_OUT_MSG_LOG_C,
|
||||||
|
],
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
req,
|
req,
|
||||||
@@ -243,11 +253,10 @@ pub(crate) mod test {
|
|||||||
log_type,
|
log_type,
|
||||||
log_mask_bitsize: bitsize,
|
log_mask_bitsize: bitsize,
|
||||||
log_mask: vec![
|
log_mask: vec![
|
||||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c, 0x0, 0x0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0xc, 0x30,
|
0, 0, 0, 0, 1, 0, 0, 0, 12, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0x0, 0x80, 0x1, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
0, 0, 0, 0, 0, 0
|
||||||
0x0, 0x0, 0x0, 0x0,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user