1
0
Fork 0

Fix tests

gh-action
Bo Jeanes 2022-08-30 17:39:18 +10:00
parent 8257f2a92a
commit ac3a7f0775
3 changed files with 5 additions and 1 deletions

View File

@ -264,6 +264,7 @@ fn default_address_offset() -> i8 {
#[test] #[test]
fn parse_minimal_tcp_connect_config() { fn parse_minimal_tcp_connect_config() {
let result = serde_json::from_value::<Connect>(json!({ let result = serde_json::from_value::<Connect>(json!({
"proto": "tcp",
"host": "1.1.1.1" "host": "1.1.1.1"
})); }));
@ -280,6 +281,7 @@ fn parse_minimal_tcp_connect_config() {
#[test] #[test]
fn parse_full_tcp_connect_config() { fn parse_full_tcp_connect_config() {
let _ = serde_json::from_value::<Connect>(json!({ let _ = serde_json::from_value::<Connect>(json!({
"proto": "tcp",
"host": "10.10.10.219", "host": "10.10.10.219",
"unit": 1, "unit": 1,
"address_offset": -1, "address_offset": -1,
@ -346,6 +348,7 @@ fn parse_full_tcp_connect_config() {
#[test] #[test]
fn parse_minimal_rtu_connect_config() { fn parse_minimal_rtu_connect_config() {
let result = serde_json::from_value::<Connect>(json!({ let result = serde_json::from_value::<Connect>(json!({
"proto": "rtu",
"tty": "/dev/ttyUSB0", "tty": "/dev/ttyUSB0",
"baud_rate": 9600, "baud_rate": 9600,
})); }));
@ -369,6 +372,7 @@ fn parse_minimal_rtu_connect_config() {
#[test] #[test]
fn parse_complete_rtu_connect_config() { fn parse_complete_rtu_connect_config() {
let result = serde_json::from_value::<Connect>(json!({ let result = serde_json::from_value::<Connect>(json!({
"proto": "rtu",
"tty": "/dev/ttyUSB0", "tty": "/dev/ttyUSB0",
"baud_rate": 12800, "baud_rate": 12800,

View File

@ -139,7 +139,7 @@ fn test_parse_1() {
swap_words: Swap(false), swap_words: Swap(false),
value_type: RegisterValueType::Numeric { value_type: RegisterValueType::Numeric {
of: config::RegisterNumeric::I32, of: config::RegisterNumeric::I32,
adjust: RegisterNumericAdjustment { adjust: config::RegisterNumericAdjustment {
scale: 0, scale: 0,
offset: 0, offset: 0,
}, },