diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-10-11 16:52:22 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-10-11 18:29:52 +0300 |
commit | acd7fba3d50aca132e2d3ce6fb75279b2d1f3631 (patch) | |
tree | c460addb1b0d17e59efd58f05322a0bd9bd5f46c /render-test | |
parent | 7f5c63061398e294e1bd79e157e5486ee787c726 (diff) | |
download | qtlocation-mapboxgl-acd7fba3d50aca132e2d3ce6fb75279b2d1f3631.tar.gz |
[render-test] Add more probe tests for file size
Also make the tests simpler.
Diffstat (limited to 'render-test')
-rw-r--r-- | render-test/tests/filesize/fail-file-doesnt-match/expected.png | bin | 686 -> 169 bytes | |||
-rw-r--r-- | render-test/tests/filesize/fail-file-doesnt-match/metrics.json | 1 | ||||
-rw-r--r-- | render-test/tests/filesize/fail-file-doesnt-match/style.json | 14 | ||||
-rw-r--r-- | render-test/tests/filesize/fail-file-not-found/expected.png | bin | 0 -> 169 bytes | |||
-rw-r--r-- | render-test/tests/filesize/fail-file-not-found/style.json | 32 | ||||
-rw-r--r-- | render-test/tests/filesize/fail-size-is-over/expected.png | bin | 686 -> 169 bytes | |||
-rw-r--r-- | render-test/tests/filesize/fail-size-is-over/style.json | 10 | ||||
-rw-r--r-- | render-test/tests/filesize/fail-size-is-under/expected.png | bin | 686 -> 169 bytes | |||
-rw-r--r-- | render-test/tests/filesize/fail-size-is-under/style.json | 10 | ||||
-rw-r--r-- | render-test/tests/filesize/pass-size-is-same/expected.png | bin | 686 -> 169 bytes | |||
-rw-r--r-- | render-test/tests/filesize/pass-size-is-same/metrics.json | 2 | ||||
-rw-r--r-- | render-test/tests/filesize/pass-size-is-same/style.json | 10 | ||||
-rw-r--r-- | render-test/tests/should-fail.json | 3 |
13 files changed, 50 insertions, 32 deletions
diff --git a/render-test/tests/filesize/fail-file-doesnt-match/expected.png b/render-test/tests/filesize/fail-file-doesnt-match/expected.png Binary files differindex feed2e457f..83d01c4e5d 100644 --- a/render-test/tests/filesize/fail-file-doesnt-match/expected.png +++ b/render-test/tests/filesize/fail-file-doesnt-match/expected.png diff --git a/render-test/tests/filesize/fail-file-doesnt-match/metrics.json b/render-test/tests/filesize/fail-file-doesnt-match/metrics.json new file mode 100644 index 0000000000..8401ce91e9 --- /dev/null +++ b/render-test/tests/filesize/fail-file-doesnt-match/metrics.json @@ -0,0 +1 @@ +{"fileSize":[["image","foo.123",442],["style","bar.321",609]]} diff --git a/render-test/tests/filesize/fail-file-doesnt-match/style.json b/render-test/tests/filesize/fail-file-doesnt-match/style.json index 91e90ffbe8..a3267fcf5e 100644 --- a/render-test/tests/filesize/fail-file-doesnt-match/style.json +++ b/render-test/tests/filesize/fail-file-doesnt-match/style.json @@ -3,8 +3,8 @@ "metadata": { "test": { "operations": [ - ["probeFileSize", "style", "aaaaa.json"], - ["probeFileSize", "image", "bbbbb.png"] + ["probeFileSize", "style", "style.json"], + ["probeFileSize", "image", "expected.png"] ], "width": 64, "height": 64 @@ -22,15 +22,11 @@ } } }, - "sprite": "local://sprites/sprite", "layers": [ { - "id": "symbol", - "type": "symbol", - "source": "geojson", - "layout": { - "icon-image": "circle-12" - } + "id": "circle", + "type": "circle", + "source": "geojson" } ] } diff --git a/render-test/tests/filesize/fail-file-not-found/expected.png b/render-test/tests/filesize/fail-file-not-found/expected.png Binary files differnew file mode 100644 index 0000000000..83d01c4e5d --- /dev/null +++ b/render-test/tests/filesize/fail-file-not-found/expected.png diff --git a/render-test/tests/filesize/fail-file-not-found/style.json b/render-test/tests/filesize/fail-file-not-found/style.json new file mode 100644 index 0000000000..17dbd1e3d7 --- /dev/null +++ b/render-test/tests/filesize/fail-file-not-found/style.json @@ -0,0 +1,32 @@ +{ + "version": 8, + "metadata": { + "test": { + "operations": [ + ["probeFileSize", "style", "style.aaaa"], + ["probeFileSize", "image", "expected.bbb"] + ], + "width": 64, + "height": 64 + } + }, + "sources": { + "geojson": { + "type": "geojson", + "data": { + "type": "Point", + "coordinates": [ + 0, + 0 + ] + } + } + }, + "layers": [ + { + "id": "circle", + "type": "circle", + "source": "geojson" + } + ] +} diff --git a/render-test/tests/filesize/fail-size-is-over/expected.png b/render-test/tests/filesize/fail-size-is-over/expected.png Binary files differindex feed2e457f..83d01c4e5d 100644 --- a/render-test/tests/filesize/fail-size-is-over/expected.png +++ b/render-test/tests/filesize/fail-size-is-over/expected.png diff --git a/render-test/tests/filesize/fail-size-is-over/style.json b/render-test/tests/filesize/fail-size-is-over/style.json index ce2069a372..a3267fcf5e 100644 --- a/render-test/tests/filesize/fail-size-is-over/style.json +++ b/render-test/tests/filesize/fail-size-is-over/style.json @@ -22,15 +22,11 @@ } } }, - "sprite": "local://sprites/sprite", "layers": [ { - "id": "symbol", - "type": "symbol", - "source": "geojson", - "layout": { - "icon-image": "circle-12" - } + "id": "circle", + "type": "circle", + "source": "geojson" } ] } diff --git a/render-test/tests/filesize/fail-size-is-under/expected.png b/render-test/tests/filesize/fail-size-is-under/expected.png Binary files differindex feed2e457f..83d01c4e5d 100644 --- a/render-test/tests/filesize/fail-size-is-under/expected.png +++ b/render-test/tests/filesize/fail-size-is-under/expected.png diff --git a/render-test/tests/filesize/fail-size-is-under/style.json b/render-test/tests/filesize/fail-size-is-under/style.json index ce2069a372..a3267fcf5e 100644 --- a/render-test/tests/filesize/fail-size-is-under/style.json +++ b/render-test/tests/filesize/fail-size-is-under/style.json @@ -22,15 +22,11 @@ } } }, - "sprite": "local://sprites/sprite", "layers": [ { - "id": "symbol", - "type": "symbol", - "source": "geojson", - "layout": { - "icon-image": "circle-12" - } + "id": "circle", + "type": "circle", + "source": "geojson" } ] } diff --git a/render-test/tests/filesize/pass-size-is-same/expected.png b/render-test/tests/filesize/pass-size-is-same/expected.png Binary files differindex feed2e457f..83d01c4e5d 100644 --- a/render-test/tests/filesize/pass-size-is-same/expected.png +++ b/render-test/tests/filesize/pass-size-is-same/expected.png diff --git a/render-test/tests/filesize/pass-size-is-same/metrics.json b/render-test/tests/filesize/pass-size-is-same/metrics.json index 607565213f..cf4bb89dd0 100644 --- a/render-test/tests/filesize/pass-size-is-same/metrics.json +++ b/render-test/tests/filesize/pass-size-is-same/metrics.json @@ -1 +1 @@ -{"fileSize":[["image","expected.png",686],["style","style.json",609]]}
\ No newline at end of file +{"fileSize":[["image","expected.png",169],["style","style.json",510]]}
\ No newline at end of file diff --git a/render-test/tests/filesize/pass-size-is-same/style.json b/render-test/tests/filesize/pass-size-is-same/style.json index ce2069a372..a3267fcf5e 100644 --- a/render-test/tests/filesize/pass-size-is-same/style.json +++ b/render-test/tests/filesize/pass-size-is-same/style.json @@ -22,15 +22,11 @@ } } }, - "sprite": "local://sprites/sprite", "layers": [ { - "id": "symbol", - "type": "symbol", - "source": "geojson", - "layout": { - "icon-image": "circle-12" - } + "id": "circle", + "type": "circle", + "source": "geojson" } ] } diff --git a/render-test/tests/should-fail.json b/render-test/tests/should-fail.json index 28859d4151..1c3784d473 100644 --- a/render-test/tests/should-fail.json +++ b/render-test/tests/should-fail.json @@ -1,5 +1,6 @@ { "tests/filesize/fail-size-is-over": "Should fail, size is bigger than expected.", "tests/filesize/fail-size-is-under": "Should fail, size is smaller than expected.", - "tests/filesize/fail-file-doesnt-match": "Should fail, file not found." + "tests/filesize/fail-file-doesnt-match": "Should fail, doesn't match the expectation.", + "tests/filesize/fail-file-not-found": "Should fail, file not found." } |