Fix test compilation: make device_id field public

This commit is contained in:
Graham McIntire 2026-02-10 08:33:18 -06:00
parent 2850f4f68f
commit 7882e6b726
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -44,7 +44,7 @@ impl std::fmt::Debug for DeviceConfig {
/// Per-device polling thread that uses C FFI to libnetsnmp
pub struct DevicePoller {
device_id: String,
pub device_id: String,
config: DeviceConfig,
request_tx: mpsc::UnboundedSender<SnmpRequest>,
}

View file

@ -123,7 +123,7 @@ mod tests {
// Create a poller
let poller = registry.get_or_create("test-device".to_string(), config);
assert_eq!(registry.count(), 1);
assert_eq!(poller.device_id(), "test-device");
assert_eq!(poller.device_id, "test-device");
// Remove the poller
let removed_ip = registry.remove("test-device");
@ -145,7 +145,7 @@ mod tests {
let poller = DevicePoller::spawn("test-device".to_string(), config.clone());
// Test accessors
assert_eq!(poller.device_id(), "test-device");
assert_eq!(poller.device_id, "test-device");
assert_eq!(poller.config().ip, "192.168.1.1");
assert_eq!(poller.config().port, 161);