mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 13:35:42 +09:00
test: remove infrastructure-dependent integration suites (#1573)
This commit is contained in:
1 parent
f88b0f69b2
commit
10fc79ab37
199 files changed
+688
-46963
No files matched your search
@@ -421,103 +421,4 @@ mod tests {
|
||||
let err = EncoderAttachment::try_new(640, 480).err();
|
||||
assert!(matches!(err, Some(EncoderAttachError::RingInitFailed)));
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
#[test]
|
||||
fn windows_attach_then_detach_smoke() {
|
||||
let attach = match EncoderAttachment::try_new(640, 480) {
|
||||
Ok(a) => a,
|
||||
Err(_) => return,
|
||||
};
|
||||
assert!(attach.is_attached());
|
||||
assert_eq!(attach.width(), 640);
|
||||
assert_eq!(attach.height(), 480);
|
||||
assert_eq!(attach.capacity(), 8);
|
||||
let stats = attach.stats();
|
||||
assert_eq!(stats.frames_submitted, 0, "fresh attach has 0 submissions");
|
||||
assert_eq!(stats.failed_blits, 0, "fresh attach has 0 failed blits");
|
||||
attach.detach();
|
||||
assert!(!attach.is_attached());
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
#[test]
|
||||
fn windows_submit_notify_records_stats() {
|
||||
let attach = match EncoderAttachment::try_new(64, 64) {
|
||||
Ok(a) => a,
|
||||
Err(_) => return,
|
||||
};
|
||||
for _ in 0..3 {
|
||||
attach.submit_notify().expect("notify ok");
|
||||
}
|
||||
let stats = attach.stats();
|
||||
assert_eq!(stats.frames_submitted, 3);
|
||||
assert_eq!(stats.frames_dropped, 0);
|
||||
assert_eq!(stats.ring_full_events, 0);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
#[test]
|
||||
fn windows_submit_rejected_when_detached() {
|
||||
let attach = match EncoderAttachment::try_new(64, 64) {
|
||||
Ok(a) => a,
|
||||
Err(_) => return,
|
||||
};
|
||||
attach.detach();
|
||||
let err = attach.submit_notify().err();
|
||||
assert!(matches!(err, Some(EncoderAttachError::NotAttached)));
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
#[test]
|
||||
fn windows_wait_next_ready_returns_committed_frame() {
|
||||
let attach = match EncoderAttachment::try_new(64, 64) {
|
||||
Ok(a) => a,
|
||||
Err(_) => return,
|
||||
};
|
||||
attach.submit_notify().expect("notify ok");
|
||||
let ready = attach.wait_next_ready(Duration::from_millis(5));
|
||||
let ready = ready.expect("committed frame becomes ready");
|
||||
assert_eq!(ready.sequence, 1);
|
||||
assert_eq!(ready.duplicate_count, 0);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
#[test]
|
||||
fn windows_wait_next_ready_empty_ring_times_out() {
|
||||
let attach = match EncoderAttachment::try_new(64, 64) {
|
||||
Ok(a) => a,
|
||||
Err(_) => return,
|
||||
};
|
||||
let ready = attach.wait_next_ready(Duration::from_millis(2));
|
||||
assert!(ready.is_none());
|
||||
assert!(attach.is_attached());
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
#[test]
|
||||
fn windows_wait_next_ready_after_detach_returns_none() {
|
||||
let attach = match EncoderAttachment::try_new(64, 64) {
|
||||
Ok(a) => a,
|
||||
Err(_) => return,
|
||||
};
|
||||
attach.detach();
|
||||
let ready = attach.wait_next_ready(Duration::from_millis(2));
|
||||
assert!(ready.is_none());
|
||||
assert!(!attach.is_attached());
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
#[test]
|
||||
fn windows_ring_usable_after_nvenc_pre_register_attempt() {
|
||||
let attach = match EncoderAttachment::try_new(64, 64) {
|
||||
Ok(a) => a,
|
||||
Err(_) => return,
|
||||
};
|
||||
let _ = attach.nvenc_pre_registered();
|
||||
attach.submit_notify().expect("notify ok");
|
||||
let stats = attach.stats();
|
||||
assert_eq!(stats.frames_submitted, 1);
|
||||
assert_eq!(stats.frames_dropped, 0);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user