Skip to content

Commit

Permalink
Generate more things that somehow got missed
Browse files Browse the repository at this point in the history
  • Loading branch information
woodfell committed Feb 2, 2024
1 parent 0ca9983 commit 470c354
Show file tree
Hide file tree
Showing 10 changed files with 1,371 additions and 2 deletions.

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions java/test/auto_check_sbp_profiling_MsgProfilingSystemInfoTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* Copyright (C) 2015-2022 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.
*/
package com.swiftnav.sbp.test;

// This file was auto-generated from
// spec/tests/yaml/swiftnav/sbp/profiling/test_MsgProfilingSystemInfo.yaml by generate.py. Do not
// modify by hand!


import com.swiftnav.sbp.SBPMessage;
import com.swiftnav.sbp.profiling.MsgProfilingSystemInfo;
import java.math.BigInteger;
import org.json.JSONObject;
import org.junit.Test;

public class auto_check_sbp_profiling_MsgProfilingSystemInfoTest {

public static boolean debug = false;
private static final double DELTA = 1e-15;

@Test
public void test1() throws Throwable {
if (debug)
System.out.format(
"%n%s%n", "auto_check_sbp_profiling_MsgProfilingSystemInfoTest.test1");
byte[] payload =
new byte[] {
(byte) 98, (byte) 40, (byte) 52, (byte) 0, (byte) 0, (byte) 0, (byte) 0,
(byte) 0, (byte) 114, (byte) 12, (byte) 157, (byte) 0, (byte) 0, (byte) 0,
(byte) 0, (byte) 0, (byte) 27, (byte) 72, (byte) 195, (byte) 226, (byte) 0,
};
SBPMessage sbp = new SBPMessage(0x1000, 0xcf01, payload);
MsgProfilingSystemInfo msg = new MsgProfilingSystemInfo(sbp);
JSONObject json = msg.toJSON();
Number value;
Number expected;
value = msg.age;
if (value instanceof BigInteger) {
org.junit.Assert.assertTrue(
"'" + msg.age + "' != '" + 10292338 + "'",
value.equals(BigInteger.valueOf(10292338L)));
} else {
value = value.longValue();
expected = 10292338L;
org.junit.Assert.assertEquals(value, expected);
}
value = msg.heap_usage;
if (value instanceof BigInteger) {
org.junit.Assert.assertTrue(
"'" + msg.heap_usage + "' != '" + 14861128 + "'",
value.equals(BigInteger.valueOf(14861128L)));
} else {
value = value.longValue();
expected = 14861128L;
org.junit.Assert.assertEquals(value, expected);
}
value = msg.n_threads;
if (value instanceof BigInteger) {
org.junit.Assert.assertTrue(
"'" + msg.n_threads + "' != '" + 27 + "'",
value.equals(BigInteger.valueOf(27L)));
} else {
value = value.longValue();
expected = 27L;
org.junit.Assert.assertEquals(value, expected);
}
value = msg.total_cpu_time;
if (value instanceof BigInteger) {
org.junit.Assert.assertTrue(
"'" + msg.total_cpu_time + "' != '" + 3418210 + "'",
value.equals(BigInteger.valueOf(3418210L)));
} else {
value = value.longValue();
expected = 3418210L;
org.junit.Assert.assertEquals(value, expected);
}

org.junit.Assert.assertNotEquals("", msg.getFriendlyName());
}
}
Binary file not shown.
28 changes: 28 additions & 0 deletions jsonschema/MsgProfilingResourceCounter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"copyright": [
"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."
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "#MsgProfilingResourceCounter",
"title":"MsgProfilingResourceCounter",
"description":"Information about resource buckets. Refer to product documentation to understand the meaning and values in this message.\n",
"type": "object",
"properties": {
"seq_no": {"type": "integer"},
"seq_len": {"type": "integer"},
"buckets": {"type": "array", "items": {"$ref": "ResourceBucket.json"}}
},
"required": [
"seq_no",
"seq_len",
"buckets"
]
}
30 changes: 30 additions & 0 deletions jsonschema/MsgProfilingSystemInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"copyright": [
"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."
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "#MsgProfilingSystemInfo",
"title":"MsgProfilingSystemInfo",
"description":"Contains basic information about system resource usage. System is defined in terms of the source of this message and may vary from sender to sender. Refer to product documentation to understand the exact scope and meaning of this message.\n",
"type": "object",
"properties": {
"total_cpu_time": {"type": "integer"},
"age": {"type": "integer"},
"n_threads": {"type": "integer"},
"heap_usage": {"type": "integer"}
},
"required": [
"total_cpu_time",
"age",
"n_threads",
"heap_usage"
]
}
34 changes: 34 additions & 0 deletions jsonschema/MsgProfilingThreadInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"copyright": [
"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."
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "#MsgProfilingThreadInfo",
"title":"MsgProfilingThreadInfo",
"description":"Contains profiling information related to a single thread being tracked by the producing system. Refer to product documentation to understand the exact scope and meaning of this message.\n",
"type": "object",
"properties": {
"total_cpu_time": {"type": "integer"},
"age": {"type": "integer"},
"state": {"type": "integer"},
"stack_size": {"type": "integer"},
"stack_usage": {"type": "integer"},
"name": {"type": "string"}
},
"required": [
"total_cpu_time",
"age",
"state",
"stack_size",
"stack_usage",
"name"
]
}
40 changes: 40 additions & 0 deletions jsonschema/ResourceBucket.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"copyright": [
"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."
],
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "#ResourceBucket",
"title":"ResourceBucket",
"description":"Information about allocation of various resources grouped by buckets. Refer to product documentation to understand the meaning and values in this message.\n",
"type": "object",
"properties": {
"name": {"type": "string"},
"thread": {"type": "integer"},
"mutex": {"type": "integer"},
"cv": {"type": "integer"},
"io": {"type": "integer"},
"heap_bytes_alloc": {"type": "integer"},
"heap_bytes_free": {"type": "integer"},
"io_write": {"type": "integer"},
"io_read": {"type": "integer"}
},
"required": [
"name",
"thread",
"mutex",
"cv",
"io",
"heap_bytes_alloc",
"heap_bytes_free",
"io_write",
"io_read"
]
}
Loading

0 comments on commit 470c354

Please sign in to comment.