summaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorChristian Gagneraud <cgagneraud@techworks.ie>2012-06-04 01:14:27 +0100
committerChristian Gagneraud <chris@techworks.ie>2012-06-20 10:05:41 +0100
commit5214d309cf07b428ccfac647f7ac9ed8d597186f (patch)
tree672ecb9d61a1973252be347eb5b1bf13b7dfe7d1 /devtools
parent9e6cdcb27d6af143721bb27bd886fc43d1214626 (diff)
downloadgpsd-5214d309cf07b428ccfac647f7ac9ed8d597186f.tar.gz
[AIS] Fix plenty of small bugs unveiled by aishub test campaign.
A test campaign was run with live data from aishub.net (ca. 25 millions sentence, 1.2 GB of logs), the goal was to check the decoding and the JSON parsing and dumping code. On all the AIS data, the following tests were done: - AIVDM decoding - JSON scaled dump - JSON validity check on scaled dump. - JSON unscaled dump - JSON validity check on unscaled dump - JSON unscaled idempotency check - JSON unscaled/scaled idempotency check The last check consisted of: - parsing the unscaled dump - dumping it back in scaled mode - compare it with the original scaled dump. This test campaign has unveiled plenty of small bugs all around the AIS code. This patch fixes all of them and adds new sentences in the regression tests.
Diffstat (limited to 'devtools')
-rwxr-xr-xdevtools/ais.py2
-rwxr-xr-xdevtools/tablegen.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/devtools/ais.py b/devtools/ais.py
index a2ea58ac..f9f5706d 100755
--- a/devtools/ais.py
+++ b/devtools/ais.py
@@ -864,7 +864,7 @@ type27 = (
aivdm_decode = (
bitfield('msgtype', 6, 'unsigned', 0, "Message Type",
- validator=lambda n: n > 0 and n <= 26),
+ validator=lambda n: n > 0 and n <= 27),
bitfield('repeat', 2, 'unsigned', None, "Repeat Indicator"),
bitfield('mmsi', 30, 'unsigned', 0, "MMSI"),
# This is the master dispatch on AIS message type
diff --git a/devtools/tablegen.py b/devtools/tablegen.py
index 4a68b8df..c0b3cba8 100755
--- a/devtools/tablegen.py
+++ b/devtools/tablegen.py
@@ -327,7 +327,7 @@ def make_json_dumper(wfp):
print >>wfp, base + "}"
print >>wfp, base + "if (buf[strlen(buf) - 1] == ',')"
print >>wfp, base + step + "buf[strlen(buf)-1] = '\0';"
- print >>wfp, base + "(void)strlcat(buf, ']}\r\n,', buflen - strlen(buf));"
+ print >>wfp, base + "(void)strlcat(buf, ']}\r\n', buflen - strlen(buf));"
def make_json_generator(wfp):
# Write a stanza for jsongen.py.in describing how to generate a