]> granicus.if.org Git - file/commitdiff
Add more tests
authorChristos Zoulas <christos@zoulas.com>
Sat, 11 Aug 2018 12:12:39 +0000 (12:12 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sat, 11 Aug 2018 12:12:39 +0000 (12:12 +0000)
tests/Makefile.am
tests/json1.result [new file with mode: 0644]
tests/json1.testfile [new file with mode: 0644]
tests/json2.result [new file with mode: 0644]
tests/json2.testfile [new file with mode: 0644]
tests/json3.result [new file with mode: 0644]
tests/json3.testfile [new file with mode: 0644]
tests/regex-eol.magic [new file with mode: 0644]
tests/regex-eol.result [new file with mode: 0644]
tests/regex-eol.testfile [new file with mode: 0644]

index bcb5518d7e70d0bd0058607a46be0fb07b744280..e84ca13642a2ba34b2b37aa4cb08207e2a491983 100644 (file)
@@ -3,18 +3,86 @@ test_LDADD = $(top_builddir)/src/libmagic.la
 test_CPPFLAGS = -I$(top_builddir)/src
 
 EXTRA_DIST = \
-escapevel.result \
+regex-eol.magic \
+CVE-2014-1943.testfile \
+JW07022A.mp3.testfile \
 escapevel.testfile \
-gedcom.result \
+fit-map-data.testfile \
 gedcom.testfile \
-hddrawcopytool.result \
 hddrawcopytool.testfile \
-issue311docx.result \
 issue311docx.testfile \
+issue359xlsx.testfile \
+json1.testfile \
+json2.testfile \
+json3.testfile \
+regex-eol.testfile \
+zstd-v0.2-FF.testfile \
+zstd-v0.3-FF.testfile \
+zstd-v0.4-FF.testfile \
+zstd-v0.5-FF.testfile \
+zstd-v0.6-FF.testfile \
+zstd-v0.7-21.testfile \
+zstd-v0.7-22.testfile \
+zstd-v0.8-01.testfile \
+zstd-v0.8-02.testfile \
+zstd-v0.8-03.testfile \
+zstd-v0.8-16.testfile \
+zstd-v0.8-20.testfile \
+zstd-v0.8-21.testfile \
+zstd-v0.8-22.testfile \
+zstd-v0.8-23.testfile \
+zstd-v0.8-F4.testfile \
+zstd-v0.8-FF.testfile \
+CVE-2014-1943.result \
 JW07022A.mp3.result \
-JW07022A.mp3.testfile
+escapevel.result \
+fit-map-data.result \
+gedcom.result \
+hddrawcopytool.result \
+issue311docx.result \
+issue359xlsx.result \
+json1.result \
+json2.result \
+json3.result \
+regex-eol.result \
+zstd-3-skippable-frames.result \
+zstd-dictionary-0.result \
+zstd-dictionary-1.result \
+zstd-dictionary-2.result \
+zstd-skippable-frame-0.result \
+zstd-skippable-frame-4.result \
+zstd-skippable-frame-8.result \
+zstd-skippable-frame-C.result \
+zstd-v0.2-FF.result \
+zstd-v0.3-FF.result \
+zstd-v0.4-FF.result \
+zstd-v0.5-FF.result \
+zstd-v0.6-FF.result \
+zstd-v0.7-00.result \
+zstd-v0.7-21.result \
+zstd-v0.7-22.result \
+zstd-v0.8-00.result \
+zstd-v0.8-01.result \
+zstd-v0.8-02.result \
+zstd-v0.8-03.result \
+zstd-v0.8-16.result \
+zstd-v0.8-20.result \
+zstd-v0.8-21.result \
+zstd-v0.8-22.result \
+zstd-v0.8-23.result \
+zstd-v0.8-F4.result \
+zstd-v0.8-FF.result
 
 T = $(top_srcdir)/tests
 check-local:
        MAGIC=$(top_builddir)/magic/magic ./test
-       set -e; for i in $T/*.testfile; do echo Running test: $$i; TZ=UTC MAGIC=$(top_builddir)/magic/magic ./test $$i $${i%%.testfile}.result; done
+       set -e; \
+       for i in $T/*.testfile; do \
+               echo Running test: $$i; \
+               if [ -f $${i%%.testfile}.magic ]; then \
+                       m=$${i%%.testfile}.magic; \
+               else \
+                       m=$(top_builddir)/magic/magic; \
+               fi; \
+               TZ=UTC MAGIC=$$m ./test $$i $${i%%.testfile}.result; \
+       done
diff --git a/tests/json1.result b/tests/json1.result
new file mode 100644 (file)
index 0000000..01442dc
--- /dev/null
@@ -0,0 +1 @@
+JSON data
\ No newline at end of file
diff --git a/tests/json1.testfile b/tests/json1.testfile
new file mode 100644 (file)
index 0000000..3fb5760
--- /dev/null
@@ -0,0 +1,14 @@
+      {
+        "Image": {
+            "Width":  800,
+            "Height": 600,
+            "Title":  "View from 15th Floor",
+            "Thumbnail": {
+                "Url":    "http://www.example.com/image/481989943",
+                "Height": 125,
+                "Width":  100
+            },
+            "Animated" : false,
+            "IDs": [116, 943, 234, 38793]
+          }
+      }
diff --git a/tests/json2.result b/tests/json2.result
new file mode 100644 (file)
index 0000000..01442dc
--- /dev/null
@@ -0,0 +1 @@
+JSON data
\ No newline at end of file
diff --git a/tests/json2.testfile b/tests/json2.testfile
new file mode 100644 (file)
index 0000000..669007a
--- /dev/null
@@ -0,0 +1,22 @@
+  [
+        {
+           "precision": "zip",
+           "Latitude":  37.7668,
+           "Longitude": -122.3959,
+           "Address":   "",
+           "City":      "SAN FRANCISCO",
+           "State":     "CA",
+           "Zip":       "94107",
+           "Country":   "US"
+        },
+        {
+           "precision": "zip",
+           "Latitude":  37.371991,
+           "Longitude": -122.026020,
+           "Address":   "",
+           "City":      "SUNNYVALE",
+           "State":     "CA",
+           "Zip":       "94085",
+           "Country":   "US"
+        }
+      ]
diff --git a/tests/json3.result b/tests/json3.result
new file mode 100644 (file)
index 0000000..01442dc
--- /dev/null
@@ -0,0 +1 @@
+JSON data
\ No newline at end of file
diff --git a/tests/json3.testfile b/tests/json3.testfile
new file mode 100644 (file)
index 0000000..9f31ac1
--- /dev/null
@@ -0,0 +1,13 @@
+{
+    "abc": "edf",
+    "json": "crab",
+    "ololo": [
+        1,
+        2,
+        3
+    ],
+    "subcrab": {
+        "name": "crab",
+        "surname": "subcrab"
+    }
+}
diff --git a/tests/regex-eol.magic b/tests/regex-eol.magic
new file mode 100644 (file)
index 0000000..883d74c
--- /dev/null
@@ -0,0 +1,6 @@
+## Ansible Vault files
+0     string    $ANSIBLE_VAULT     Ansible Vault text
+>&1   regex/1l  [0-9]+(\.[0-9]+)+  \b, version %s
+>>&1  regex/1l  [^;]+$             \b, using %s encryption
+!:mime application/ansible-vault
+!:strength +60
diff --git a/tests/regex-eol.result b/tests/regex-eol.result
new file mode 100644 (file)
index 0000000..5b1a7db
--- /dev/null
@@ -0,0 +1 @@
+Ansible Vault text, version 1.1, using AES256 encryption
\ No newline at end of file
diff --git a/tests/regex-eol.testfile b/tests/regex-eol.testfile
new file mode 100644 (file)
index 0000000..607a852
--- /dev/null
@@ -0,0 +1,24 @@
+$ANSIBLE_VAULT;1.1;AES256
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000
+000000000000000000000000000000000000