[tracker-miners/wip/jfelder/add-flac-test] functional tests: Add a flac extraction test



commit e7248014e2b1e1da18717c2a4a8d8b581c2b330d
Author: Jean Felder <jean felder gmail com>
Date:   Tue Feb 25 22:33:28 2020 +0100

    functional tests: Add a flac extraction test

 tests/functional-tests/meson.build                 |   4 +++
 .../audio/flac-extraction.expected.json            |  40 +++++++++++++++++++++
 .../audio/flac-extraction.flac                     | Bin 0 -> 1027499 bytes
 3 files changed, 44 insertions(+)
---
diff --git a/tests/functional-tests/meson.build b/tests/functional-tests/meson.build
index 7e5037f39..24c1aca6e 100644
--- a/tests/functional-tests/meson.build
+++ b/tests/functional-tests/meson.build
@@ -40,6 +40,10 @@ if libvorbis.found()
   extractor_tests += 'audio/vorbis'
 endif
 
+if flac.found()
+  extractor_tests += 'audio/flac-extraction'
+endif
+
 if libjpeg.found() and exempi.found() and libexif.found()
   extractor_tests += [
     'images/jpeg-basic',
diff --git a/tests/functional-tests/test-extraction-data/audio/flac-extraction.expected.json 
b/tests/functional-tests/test-extraction-data/audio/flac-extraction.expected.json
new file mode 100644
index 000000000..d7aa7ac2f
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/audio/flac-extraction.expected.json
@@ -0,0 +1,40 @@
+{
+    "test": {
+        "Filename": "flac-extraction.flac"
+    },
+    "metadata": {
+        "@type": [
+            "nfo:Audio",
+            "nmm:MusicPiece"
+        ],
+        "nfo:channels": "2",
+        "nfo:codec": "Free Lossless Audio Codec (FLAC)",
+        "nfo:duration": "10",
+        "nfo:genre": "Rock",
+        "nfo:sampleRate": "44100",
+        "nie:comment": "no comment",
+        "nie:contentCreated": "2020-01-01T00:00:00+00:00",
+        "nie:copyright": "none",
+        "nie:title": "track title",
+        "nmm:trackNumber": "12",
+        "nmm:musicAlbum": {
+            "@type": "nmm:MusicAlbum",
+            "nie:title": "awesome album",
+            "nmm:albumTrackCount": "28",
+            "nmm:albumArtist": [
+                {
+                    "@type": "nmm:Artist",
+                    "nmm:artistName": "my album artist"
+                }
+            ]
+        },
+        "nmm:musicAlbumDisc": {
+            "@type": "nmm:MusicAlbumDisc",
+            "nmm:setNumber": 1
+        },
+        "nmm:performer": {
+            "@type": "nmm:Artist",
+            "nmm:artistName": "my artist"
+        }
+    }
+}
diff --git a/tests/functional-tests/test-extraction-data/audio/flac-extraction.flac 
b/tests/functional-tests/test-extraction-data/audio/flac-extraction.flac
new file mode 100644
index 000000000..78f2af3ad
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/audio/flac-extraction.flac differ


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]