summaryrefslogtreecommitdiffstats
path: root/src/usr/testcore
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/testcore')
-rw-r--r--src/usr/testcore/kernel/taskwaittest.H6
-rw-r--r--src/usr/testcore/kernel/vmmbasetest.H35
2 files changed, 35 insertions, 6 deletions
diff --git a/src/usr/testcore/kernel/taskwaittest.H b/src/usr/testcore/kernel/taskwaittest.H
index 2d4a39772..a929dcd9a 100644
--- a/src/usr/testcore/kernel/taskwaittest.H
+++ b/src/usr/testcore/kernel/taskwaittest.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -168,7 +170,7 @@ class TaskWaitTest : public CxxTest::TestSuite
static void* TaskThatCrashes(void* unused)
{
- printk("Test case: Expect to see uncaught exception! ");
+ printk("TaskThatCrashes: Expect to see uncaught exception! ");
*(int64_t*)(0) = 0xDEADC0DE;
return NULL;
}
diff --git a/src/usr/testcore/kernel/vmmbasetest.H b/src/usr/testcore/kernel/vmmbasetest.H
index 5a3c0d0f8..c4d42116e 100644
--- a/src/usr/testcore/kernel/vmmbasetest.H
+++ b/src/usr/testcore/kernel/vmmbasetest.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -44,7 +46,7 @@ class VmmBaseTest : public CxxTest::TestSuite
{
int status;
- printk("Test case: Expect to see uncaught exception! ");
+ printk("testNullAccess1: Expect to see uncaught exception! ");
tid_t child = task_create(readFromNULL, NULL);
if ((child != task_wait_tid(child, &status, NULL)) ||
@@ -53,7 +55,7 @@ class VmmBaseTest : public CxxTest::TestSuite
TS_FAIL("Write to NULL not caught.");
}
- printk("Test case: Expect to see uncaught exception! ");
+ printk("testNullAccess2: Expect to see uncaught exception! ");
child = task_create(writeToNULL, NULL);
if ((child != task_wait_tid(child, &status, NULL)) ||
(status != TASK_STATUS_CRASHED))
@@ -66,7 +68,7 @@ class VmmBaseTest : public CxxTest::TestSuite
{
int status;
- printk("Test case: Expect to see uncaught exception! ");
+ printk("testWriteToKernelCode: Expect to see uncaught exception! ");
tid_t child = task_create(writeToKernelCode, NULL);
if ((child != task_wait_tid(child, &status, NULL)) ||
(status != TASK_STATUS_CRASHED))
@@ -134,6 +136,21 @@ class VmmBaseTest : public CxxTest::TestSuite
}
}
+ void testHugeMalloc()
+ {
+ int status;
+
+ printk("testHugeMalloc: Expect to see uncaught exception! ");isync();
+
+ tid_t child = task_create(bigMalloc, NULL);
+
+ if ((child != task_wait_tid(child, &status, NULL)) ||
+ (status != TASK_STATUS_CRASHED))
+ {
+ TS_FAIL("testHugeMalloc> Giant malloc didn't crash.");
+ }
+ }
+
private:
static void* readFromNULL(void* unused)
@@ -180,6 +197,16 @@ class VmmBaseTest : public CxxTest::TestSuite
return NULL;
}
+ static void* bigMalloc(void* unused)
+ {
+ uint8_t* ptr = (uint8_t*)malloc(VMM_MEMORY_SIZE);
+ for( size_t x=0; x<(VMM_MEMORY_SIZE); x+=MEGABYTE )
+ {
+ ptr[x] = x;
+ }
+ return NULL;
+ }
+
};
msg_q_t VmmBaseTest::iv_mq = msg_q_create();
OpenPOWER on IntegriCloud