mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
ANDROID: make memory initialization tests panic on failure
This is a patch specific to android-common-4.14 where lib/test_meminit.c and lib/test_stackinit.c are built into the kernel. Call panic() to make the test failures more visible. Bug: 144999193 Change-Id: Iaa9459f4bf63753c5ac1cf51c9691bf62b3924e9 Signed-off-by: Alexander Potapenko <glider@google.com>
This commit is contained in:
parent
62772abfd9
commit
d1ac78ab13
@ -397,11 +397,16 @@ static int __init test_meminit_init(void)
|
||||
num_tests += test_kmemcache(&failures);
|
||||
num_tests += test_rcu_persistent(&failures);
|
||||
|
||||
if (failures == 0)
|
||||
if (failures == 0) {
|
||||
pr_info("all %d tests passed!\n", num_tests);
|
||||
else
|
||||
} else {
|
||||
pr_info("failures: %d out of %d\n", failures, num_tests);
|
||||
|
||||
/*
|
||||
* Android 4.14 only: if this test is built as part of the
|
||||
* kernel, make the failure visible.
|
||||
*/
|
||||
panic("Test failed!\n");
|
||||
}
|
||||
return failures ? -EINVAL : 0;
|
||||
}
|
||||
module_init(test_meminit_init);
|
||||
|
@ -371,10 +371,16 @@ static int __init test_stackinit_init(void)
|
||||
/* STRUCTLEAK will only cover this. */
|
||||
failures += test_user();
|
||||
|
||||
if (failures == 0)
|
||||
if (failures == 0) {
|
||||
pr_info("all tests passed!\n");
|
||||
else
|
||||
} else {
|
||||
pr_err("failures: %u\n", failures);
|
||||
/*
|
||||
* Android 4.14 only: if this test is built as part of the
|
||||
* kernel, make the failure visible.
|
||||
*/
|
||||
panic("Test failed!\n");
|
||||
}
|
||||
|
||||
return failures ? -EINVAL : 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user