summaryrefslogtreecommitdiff
path: root/test_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-09-22 14:50:03 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-09-22 14:50:03 -0400
commit282691da60ec526772f713a63fa0b8f43aea7acb (patch)
tree622f4d55c882f63475b84691d41108dd17326cca /test_json.c
parentf63bdafc18991624b872e9efa858c024834a540e (diff)
downloadgpsd-282691da60ec526772f713a63fa0b8f43aea7acb.tar.gz
Refactor representation of satellite data into an array of structs...
...from a set of parallel arrays. This change flushed out a longstanding bug in the computation of DOPs for estimated error bars. Some test-load rebuilds were required: geostar-geos1m-binary.log.chk: With this change error estimates are computed and reported. trimble-lassen_iq-3dfix.log, trimble-lassen_iq-3dfix.log: the change revealed a bug in the computation of satellite-seen bits. Error estimates did not change. navcom.log: Error estimates changed. With these rebuilds, all regression tests pass.
Diffstat (limited to 'test_json.c')
-rw-r--r--test_json.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/test_json.c b/test_json.c
index 87576ea5..0e3352c3 100644
--- a/test_json.c
+++ b/test_json.c
@@ -281,16 +281,16 @@ static void jsontest(int i)
status = libgps_json_unpack(json_str2, &gpsdata, NULL);
assert_case(2, status);
assert_integer("used", gpsdata.satellites_used, 6);
- assert_integer("PRN[0]", gpsdata.PRN[0], 10);
- assert_integer("el[0]", gpsdata.elevation[0], 45);
- assert_integer("az[0]", gpsdata.azimuth[0], 196);
- assert_real("ss[0]", gpsdata.ss[0], 34);
- assert_integer("used[0]", gpsdata.used[0], 10);
- assert_integer("used[5]", gpsdata.used[5], 27);
- assert_integer("PRN[6]", gpsdata.PRN[6], 21);
- assert_integer("el[6]", gpsdata.elevation[6], 10);
- assert_integer("az[6]", gpsdata.azimuth[6], 301);
- assert_real("ss[6]", gpsdata.ss[6], 0);
+ assert_integer("PRN[0]", gpsdata.skyview[0].PRN, 10);
+ assert_integer("el[0]", gpsdata.skyview[0].elevation, 45);
+ assert_integer("az[0]", gpsdata.skyview[0].azimuth, 196);
+ assert_real("ss[0]", gpsdata.skyview[0].ss, 34);
+ assert_boolean("used[0]", gpsdata.skyview[0].used, true);
+ assert_integer("PRN[6]", gpsdata.skyview[6].PRN, 21);
+ assert_integer("el[6]", gpsdata.skyview[6].elevation, 10);
+ assert_integer("az[6]", gpsdata.skyview[6].azimuth, 301);
+ assert_real("ss[6]", gpsdata.skyview[6].ss, 0);
+ assert_boolean("used[6]", gpsdata.skyview[6].used, false);
break;
case 3:
@@ -363,7 +363,7 @@ static void jsontest(int i)
break;
#ifdef JSON_MINIMAL
-#define MAXTEST 10
+#define MAXTEST 9
#else
case 10:
status = json_read_array(json_str10, &json_array_10, NULL);
@@ -428,7 +428,7 @@ int main(int argc UNUSED, char *argv[]UNUSED)
jsontest(individual);
else {
int i;
- for (i = 1; i <= MAXTEST; i++)
+ for (i = 1; i < MAXTEST; i++)
jsontest(i);
}