summaryrefslogtreecommitdiff
path: root/render-test
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-10-11 16:52:22 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-10-11 18:29:52 +0300
commitacd7fba3d50aca132e2d3ce6fb75279b2d1f3631 (patch)
treec460addb1b0d17e59efd58f05322a0bd9bd5f46c /render-test
parent7f5c63061398e294e1bd79e157e5486ee787c726 (diff)
downloadqtlocation-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.pngbin686 -> 169 bytes
-rw-r--r--render-test/tests/filesize/fail-file-doesnt-match/metrics.json1
-rw-r--r--render-test/tests/filesize/fail-file-doesnt-match/style.json14
-rw-r--r--render-test/tests/filesize/fail-file-not-found/expected.pngbin0 -> 169 bytes
-rw-r--r--render-test/tests/filesize/fail-file-not-found/style.json32
-rw-r--r--render-test/tests/filesize/fail-size-is-over/expected.pngbin686 -> 169 bytes
-rw-r--r--render-test/tests/filesize/fail-size-is-over/style.json10
-rw-r--r--render-test/tests/filesize/fail-size-is-under/expected.pngbin686 -> 169 bytes
-rw-r--r--render-test/tests/filesize/fail-size-is-under/style.json10
-rw-r--r--render-test/tests/filesize/pass-size-is-same/expected.pngbin686 -> 169 bytes
-rw-r--r--render-test/tests/filesize/pass-size-is-same/metrics.json2
-rw-r--r--render-test/tests/filesize/pass-size-is-same/style.json10
-rw-r--r--render-test/tests/should-fail.json3
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
index 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
Binary files differ
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
new file mode 100644
index 0000000000..83d01c4e5d
--- /dev/null
+++ b/render-test/tests/filesize/fail-file-not-found/expected.png
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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
index 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
Binary files differ
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."
}