Skip to content

Commit

Permalink
Fixed the broken unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
alisle committed Nov 29, 2018
1 parent bc4fb8f commit 5b5c252
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions src/outputs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ pub fn create(config : &Config) -> Result<Vec<Box<Output>>, String> {
#[cfg(test)]
mod tests {
use std::net::{ Ipv4Addr, TcpListener, UdpSocket };
use enums;
use filters;

#[test]
fn test_create_failed() {
Expand All @@ -94,10 +96,20 @@ mod tests {
port: 7233
});

let config = super::OutputsConfig {
syslog: Some(vec),
elasticsearch: None,
notrust_endpoint: None,
let config = enums::Config {
directory: None,
name: None,
uuid: None,
outputs: super::OutputsConfig {
syslog: Some(vec),
elasticsearch: None,
notrust_endpoint: None,
},
filters: filters::FiltersConfig {
non_process_connections : false,
dns_requests: false,
notrust_track_connections : false
}
};

let config = super::create(&config);
Expand All @@ -119,10 +131,21 @@ mod tests {
address : Ipv4Addr::new(127, 0, 0, 1),
port: 7232
});
let config = super::OutputsConfig {
syslog: Some(vec),
elasticsearch: None,
notrust_endpoint: None,

let config = enums::Config {
directory: None,
name: None,
uuid: None,
outputs: super::OutputsConfig {
syslog: Some(vec),
elasticsearch: None,
notrust_endpoint: None,
},
filters: filters::FiltersConfig {
non_process_connections : false,
dns_requests: false,
notrust_track_connections : false
}
};

let config = super::create(&config);
Expand Down

0 comments on commit 5b5c252

Please sign in to comment.