aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2017-07-09 22:58:10 -0500
committerLeandro Pereira <leandro@hardinfo.org>2017-07-12 19:38:41 -0700
commita2477dcfcb6e07f6a2e78ea4a7d0cfa3ca99beae (patch)
tree24b842b779bbd9f7118e3c1eff413a96eef16fae
parent9cb099818be4edc0cb2d28ca1e93bb27e8b36c18 (diff)
s390: add test
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r--modules/devices/s390/processor.c3
-rw-r--r--test/data/s390_hurcules_cpuinfo5
-rw-r--r--test/test.sh3
3 files changed, 8 insertions, 3 deletions
diff --git a/modules/devices/s390/processor.c b/modules/devices/s390/processor.c
index 0e8cafb6..8d9cbe05 100644
--- a/modules/devices/s390/processor.c
+++ b/modules/devices/s390/processor.c
@@ -57,14 +57,13 @@ processor_scan(void)
}
g_strfreev(tmp);
}
+ fclose(cpuinfo);
processor->cpu_mhz = 0.0f;
processor->model_name = g_strconcat("S390 ", processor->vendor_id, NULL);
g_free(processor->vendor_id);
- fclose(cpuinfo);
-
return g_slist_append(NULL, processor);
}
diff --git a/test/data/s390_hurcules_cpuinfo b/test/data/s390_hurcules_cpuinfo
new file mode 100644
index 00000000..5ac5b5fc
--- /dev/null
+++ b/test/data/s390_hurcules_cpuinfo
@@ -0,0 +1,5 @@
+vendor_id : IBM/S390
+# processors : 2
+bogomips per cpu: 411.23
+processor 0: version = FF, identification = 111000, machine = 7060
+processor 1: version = FF, identification = 111111, machine = 7060
diff --git a/test/test.sh b/test/test.sh
index 9462ad63..51b5360b 100644
--- a/test/test.sh
+++ b/test/test.sh
@@ -22,4 +22,5 @@ do_test() {
#do_test m68k data/m68k_sun3_cpuinfo
#do_test sh data/sh_dreamcast_cpuinfo
#do_test sh data/sh_sh3_cpuinfo
-do_test sh data/sh_sh64_cpuinfo
+#do_test sh data/sh_sh64_cpuinfo
+do_test s390 data/s390_hurcules_cpuinfo