[virt-tools-list] [libosinfo] test-isodetect: Add test for osinfo_media_get_languages

Christophe Fergeau cfergeau at redhat.com
Tue Dec 11 20:09:20 UTC 2012


By dropping a .lng file similar to:
[general]
l10n-language=fr_FR;en_EN;

it's possible to specify which languages a given media is supposed
to support. test-isodetect will then check that the languages for this
media in the OsinfoDb match the expected ones.
---
 ..._professional_with_sp1_x64_dvd_u_676956.iso.lng |  2 +
 ..._professional_with_sp1_x86_dvd_u_677077.iso.lng |  2 +
 ...indows_7_enterprise_n_x64_dvd_x16-11943.iso.lng |  2 +
 ...indows_7_enterprise_n_x86_dvd_x16-11935.iso.lng |  2 +
 ..._windows_7_enterprise_x64_dvd_x15-70749.iso.lng |  2 +
 ..._windows_7_enterprise_x86_dvd_x15-70745.iso.lng |  2 +
 ...rofessional_n_with_sp1_x86_dvd_u_677328.iso.lng |  2 +
 ..._professional_with_sp1_x64_dvd_u_676939.iso.lng |  2 +
 ..._professional_with_sp1_x86_dvd_u_677056.iso.lng |  2 +
 ..._7_ultimate_n_with_sp1_x86_dvd_u_677597.iso.lng |  2 +
 ...en_windows_7_ultimate_x64_dvd_x15-65922.iso.lng |  2 +
 ...en_windows_7_ultimate_x86_dvd_x15-65921.iso.lng |  2 +
 ...onal_with_sp1_vl_build_x64_dvd_u_677808.iso.lng |  2 +
 ...onal_with_sp1_vl_build_x86_dvd_u_677759.iso.lng |  2 +
 ...ome_premium_n_with_sp1_x64_dvd_u_676833.iso.lng |  2 +
 ..._7_enterprise_with_sp1_x64_dvd_u_677671.iso.lng |  2 +
 ...ws_7_ultimate_with_sp1_x86_dvd_u_677463.iso.lng |  2 +
 .../Windows8-ConsumerPreview-32bit-English.iso.lng |  2 +
 .../Windows8-ConsumerPreview-64bit-English.iso.lng |  2 +
 ...e_windows_8_enterprise_n_x64_dvd_917975.iso.lng |  2 +
 .../win8/en-gb_windows_8_x86_dvd_915479.iso.lng    |  2 +
 ...ws_8_debug_checked_build_x64_dvd_917558.iso.lng |  2 +
 ...ws_8_debug_checked_build_x86_dvd_917560.iso.lng |  2 +
 ...rise_debug_checked_build_x64_dvd_917527.iso.lng |  2 +
 ...rise_debug_checked_build_x86_dvd_917529.iso.lng |  2 +
 ...se_n_debug_checked_build_x64_dvd_917531.iso.lng |  2 +
 ...se_n_debug_checked_build_x86_dvd_917534.iso.lng |  2 +
 ...n_windows_8_enterprise_n_x64_dvd_918052.iso.lng |  2 +
 ...n_windows_8_enterprise_n_x86_dvd_918707.iso.lng |  2 +
 .../en_windows_8_enterprise_x64_dvd_917522.iso.lng |  2 +
 .../en_windows_8_enterprise_x86_dvd_917587.iso.lng |  2 +
 ..._8_n_debug_checked_build_x64_dvd_917562.iso.lng |  2 +
 ..._8_n_debug_checked_build_x86_dvd_917564.iso.lng |  2 +
 .../win8/en_windows_8_n_x64_dvd_916091.iso.lng     |  2 +
 .../win8/en_windows_8_n_x86_dvd_916097.iso.lng     |  2 +
 .../en_windows_8_pro_n_vl_x64_dvd_918677.iso.lng   |  2 +
 .../en_windows_8_pro_n_vl_x86_dvd_918877.iso.lng   |  2 +
 .../en_windows_8_pro_vl_x64_dvd_917699.iso.lng     |  2 +
 .../en_windows_8_pro_vl_x86_dvd_917830.iso.lng     |  2 +
 .../win8/en_windows_8_x64_dvd_915440.iso.lng       |  2 +
 .../win8/en_windows_8_x86_dvd_915417.iso.lng       |  2 +
 .../win8/fr_windows_8_x86_dvd_915420.iso.lng       |  2 +
 test/test-isodetect.c                              | 68 ++++++++++++++++++++++
 43 files changed, 152 insertions(+)
 create mode 100644 test/isodata/windows/win7/cs_windows_7_professional_with_sp1_x64_dvd_u_676956.iso.lng
 create mode 100644 test/isodata/windows/win7/cs_windows_7_professional_with_sp1_x86_dvd_u_677077.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_enterprise_n_x64_dvd_x16-11943.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_enterprise_n_x86_dvd_x16-11935.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_enterprise_x64_dvd_x15-70749.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_enterprise_x86_dvd_x15-70745.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_professional_n_with_sp1_x86_dvd_u_677328.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_professional_with_sp1_x86_dvd_u_677056.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_ultimate_n_with_sp1_x86_dvd_u_677597.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_ultimate_x64_dvd_x15-65922.iso.lng
 create mode 100644 test/isodata/windows/win7/en_windows_7_ultimate_x86_dvd_x15-65921.iso.lng
 create mode 100644 test/isodata/windows/win7/fi_windows_7_professional_with_sp1_vl_build_x64_dvd_u_677808.iso.lng
 create mode 100644 test/isodata/windows/win7/fi_windows_7_professional_with_sp1_vl_build_x86_dvd_u_677759.iso.lng
 create mode 100644 test/isodata/windows/win7/fr_windows_7_home_premium_n_with_sp1_x64_dvd_u_676833.iso.lng
 create mode 100644 test/isodata/windows/win7/ru_windows_7_enterprise_with_sp1_x64_dvd_u_677671.iso.lng
 create mode 100644 test/isodata/windows/win7/ru_windows_7_ultimate_with_sp1_x86_dvd_u_677463.iso.lng
 create mode 100644 test/isodata/windows/win8/Windows8-ConsumerPreview-32bit-English.iso.lng
 create mode 100644 test/isodata/windows/win8/Windows8-ConsumerPreview-64bit-English.iso.lng
 create mode 100644 test/isodata/windows/win8/de_windows_8_enterprise_n_x64_dvd_917975.iso.lng
 create mode 100644 test/isodata/windows/win8/en-gb_windows_8_x86_dvd_915479.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_debug_checked_build_x64_dvd_917558.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_debug_checked_build_x86_dvd_917560.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_enterprise_debug_checked_build_x64_dvd_917527.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_enterprise_debug_checked_build_x86_dvd_917529.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_enterprise_n_debug_checked_build_x64_dvd_917531.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_enterprise_n_debug_checked_build_x86_dvd_917534.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_enterprise_n_x64_dvd_918052.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_enterprise_n_x86_dvd_918707.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_enterprise_x64_dvd_917522.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_enterprise_x86_dvd_917587.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_n_debug_checked_build_x64_dvd_917562.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_n_debug_checked_build_x86_dvd_917564.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_n_x64_dvd_916091.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_n_x86_dvd_916097.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_pro_n_vl_x64_dvd_918677.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_pro_n_vl_x86_dvd_918877.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_pro_vl_x64_dvd_917699.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_pro_vl_x86_dvd_917830.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_x64_dvd_915440.iso.lng
 create mode 100644 test/isodata/windows/win8/en_windows_8_x86_dvd_915417.iso.lng
 create mode 100644 test/isodata/windows/win8/fr_windows_8_x86_dvd_915420.iso.lng

diff --git a/test/isodata/windows/win7/cs_windows_7_professional_with_sp1_x64_dvd_u_676956.iso.lng b/test/isodata/windows/win7/cs_windows_7_professional_with_sp1_x64_dvd_u_676956.iso.lng
new file mode 100644
index 0000000..6051601
--- /dev/null
+++ b/test/isodata/windows/win7/cs_windows_7_professional_with_sp1_x64_dvd_u_676956.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=cs_CZ
diff --git a/test/isodata/windows/win7/cs_windows_7_professional_with_sp1_x86_dvd_u_677077.iso.lng b/test/isodata/windows/win7/cs_windows_7_professional_with_sp1_x86_dvd_u_677077.iso.lng
new file mode 100644
index 0000000..6051601
--- /dev/null
+++ b/test/isodata/windows/win7/cs_windows_7_professional_with_sp1_x86_dvd_u_677077.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=cs_CZ
diff --git a/test/isodata/windows/win7/en_windows_7_enterprise_n_x64_dvd_x16-11943.iso.lng b/test/isodata/windows/win7/en_windows_7_enterprise_n_x64_dvd_x16-11943.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_enterprise_n_x64_dvd_x16-11943.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_enterprise_n_x86_dvd_x16-11935.iso.lng b/test/isodata/windows/win7/en_windows_7_enterprise_n_x86_dvd_x16-11935.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_enterprise_n_x86_dvd_x16-11935.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_enterprise_x64_dvd_x15-70749.iso.lng b/test/isodata/windows/win7/en_windows_7_enterprise_x64_dvd_x15-70749.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_enterprise_x64_dvd_x15-70749.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_enterprise_x86_dvd_x15-70745.iso.lng b/test/isodata/windows/win7/en_windows_7_enterprise_x86_dvd_x15-70745.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_enterprise_x86_dvd_x15-70745.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_professional_n_with_sp1_x86_dvd_u_677328.iso.lng b/test/isodata/windows/win7/en_windows_7_professional_n_with_sp1_x86_dvd_u_677328.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_professional_n_with_sp1_x86_dvd_u_677328.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso.lng b/test/isodata/windows/win7/en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_professional_with_sp1_x86_dvd_u_677056.iso.lng b/test/isodata/windows/win7/en_windows_7_professional_with_sp1_x86_dvd_u_677056.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_professional_with_sp1_x86_dvd_u_677056.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_ultimate_n_with_sp1_x86_dvd_u_677597.iso.lng b/test/isodata/windows/win7/en_windows_7_ultimate_n_with_sp1_x86_dvd_u_677597.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_ultimate_n_with_sp1_x86_dvd_u_677597.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_ultimate_x64_dvd_x15-65922.iso.lng b/test/isodata/windows/win7/en_windows_7_ultimate_x64_dvd_x15-65922.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_ultimate_x64_dvd_x15-65922.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/en_windows_7_ultimate_x86_dvd_x15-65921.iso.lng b/test/isodata/windows/win7/en_windows_7_ultimate_x86_dvd_x15-65921.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win7/en_windows_7_ultimate_x86_dvd_x15-65921.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win7/fi_windows_7_professional_with_sp1_vl_build_x64_dvd_u_677808.iso.lng b/test/isodata/windows/win7/fi_windows_7_professional_with_sp1_vl_build_x64_dvd_u_677808.iso.lng
new file mode 100644
index 0000000..6d482fb
--- /dev/null
+++ b/test/isodata/windows/win7/fi_windows_7_professional_with_sp1_vl_build_x64_dvd_u_677808.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=fi_FI
diff --git a/test/isodata/windows/win7/fi_windows_7_professional_with_sp1_vl_build_x86_dvd_u_677759.iso.lng b/test/isodata/windows/win7/fi_windows_7_professional_with_sp1_vl_build_x86_dvd_u_677759.iso.lng
new file mode 100644
index 0000000..6d482fb
--- /dev/null
+++ b/test/isodata/windows/win7/fi_windows_7_professional_with_sp1_vl_build_x86_dvd_u_677759.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=fi_FI
diff --git a/test/isodata/windows/win7/fr_windows_7_home_premium_n_with_sp1_x64_dvd_u_676833.iso.lng b/test/isodata/windows/win7/fr_windows_7_home_premium_n_with_sp1_x64_dvd_u_676833.iso.lng
new file mode 100644
index 0000000..e4519a7
--- /dev/null
+++ b/test/isodata/windows/win7/fr_windows_7_home_premium_n_with_sp1_x64_dvd_u_676833.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=fr_FR
diff --git a/test/isodata/windows/win7/ru_windows_7_enterprise_with_sp1_x64_dvd_u_677671.iso.lng b/test/isodata/windows/win7/ru_windows_7_enterprise_with_sp1_x64_dvd_u_677671.iso.lng
new file mode 100644
index 0000000..08940d5
--- /dev/null
+++ b/test/isodata/windows/win7/ru_windows_7_enterprise_with_sp1_x64_dvd_u_677671.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=ru_RU
diff --git a/test/isodata/windows/win7/ru_windows_7_ultimate_with_sp1_x86_dvd_u_677463.iso.lng b/test/isodata/windows/win7/ru_windows_7_ultimate_with_sp1_x86_dvd_u_677463.iso.lng
new file mode 100644
index 0000000..08940d5
--- /dev/null
+++ b/test/isodata/windows/win7/ru_windows_7_ultimate_with_sp1_x86_dvd_u_677463.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=ru_RU
diff --git a/test/isodata/windows/win8/Windows8-ConsumerPreview-32bit-English.iso.lng b/test/isodata/windows/win8/Windows8-ConsumerPreview-32bit-English.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/Windows8-ConsumerPreview-32bit-English.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/Windows8-ConsumerPreview-64bit-English.iso.lng b/test/isodata/windows/win8/Windows8-ConsumerPreview-64bit-English.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/Windows8-ConsumerPreview-64bit-English.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/de_windows_8_enterprise_n_x64_dvd_917975.iso.lng b/test/isodata/windows/win8/de_windows_8_enterprise_n_x64_dvd_917975.iso.lng
new file mode 100644
index 0000000..ac695c0
--- /dev/null
+++ b/test/isodata/windows/win8/de_windows_8_enterprise_n_x64_dvd_917975.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=de_DE
diff --git a/test/isodata/windows/win8/en-gb_windows_8_x86_dvd_915479.iso.lng b/test/isodata/windows/win8/en-gb_windows_8_x86_dvd_915479.iso.lng
new file mode 100644
index 0000000..4964c4d
--- /dev/null
+++ b/test/isodata/windows/win8/en-gb_windows_8_x86_dvd_915479.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_GB
diff --git a/test/isodata/windows/win8/en_windows_8_debug_checked_build_x64_dvd_917558.iso.lng b/test/isodata/windows/win8/en_windows_8_debug_checked_build_x64_dvd_917558.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_debug_checked_build_x64_dvd_917558.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_debug_checked_build_x86_dvd_917560.iso.lng b/test/isodata/windows/win8/en_windows_8_debug_checked_build_x86_dvd_917560.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_debug_checked_build_x86_dvd_917560.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_enterprise_debug_checked_build_x64_dvd_917527.iso.lng b/test/isodata/windows/win8/en_windows_8_enterprise_debug_checked_build_x64_dvd_917527.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_enterprise_debug_checked_build_x64_dvd_917527.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_enterprise_debug_checked_build_x86_dvd_917529.iso.lng b/test/isodata/windows/win8/en_windows_8_enterprise_debug_checked_build_x86_dvd_917529.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_enterprise_debug_checked_build_x86_dvd_917529.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_enterprise_n_debug_checked_build_x64_dvd_917531.iso.lng b/test/isodata/windows/win8/en_windows_8_enterprise_n_debug_checked_build_x64_dvd_917531.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_enterprise_n_debug_checked_build_x64_dvd_917531.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_enterprise_n_debug_checked_build_x86_dvd_917534.iso.lng b/test/isodata/windows/win8/en_windows_8_enterprise_n_debug_checked_build_x86_dvd_917534.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_enterprise_n_debug_checked_build_x86_dvd_917534.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_enterprise_n_x64_dvd_918052.iso.lng b/test/isodata/windows/win8/en_windows_8_enterprise_n_x64_dvd_918052.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_enterprise_n_x64_dvd_918052.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_enterprise_n_x86_dvd_918707.iso.lng b/test/isodata/windows/win8/en_windows_8_enterprise_n_x86_dvd_918707.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_enterprise_n_x86_dvd_918707.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_enterprise_x64_dvd_917522.iso.lng b/test/isodata/windows/win8/en_windows_8_enterprise_x64_dvd_917522.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_enterprise_x64_dvd_917522.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_enterprise_x86_dvd_917587.iso.lng b/test/isodata/windows/win8/en_windows_8_enterprise_x86_dvd_917587.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_enterprise_x86_dvd_917587.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_n_debug_checked_build_x64_dvd_917562.iso.lng b/test/isodata/windows/win8/en_windows_8_n_debug_checked_build_x64_dvd_917562.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_n_debug_checked_build_x64_dvd_917562.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_n_debug_checked_build_x86_dvd_917564.iso.lng b/test/isodata/windows/win8/en_windows_8_n_debug_checked_build_x86_dvd_917564.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_n_debug_checked_build_x86_dvd_917564.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_n_x64_dvd_916091.iso.lng b/test/isodata/windows/win8/en_windows_8_n_x64_dvd_916091.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_n_x64_dvd_916091.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_n_x86_dvd_916097.iso.lng b/test/isodata/windows/win8/en_windows_8_n_x86_dvd_916097.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_n_x86_dvd_916097.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_pro_n_vl_x64_dvd_918677.iso.lng b/test/isodata/windows/win8/en_windows_8_pro_n_vl_x64_dvd_918677.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_pro_n_vl_x64_dvd_918677.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_pro_n_vl_x86_dvd_918877.iso.lng b/test/isodata/windows/win8/en_windows_8_pro_n_vl_x86_dvd_918877.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_pro_n_vl_x86_dvd_918877.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_pro_vl_x64_dvd_917699.iso.lng b/test/isodata/windows/win8/en_windows_8_pro_vl_x64_dvd_917699.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_pro_vl_x64_dvd_917699.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_pro_vl_x86_dvd_917830.iso.lng b/test/isodata/windows/win8/en_windows_8_pro_vl_x86_dvd_917830.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_pro_vl_x86_dvd_917830.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_x64_dvd_915440.iso.lng b/test/isodata/windows/win8/en_windows_8_x64_dvd_915440.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_x64_dvd_915440.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/en_windows_8_x86_dvd_915417.iso.lng b/test/isodata/windows/win8/en_windows_8_x86_dvd_915417.iso.lng
new file mode 100644
index 0000000..e46008a
--- /dev/null
+++ b/test/isodata/windows/win8/en_windows_8_x86_dvd_915417.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=en_US
diff --git a/test/isodata/windows/win8/fr_windows_8_x86_dvd_915420.iso.lng b/test/isodata/windows/win8/fr_windows_8_x86_dvd_915420.iso.lng
new file mode 100644
index 0000000..e4519a7
--- /dev/null
+++ b/test/isodata/windows/win8/fr_windows_8_x86_dvd_915420.iso.lng
@@ -0,0 +1,2 @@
+[general]
+l10n-language=fr_FR
diff --git a/test/test-isodetect.c b/test/test-isodetect.c
index f627300..a3460ff 100644
--- a/test/test-isodetect.c
+++ b/test/test-isodetect.c
@@ -29,6 +29,7 @@ struct ISOInfo {
     gchar *shortid;
     gchar *filename;
     OsinfoMedia *media;
+    GHashTable *langs;
 };
 
 static void free_iso(struct ISOInfo *info)
@@ -40,9 +41,50 @@ static void free_iso(struct ISOInfo *info)
     g_free(info->shortid);
     if (info->media)
         g_object_unref(info->media);
+    if (info->langs)
+        g_hash_table_unref(info->langs);
     g_free(info);
 }
 
+static gboolean load_langs(GFile *file, struct ISOInfo *info, GError **error)
+{
+    char *path;
+    GKeyFile *lang_file;
+    GStrv langs;
+    GStrv it;
+
+    path = g_file_get_path(file);
+    if (path == NULL)
+        return FALSE;
+    if (!g_str_has_suffix(path, ".txt")) {
+        g_free(path);
+        return FALSE;
+    }
+    strcpy(&path[strlen(path) - sizeof(".txt") + 1], ".lng");
+    lang_file = g_key_file_new();
+    if (!g_key_file_load_from_file(lang_file, path, G_KEY_FILE_NONE, NULL)) {
+        g_key_file_free(lang_file);
+        g_free(path);
+        return FALSE;
+    }
+    langs = g_key_file_get_string_list(lang_file, "general", "l10n-language",
+                                       NULL, NULL);
+    if (langs == NULL) {
+        g_key_file_free(lang_file);
+        g_free(path);
+        return FALSE;
+    }
+
+    for (it = langs; (it != NULL) && (*it != NULL); it++) {
+        g_hash_table_add(info->langs, g_strdup(*it));
+    }
+
+    g_strfreev(langs);
+    g_key_file_free(lang_file);
+    g_free(path);
+
+    return TRUE;
+}
 
 static struct ISOInfo *load_iso(GFile *file, const gchar *shortid, const gchar *name, GError **error)
 {
@@ -60,6 +102,7 @@ static struct ISOInfo *load_iso(GFile *file, const gchar *shortid, const gchar *
 
     info->filename = g_strdup(name);
     info->shortid = g_strdup(shortid);
+    info->langs = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
     if (strstr(name, "amd64") ||
              strstr(name, "x64") ||
              strstr(name, "x86_64") ||
@@ -111,6 +154,8 @@ static struct ISOInfo *load_iso(GFile *file, const gchar *shortid, const gchar *
     if (*error)
         goto error;
 
+    load_langs(file, info, error);
+
  cleanup:
     if (fis)
         g_object_unref(fis);
@@ -231,6 +276,28 @@ static GList *load_isos(const gchar *vendor, GError **error)
 }
 
 
+static void test_langs(struct ISOInfo *info)
+{
+    GList *langs;
+    GList *it;
+
+    /* exit early if there was no associated .lng file */
+    if (g_hash_table_size(info->langs) == 0)
+        return;
+
+    langs = osinfo_media_get_languages(info->media);
+
+    for (it = langs; it != NULL; it = it->next) {
+        fail_unless(g_hash_table_contains(info->langs, it->data),
+                    "%s not a known language for ISO %s",
+                    it->data, info->filename);
+        g_hash_table_remove(info->langs, it->data);
+    }
+    fail_unless(g_hash_table_size(info->langs) == 0,
+                "some languages were not identified on ISO %s",
+                info->filename);
+}
+
 static void test_one(const gchar *vendor)
 {
     OsinfoLoader *loader = osinfo_loader_new();
@@ -264,6 +331,7 @@ static void test_one(const gchar *vendor)
                     "ISO %s matched OS %s instead of expected %s",
                     info->filename, shortid, info->shortid);
         g_object_unref(G_OBJECT(os));
+        test_langs(info);
 
         tmp = tmp->next;
     }
-- 
1.8.0.1




More information about the virt-tools-list mailing list