Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
harlanc committed Jul 29, 2023
1 parent d08bd35 commit 4f118a9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
44 changes: 22 additions & 22 deletions library/logger/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,28 @@ mod tests {
println!("{cur_number}");
}

use job_scheduler::{Job, JobScheduler};
use std::time::Duration;
#[test]
fn test_job_scheduler() {
let mut sched = JobScheduler::new();


// #[test]
// fn test_job_scheduler() {
// let mut sched = JobScheduler::new();

sched.add(Job::new("0 0 * * * *".parse().unwrap(), || {
let dt: DateTime<Local> = Local::now();
let cur_number = format!(
"{}-{:02}-{:02} {:02}:{:02}:00",
dt.year(),
dt.month(),
dt.day(),
dt.hour(),
dt.minute()
);
println!("time number: {cur_number}");
}));
// sched.add(Job::new("0 0 * * * *".parse().unwrap(), || {
// let dt: DateTime<Local> = Local::now();
// let cur_number = format!(
// "{}-{:02}-{:02} {:02}:{:02}:00",
// dt.year(),
// dt.month(),
// dt.day(),
// dt.hour(),
// dt.minute()
// );
// println!("time number: {cur_number}");
// }));

loop {
sched.tick();
std::thread::sleep(Duration::from_millis(500));
}
}
// loop {
// sched.tick();
// std::thread::sleep(Duration::from_millis(500));
// }
// }
}
3 changes: 2 additions & 1 deletion protocol/rtsp/src/sdp/fmtp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ mod tests {
let parser = Mpeg4Fmtp::unmarshal("97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=23; config=121056e500").unwrap();

println!(" parser: {parser:?}");
let en_asc = hex::encode(parser.asc.clone());

assert_eq!(parser.asc, "121056e500");
assert_eq!(en_asc, "121056e500");
assert_eq!(parser.profile_level_id, "1");
assert_eq!(parser.mode, "AAC-hbr");
assert_eq!(parser.size_length, 13);
Expand Down

0 comments on commit 4f118a9

Please sign in to comment.