diff --git a/generator/sbpg/targets/test_rust.py b/generator/sbpg/targets/test_rust.py index 2b8080d4bd..ed0ee3cc31 100644 --- a/generator/sbpg/targets/test_rust.py +++ b/generator/sbpg/targets/test_rust.py @@ -46,6 +46,8 @@ def render_source(output_dir, package_spec): """ Render and output to a directory given a package specification. """ + if len(package_spec.tests) == 0: + return path, name = package_spec.filepath destination_filename = "%s/integration/%s.rs" % (output_dir, snake_case(name)) py_template = JENV.get_template(TEST_TEMPLATE_NAME) @@ -59,6 +61,6 @@ def render_source(output_dir, package_spec): def render_main(output_dir, package_specs): destination_filename = "%s/integration/main.rs" % output_dir py_template = JENV.get_template(TEST_MAIN_TEMPLATE_NAME) - test_names = [snake_case(p.filepath[1]) for p in package_specs] + test_names = [snake_case(p.filepath[1]) for p in package_specs if len(p.tests) > 0] with open(destination_filename, 'w') as f: f.write(py_template.render(test_names=test_names)) diff --git a/javascript/tests/test_decode.js b/javascript/tests/test_decode.js index 984fac7744..85c1ac9ea1 100644 --- a/javascript/tests/test_decode.js +++ b/javascript/tests/test_decode.js @@ -24,45 +24,47 @@ describe('test packages based on YAML test files', function () { yamlTestFiles.forEach(function (filename) { describe(filename, function () { var yamlConfig = yaml.safeLoad(fs.readFileSync(filename)); - yamlConfig.tests.map(function (testSpec, i) { - describe('test spec '+i, function () { - var msgBuffer = new Buffer(testSpec['raw_packet'], 'base64'); - var decodeMsg = function () { - return decode(msgBuffer); - }; - it('should parse binary sbp and payload', function () { - decodeMsg(); - }); - it('should have correct SBP fields', function () { - var msg = decodeMsg(); - utils.verifyFields(testSpec.sbp, msg.sbp); - }); - it('should have correct payload fields', function () { - var msg = decodeMsg(); - utils.verifyFields(testSpec.msg.fields, msg.fields); - }); - it('should serialize back to binary properly', function () { - var msg = decodeMsg(); - assert.equal(msg.toBase64(), testSpec['raw_packet']); - }); - it('should serialize back to JSON properly', function () { - var msg = decodeMsg(); + if ("tests" in yamlConfig) { + yamlConfig.tests.map(function (testSpec, i) { + describe('test spec '+i, function () { + var msgBuffer = new Buffer(testSpec['raw_packet'], 'base64'); + var decodeMsg = function () { + return decode(msgBuffer); + }; + it('should parse binary sbp and payload', function () { + decodeMsg(); + }); + it('should have correct SBP fields', function () { + var msg = decodeMsg(); + utils.verifyFields(testSpec.sbp, msg.sbp); + }); + it('should have correct payload fields', function () { + var msg = decodeMsg(); + utils.verifyFields(testSpec.msg.fields, msg.fields); + }); + it('should serialize back to binary properly', function () { + var msg = decodeMsg(); + assert.equal(msg.toBase64(), testSpec['raw_packet']); + }); + it('should serialize back to JSON properly', function () { + var msg = decodeMsg(); - var expected = JSON.parse(testSpec['raw_json']); + var expected = JSON.parse(testSpec['raw_json']); - // UInt64s are stringified as strings, not bare numbers in JSON, so... - var actual = JSON.parse(JSON.stringify(msg).replace(/"([0-9]+)"/, '$1')); + // UInt64s are stringified as strings, not bare numbers in JSON, so... + var actual = JSON.parse(JSON.stringify(msg).replace(/"([0-9]+)"/, '$1')); - assert.deepEqual(actual, expected); - }); - it('should be identical to constructed message with identical fields', function () { - var msg = decodeMsg(); - var msgTypeConstructor = messageTypesTable[msg.messageType]; - var constructedMsg = constructMsg(msgTypeConstructor, msg.fields, msg.sbp.sender); - assert(msgBuffer.equals(constructedMsg.toBuffer())); + assert.deepEqual(actual, expected); + }); + it('should be identical to constructed message with identical fields', function () { + var msg = decodeMsg(); + var msgTypeConstructor = messageTypesTable[msg.messageType]; + var constructedMsg = constructMsg(msgTypeConstructor, msg.fields, msg.sbp.sender); + assert(msgBuffer.equals(constructedMsg.toBuffer())); + }); }); }); - }); + } }); }); }); diff --git a/javascript/tests/test_dispatch_decoder.js b/javascript/tests/test_dispatch_decoder.js index cda6e080de..c97a68405f 100644 --- a/javascript/tests/test_dispatch_decoder.js +++ b/javascript/tests/test_dispatch_decoder.js @@ -33,96 +33,107 @@ describe('test packages based on YAML descriptors, through the dispatcher', func yamlTestFiles.forEach(function (filename) { describe(filename, function () { var yamlConfig = yaml.safeLoad(fs.readFileSync(filename)); - yamlConfig.tests.map(function (testSpec, i) { - describe('test spec '+i, function () { - it('should parse binary sbp and payload', function (done) { - var rs = new Readable(); - rs.push(new Buffer(testSpec['raw_packet'], 'base64')); - rs.push(null); - let ctx = { - testSpec, - done, - expectedCalls: 1, - callbacks: 0, - }; - dispatch(rs, dispatchee.bind(ctx)); - }); + if ("tests" in yamlConfig) { + yamlConfig.tests.map(function (testSpec, i) { + describe('test spec '+i, function () { + it('should parse binary sbp and payload', function (done) { + var rs = new Readable(); + rs.push(new Buffer(testSpec['raw_packet'], 'base64')); + rs.push(null); + let ctx = { + testSpec, + done, + expectedCalls: 1, + callbacks: 0, + }; + dispatch(rs, dispatchee.bind(ctx)); + }); - it('should parse binary sbp and payload with leading extra preamble', function (done) { - var rs = new Readable(); - rs.push(new Buffer([0x55])); - let expectedCalls = 0 - let bufLength = 0; - while (bufLength < 500) { - var buf = new Buffer(testSpec['raw_packet'], 'base64'); - rs.push(buf); - bufLength += buf.length; - expectedCalls++ - } - rs.push(null); + it('should parse binary sbp and payload with leading extra preamble', function (done) { + var rs = new Readable(); + rs.push(new Buffer([0x55])); + let expectedCalls = 0 + let bufLength = 0; + while (bufLength < 500) { + var buf = new Buffer(testSpec['raw_packet'], 'base64'); + rs.push(buf); + bufLength += buf.length; + expectedCalls++ + } + rs.push(null); - let ctx = { - testSpec, - done, - expectedCalls, - callbacks: 0, - }; - dispatch(rs, dispatchee.bind(ctx)); - }); + let ctx = { + testSpec, + done, + expectedCalls, + callbacks: 0, + }; + dispatch(rs, dispatchee.bind(ctx)); + }); - // For both "corrupt preamble" tests, the corrupt "length" field could be much longer than the actual message. - // In a real-world case we will have a constant stream of data which will allow us to read that - // full length, and reframe after discovering that it's a corrupt preamble. - // In these cases, we just repeat the message several times to create an arbitrarily long stream. - it('should parse binary sbp and payload with leading extra preamble (2)', function (done) { - var rs = new Readable(); - var bigBuf = new Buffer(0); - let expectedCalls = 0; - while (bigBuf.length < 500) { - bigBuf = Buffer.concat([bigBuf, new Buffer(testSpec['raw_packet'], 'base64')]); - expectedCalls++ - } - rs.push(Buffer.concat([new Buffer([0x55]), bigBuf])); - rs.push(null); + // For both "corrupt preamble" tests, the corrupt "length" field could be much longer than the actual message. + // In a real-world case we will have a constant stream of data which will allow us to read that + // full length, and reframe after discovering that it's a corrupt preamble. + // In these cases, we just repeat the message several times to create an arbitrarily long stream. + it('should parse binary sbp and payload with leading extra preamble (2)', function (done) { + var rs = new Readable(); + var bigBuf = new Buffer(0); + let expectedCalls = 0; + while (bigBuf.length < 500) { + bigBuf = Buffer.concat([bigBuf, new Buffer(testSpec['raw_packet'], 'base64')]); + expectedCalls++ + } + rs.push(Buffer.concat([new Buffer([0x55]), bigBuf])); + rs.push(null); - let ctx = { - testSpec, - done, - expectedCalls, - callbacks: 0, - }; - dispatch(rs, dispatchee.bind(ctx)); - }); + let ctx = { + testSpec, + done, + expectedCalls, + callbacks: 0, + }; + dispatch(rs, dispatchee.bind(ctx)); + }); - it('should parse binary sbp and payload with leading truncated message', function (done) { - var rs = new Readable(); - var packetBuf = new Buffer(testSpec['raw_packet'], 'base64'); - rs.push(packetBuf.slice(0,packetBuf.length-5)); + if (filename.indexOf('test_MsgFlashDone.yaml') === -1 && + filename.indexOf('test_MsgM25FlashWriteStatus.yaml') === -1 && + filename.indexOf('test_MsgBootloaderJumptoApp.yaml') === -1) { + it('should parse binary sbp and payload with leading truncated message', function (done) { + var rs = new Readable(); + var packetBuf = new Buffer(testSpec['raw_packet'], 'base64'); + rs.push(packetBuf.slice(0,packetBuf.length-5)); - var requiredCalls = 1; + var requiredCalls = 1; - // `length` is longer than one full buffer for these corrupted messages - // similar issue to the above tests - if (filename.indexOf('test_MsgUartState.yaml') !== -1) { - requiredCalls = 10; - } + // `length` is longer than one full buffer for these corrupted messages + // similar issue to the above tests + if (filename.indexOf('test_MsgUartState.yaml') !== -1 || + filename.indexOf('test_MsgSsrOrbitClockDepA.yaml') !== -1 || + filename.indexOf('test_MsgSettingsReadByIndexReq.yaml') !== -1 || + filename.indexOf('test_MsgResetFilters.yaml') !== -1 || + filename.indexOf('test_MsgLinuxSysState.yaml') !== -1 || + filename.indexOf('test_MsgStmUniqueIdResp.yaml') !== -1) { + requiredCalls = 10; + } - var expectedCalls; - for (expectedCalls = 0; expectedCalls < requiredCalls; expectedCalls++) { - rs.push(packetBuf); - } - rs.push(null); + var expectedCalls; + for (expectedCalls = 0; expectedCalls < requiredCalls; expectedCalls++) { + rs.push(packetBuf); + } + rs.push(null); - let ctx = { - testSpec, - done, - expectedCalls, - callbacks: 0, - }; - dispatch(rs, dispatchee.bind(ctx)); + let ctx = { + testSpec, + done, + expectedCalls, + callbacks: 0, + }; + dispatch(rs, dispatchee.bind(ctx)); + }); + } }); }); - }); + } }); }); }); diff --git a/rust/sbp/tests/integration/auto_check_sbp_gnss_gnss_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_gnss_gnss_structs.rs deleted file mode 100644 index 86c59f5da5..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_gnss_gnss_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/gnss/test_gnss_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_gnss_gnss_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_gnss_gnss_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_gnss_gnss_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_gnss_gnss_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_integrity_integrity_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_integrity_integrity_structs.rs deleted file mode 100644 index c74111fb62..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_integrity_integrity_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_integrity_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_integrity_integrity_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_integrity_integrity_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_integrity_integrity_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_integrity_integrity_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_navigation_navigation_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_navigation_navigation_structs.rs deleted file mode 100644 index b0448021e4..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_navigation_navigation_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_navigation_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_navigation_navigation_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_navigation_navigation_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_navigation_navigation_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_navigation_navigation_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_observation_observation_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_observation_observation_structs.rs deleted file mode 100644 index 6c8b63758e..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_observation_observation_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_observation_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_observation_observation_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_observation_observation_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_observation_observation_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_observation_observation_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_piksi_piksi_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_piksi_piksi_structs.rs deleted file mode 100644 index cf472c824d..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_piksi_piksi_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_piksi_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_piksi_piksi_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_piksi_piksi_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_piksi_piksi_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_piksi_piksi_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_signing_signing_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_signing_signing_structs.rs deleted file mode 100644 index 26e83b479e..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_signing_signing_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_signing_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_signing_signing_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_signing_signing_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_signing_signing_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_signing_signing_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_soln_meta_soln_meta_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_soln_meta_soln_meta_structs.rs deleted file mode 100644 index 214ef21b52..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_soln_meta_soln_meta_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_soln_meta_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_soln_meta_soln_meta_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_soln_meta_soln_meta_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_soln_meta_soln_meta_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_soln_meta_soln_meta_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_ssr_ssr_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_ssr_ssr_structs.rs deleted file mode 100644 index 942445a2ec..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_ssr_ssr_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_ssr_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_ssr_ssr_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_ssr_ssr_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_ssr_ssr_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_ssr_ssr_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_system_system_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_system_system_structs.rs deleted file mode 100644 index 0654b5a87b..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_system_system_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_system_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_system_system_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_system_system_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_system_system_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_system_system_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_telemetry_acquisition_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_telemetry_acquisition_structs.rs deleted file mode 100644 index ca1bb7d665..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_telemetry_acquisition_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_acquisition_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_telemetry_acquisition_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_telemetry_acquisition_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_telemetry_acquisition_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_telemetry_acquisition_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_telemetry_telemetry_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_telemetry_telemetry_structs.rs deleted file mode 100644 index 3bb1621c0a..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_telemetry_telemetry_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/telemetry/test_telemetry_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_telemetry_telemetry_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_telemetry_telemetry_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_telemetry_telemetry_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_telemetry_telemetry_structs() {} diff --git a/rust/sbp/tests/integration/auto_check_sbp_tracking_tracking_structs.rs b/rust/sbp/tests/integration/auto_check_sbp_tracking_tracking_structs.rs deleted file mode 100644 index f8a88a366b..0000000000 --- a/rust/sbp/tests/integration/auto_check_sbp_tracking_tracking_structs.rs +++ /dev/null @@ -1,45 +0,0 @@ -// -// Copyright (C) 2019-2021 Swift Navigation Inc. -// Contact: https://support.swiftnav.com -// -// This source is subject to the license found in the file 'LICENSE' which must -// be be distributed together with this source. All other rights reserved. -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_tracking_structs.yaml by generate.py. Do not modify by hand! - -use crate::*; - -/// Tests [`sbp::iter_messages`], from payload into SBP messages -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -fn test_auto_check_sbp_tracking_tracking_structs() {} - -/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message -/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. -/// -/// Asserts: -/// - SBP message constructed via payload is identical to from fields -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_tracking_tracking_structs() {} - -/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON -/// -/// Assumes: -/// - [`self::test_auto_check_sbp_tracking_tracking_structs`] passes -/// -/// Asserts: -/// - SBP fields equates to that of the field -/// - Payload is identical -#[test] -#[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_tracking_tracking_structs() {} diff --git a/rust/sbp/tests/integration/main.rs b/rust/sbp/tests/integration/main.rs index 088892b7e5..dab35b2bcd 100644 --- a/rust/sbp/tests/integration/main.rs +++ b/rust/sbp/tests/integration/main.rs @@ -42,10 +42,8 @@ mod auto_check_sbp_flash_msg_stm_flash_lock_sector; mod auto_check_sbp_flash_msg_stm_flash_unlock_sector; mod auto_check_sbp_flash_msg_stm_unique_id_req; mod auto_check_sbp_flash_msg_stm_unique_id_resp; -mod auto_check_sbp_gnss_gnss_structs; mod auto_check_sbp_imu_msg_imu_aux; mod auto_check_sbp_imu_msg_imu_raw; -mod auto_check_sbp_integrity_integrity_structs; mod auto_check_sbp_integrity_msg_acknowledge; mod auto_check_sbp_integrity_msg_ssr_flag_high_level; mod auto_check_sbp_integrity_msg_ssr_flag_iono_grid_point_sat_los; @@ -109,7 +107,6 @@ mod auto_check_sbp_navigation_msg_vel_ned_cov_gnss; mod auto_check_sbp_navigation_msg_vel_ned_dep_a; mod auto_check_sbp_navigation_msg_vel_ned_gnss; mod auto_check_sbp_navigation_msg_vel_nedcov; -mod auto_check_sbp_navigation_navigation_structs; mod auto_check_sbp_ndb_msg_ndb_event; mod auto_check_sbp_observation_msg_almanac_glo; mod auto_check_sbp_observation_msg_almanac_glo_dep; @@ -149,7 +146,6 @@ mod auto_check_sbp_observation_msg_obs_dep_c; mod auto_check_sbp_observation_msg_osr; mod auto_check_sbp_observation_msg_sv_az_el; mod auto_check_sbp_observation_msg_sv_configuration_gps_dep; -mod auto_check_sbp_observation_observation_structs; mod auto_check_sbp_orientation_msg_angular_rate; mod auto_check_sbp_orientation_msg_baseline_heading; mod auto_check_sbp_orientation_msg_orient_euler; @@ -179,7 +175,6 @@ mod auto_check_sbp_piksi_msg_specan_dep; mod auto_check_sbp_piksi_msg_thread_state; mod auto_check_sbp_piksi_msg_uart_state; mod auto_check_sbp_piksi_msg_uart_state_dep_a; -mod auto_check_sbp_piksi_piksi_structs; mod auto_check_sbp_sbas_msg_sbas_raw; mod auto_check_sbp_settings_msg_settings_read_by_index_done; mod auto_check_sbp_settings_msg_settings_read_by_index_req; @@ -200,8 +195,6 @@ mod auto_check_sbp_signing_msg_ecdsa_signature_dep_b; mod auto_check_sbp_signing_msg_ed25519_certificate_dep; mod auto_check_sbp_signing_msg_ed25519_signature_dep_a; mod auto_check_sbp_signing_msg_ed25519_signature_dep_b; -mod auto_check_sbp_signing_signing_structs; -mod auto_check_sbp_soln_meta_soln_meta_structs; mod auto_check_sbp_solution_meta_msg_soln_meta; mod auto_check_sbp_solution_meta_msg_soln_meta_dep_a; mod auto_check_sbp_ssr_msg_ssr_code_biases; @@ -224,7 +217,6 @@ mod auto_check_sbp_ssr_msg_ssr_stec_correction_dep_a; mod auto_check_sbp_ssr_msg_ssr_tile_definition; mod auto_check_sbp_ssr_msg_ssr_tile_definition_dep_a; mod auto_check_sbp_ssr_msg_ssr_tile_definition_dep_b; -mod auto_check_sbp_ssr_ssr_structs; mod auto_check_sbp_system_msg_csac_telemetry; mod auto_check_sbp_system_msg_csac_telemetry_labels; mod auto_check_sbp_system_msg_dgnss_status; @@ -238,10 +230,7 @@ mod auto_check_sbp_system_msg_sensor_aid_event; mod auto_check_sbp_system_msg_startup; mod auto_check_sbp_system_msg_status_journal; mod auto_check_sbp_system_msg_status_report; -mod auto_check_sbp_system_system_structs; -mod auto_check_sbp_telemetry_acquisition_structs; mod auto_check_sbp_telemetry_msg_tel_sv; -mod auto_check_sbp_telemetry_telemetry_structs; mod auto_check_sbp_tracking_msg_measurement_state; mod auto_check_sbp_tracking_msg_tracking_iq; mod auto_check_sbp_tracking_msg_tracking_iq_dep_a; @@ -251,7 +240,6 @@ mod auto_check_sbp_tracking_msg_tracking_state_dep_b; mod auto_check_sbp_tracking_msg_tracking_state_detailed_dep; mod auto_check_sbp_tracking_msg_tracking_state_detailed_dep_a; mod auto_check_sbp_tracking_msgtracking_state_dep_a; -mod auto_check_sbp_tracking_tracking_structs; mod auto_check_sbp_user_msg_user_data; mod auto_check_sbp_vehicle_msg_odometry; mod auto_check_sbp_vehicle_msg_wheeltick; diff --git a/spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml b/spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml index 31b5c4062c..8eacf07338 100644 --- a/spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml +++ b/spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml @@ -4,15 +4,6 @@ package: sbp.settings tests: - msg: - c_decoded_fields: - setting: - handle_as: encoded-string - encoded_len: 40 - fn_prefix: sbp_msg_settings_write_setting - sections: - - "section-name" - - "setting-name" - - "setting-value" fields: setting: "section-name\0setting-name\0setting-value\0" c_decoded_fields: