mirror of
https://github.com/PatchRequest/BusyWork
synced 2026-06-09 16:04:04 +00:00
4b72c45c57
Inter-task chaining: a 256-byte ScratchBuffer flows through all tasks in a single run() call. Each task reads from it (blend_into) and writes back results (absorb), creating a data-dependency chain where task N's output influences task N+1's computation. An analyzer can no longer identify individual tasks as isolated blocks. Work data in all tasks: all 84 tasks now actively consume fed work data. Filesystem tasks derive skip offsets and iteration biases from work data. Registry tasks bias subkey/value enumeration counts. WinAPI tasks offset starting indices for window/process/metric enumeration. Network tasks select starting host indices and blend work data into response buffers. New COM/WMI category (8 tasks): WQL queries against Win32_Process, Win32_OperatingSystem, Win32_ComputerSystem, Win32_NetworkAdapterConfiguration, Win32_LogicalDisk, Win32_Service, Win32_BIOS, and Win32_Processor. All read-only. Uses COM automation with CoInitializeSecurity for reliable initialization across apartment models. 84 tasks across 8 categories. All 182 tests pass.
61 lines
1.2 KiB
Rust
61 lines
1.2 KiB
Rust
use busywork::{busywork, busywork_with, BusyWork, Categories, Intensity};
|
|
|
|
#[test]
|
|
fn low_intensity_no_panic() {
|
|
busywork(Intensity::Low);
|
|
}
|
|
|
|
#[test]
|
|
fn medium_intensity_no_panic() {
|
|
busywork(Intensity::Medium);
|
|
}
|
|
|
|
#[test]
|
|
fn high_compute_only() {
|
|
busywork_with(Intensity::High, Categories::COMPUTE);
|
|
}
|
|
|
|
#[test]
|
|
fn high_memory_only() {
|
|
busywork_with(Intensity::High, Categories::MEMORY);
|
|
}
|
|
|
|
#[test]
|
|
fn high_filesystem_only() {
|
|
busywork_with(Intensity::High, Categories::FILESYSTEM);
|
|
}
|
|
|
|
#[test]
|
|
fn builder_deny_network() {
|
|
BusyWork::new(Intensity::Medium)
|
|
.deny(Categories::NETWORK)
|
|
.run();
|
|
}
|
|
|
|
#[test]
|
|
fn builder_no_jitter() {
|
|
BusyWork::new(Intensity::Low)
|
|
.allow(Categories::COMPUTE | Categories::MEMORY)
|
|
.jitter(false)
|
|
.run();
|
|
}
|
|
|
|
#[test]
|
|
fn empty_categories_no_panic() {
|
|
busywork_with(Intensity::Ultra, Categories::empty());
|
|
}
|
|
|
|
#[test]
|
|
fn available_returns_all_compiled() {
|
|
let avail = Categories::available();
|
|
assert!(avail.contains(Categories::COMPUTE));
|
|
assert!(avail.contains(Categories::MEMORY));
|
|
assert!(avail.contains(Categories::FILESYSTEM));
|
|
assert!(avail.contains(Categories::COM));
|
|
}
|
|
|
|
#[test]
|
|
fn high_com_only() {
|
|
busywork_with(Intensity::High, Categories::COM);
|
|
}
|