Commit bb5e197a authored by Pankaj Kumar's avatar Pankaj Kumar

Added testcases description

parent 3517dc6e
...@@ -31,7 +31,7 @@ int testcase1() ...@@ -31,7 +31,7 @@ int testcase1()
/* Initialize a cspace */ /* Initialize a cspace */
csp = malloc(1 * sizeof(*csp)); csp = malloc(1 * sizeof(*csp));
printf("\nTestCase : Cspace Initialization.\n")
ret = __lcd_cap_init_cspace(csp); ret = __lcd_cap_init_cspace(csp);
if (ret < 0) if (ret < 0)
printf("Cspace Initialization Failed!!\n"); printf("Cspace Initialization Failed!!\n");
...@@ -51,7 +51,8 @@ int testcase1() ...@@ -51,7 +51,8 @@ int testcase1()
} }
memset(p, 0, 4); memset(p, 0, 4);
/* Insert capability in cspace */ /* Insert capability in cspace */
printf("\nTestCase : Add Capability to Cspace.\n")
ret = __lcd_cap_insert(csp, slot_out, p, LCD_CAP_TYPE_PAGE); ret = __lcd_cap_insert(csp, slot_out, p, LCD_CAP_TYPE_PAGE);
if (ret) { if (ret) {
...@@ -66,15 +67,16 @@ int testcase1() ...@@ -66,15 +67,16 @@ int testcase1()
goto fail; goto fail;
} else { } else {
if (check->object == p) if (check->object == p)
printf("Capability Lookup Passed\n"); printf("Capability Addition & Lookup Passed\n");
else else
printf("Capability lookup failed!!!\n"); printf("Capability Addition & Lookup Failed!!!\n");
} }
/* Release cnode Lock */ /* Release cnode Lock */
__lcd_cnode_put(check); __lcd_cnode_put(check);
/* Capability deletion from cspace. /* Capability deletion from cspace.
*/ */
printf("\nTestCase : Delete Capability from Cspace.\n");
__lcd_cap_delete(csp, slot_out); __lcd_cap_delete(csp, slot_out);
/*Lookup after deleting capability. It should Fail!! /*Lookup after deleting capability. It should Fail!!
...@@ -82,6 +84,7 @@ int testcase1() ...@@ -82,6 +84,7 @@ int testcase1()
ret = __lcd_cnode_get(csp, slot_out, &check1); ret = __lcd_cnode_get(csp, slot_out, &check1);
if (ret < 0) { if (ret < 0) {
LCD_ERR("Lookup failed\n"); LCD_ERR("Lookup failed\n");
printf("Capability Deletion Passed\n");
} else { } else {
if (check1->object == p) if (check1->object == p)
printf("Screwed!!!\n"); printf("Screwed!!!\n");
...@@ -97,6 +100,7 @@ int testcase1() ...@@ -97,6 +100,7 @@ int testcase1()
* __lcd_cap_insert call. If the call fails, that means * __lcd_cap_insert call. If the call fails, that means
* cspace has been deleted successfully. * cspace has been deleted successfully.
*/ */
printf("\nTestCase : Delete Cspace.\n");
__lcd_cap_destroy_cspace(csp); __lcd_cap_destroy_cspace(csp);
/* To check id cspace has been successfully destroyed, /* To check id cspace has been successfully destroyed,
...@@ -106,7 +110,7 @@ int testcase1() ...@@ -106,7 +110,7 @@ int testcase1()
ret = __lcd_cap_insert(csp, slot_out, p, LCD_CAP_TYPE_PAGE); ret = __lcd_cap_insert(csp, slot_out, p, LCD_CAP_TYPE_PAGE);
if (ret) { if (ret) {
printf("Cspace deletion TestCase Passed!!\n"); printf("Cspace Deletion Passed!!\n");
goto fail; goto fail;
} }
fail: fail:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment