Skip to content

Commit 2ea66d6

Browse files
authored
Fix architecture specific /proc test (#74)
`/proc/cpuinfo` is very architecture specific and has no reliable strings in it. Use `/proc/meminfo` instead. Thanks to John Paul Adrian Glaubitz! Fixes #73
1 parent bb29be2 commit 2ea66d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test-umockdev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,9 +2013,9 @@ t_testbed_proc(UMockdevTestbedFixture * fixture, gconstpointer data)
20132013
gboolean found;
20142014

20152015
/* should be the real file */
2016-
g_assert(g_file_get_contents("/proc/cpuinfo", &contents, NULL, NULL));
2017-
if (!strstr(contents, "processor")) {
2018-
g_printerr("'processor' not found in /proc/cpuinfo: ----------\n%s\n----------", contents);
2016+
g_assert(g_file_get_contents("/proc/meminfo", &contents, NULL, NULL));
2017+
if (!strstr(contents, "MemTotal:")) {
2018+
g_printerr("'MemTotal:' not found in /proc/meminfo: ----------\n%s\n----------", contents);
20192019
g_test_fail();
20202020
}
20212021
g_free(contents);

0 commit comments

Comments
 (0)