From 6a8e78667bd096e41a909273e4359bc62e444992 Mon Sep 17 00:00:00 2001 From: Missy Connell Date: Mon, 3 Dec 2012 12:13:25 -0600 Subject: Dump Collect code RTC:46996 Change-Id: I18863c91dcde353df6201c3c13e101626f24206b Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3131 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell Reviewed-by: A. Patrick Williams III --- src/usr/runtime/test/hdatservicetest.H | 151 +++++++++++++++++---------------- 1 file changed, 77 insertions(+), 74 deletions(-) (limited to 'src/usr/runtime/test') diff --git a/src/usr/runtime/test/hdatservicetest.H b/src/usr/runtime/test/hdatservicetest.H index 8d5dd72de..3b59651f0 100644 --- a/src/usr/runtime/test/hdatservicetest.H +++ b/src/usr/runtime/test/hdatservicetest.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -200,103 +200,106 @@ class HdatServiceTest: public CxxTest::TestSuite 0, dump_addr, dump_size ); - if( errhdl && (payload_kind == TARGETING::PAYLOAD_KIND_PHYP) ) + + if( errhdl + && ((payload_kind == TARGETING::PAYLOAD_KIND_PHYP) + || (payload_kind == TARGETING::PAYLOAD_KIND_NONE))) { - if( errhdl ) - { - TS_FAIL("testHdat> Error trying to locate MS_DUMP_SRC_TBL"); - errlCommit(errhdl,RUNTIME_COMP_ID); - } - else if( dump_addr == 0 ) - { - TS_FAIL("testHdat> NULL returned for get_host_data_section(MS_DUMP_SRC_TBL)"); - } - else if( dump_size < 16 ) //1 entry is 16 bytes - { - TRACFCOMP( g_trac_runtime, "testHdat> dump_size=%d", dump_size ); - TS_FAIL("testHdat> Size of MS_DUMP_SRC_TBL data too small"); - } + TS_FAIL("testHdat> Error trying to locate MS_DUMP_SRC_TBL"); + errlCommit(errhdl,RUNTIME_COMP_ID); } - else + else if( !errhdl + && (payload_kind != TARGETING::PAYLOAD_KIND_PHYP) + && (payload_kind != TARGETING::PAYLOAD_KIND_NONE) ) { - if( !errhdl ) - { - TS_FAIL("testHdat> Did not get expected error trying to locate MS_DUMP_SRC_TBL for non-PHYP Payload"); - } - else - { - delete errhdl; - } + TS_FAIL("testHdat> Did not get expected error trying to locate MS_DUMP_SRC_TBL for non-PHYP/Standalone Payload"); + } + else if( ((dump_addr == 0) || (dump_size < 16)) + && (payload_kind != TARGETING::PAYLOAD_KIND_PHYP) + && (payload_kind != TARGETING::PAYLOAD_KIND_NONE) ) + { + TS_FAIL("testHdat> NULL or zero size returned for get_host_data_section(MS_DUMP_SRC_TBL)"); + } + else if( (dump_size <16) + || (dump_size == RUNTIME::DATA_SIZE_UNKNOWN) ) + { + TS_FAIL("testHdat> Size of MS_DUMP_SRC_TBL is unexpected"); + } + if( errhdl ) + { + delete errhdl; } + errhdl = RUNTIME::get_host_data_section( RUNTIME::MS_DUMP_DST_TBL, 0, dump_addr, dump_size ); - if( errhdl && (payload_kind == TARGETING::PAYLOAD_KIND_PHYP) ) + if( errhdl + && ((payload_kind == TARGETING::PAYLOAD_KIND_PHYP) + || (payload_kind == TARGETING::PAYLOAD_KIND_NONE)) ) { - if( errhdl ) - { - TS_FAIL("testHdat> Error trying to locate MS_DUMP_DST_TBL"); - errlCommit(errhdl,RUNTIME_COMP_ID); - } - else if( dump_addr == 0 ) - { - TS_FAIL("testHdat> NULL returned for get_host_data_section(MS_DUMP_DST_TBL)"); - } - else if( dump_size < 16 ) //1 entry is 16 bytes - { - TRACFCOMP( g_trac_runtime, "testHdat> dump_size=%d", dump_size ); - TS_FAIL("testHdat> Size of MS_DUMP_DST_TBL data too small"); - } + TS_FAIL("testHdat> Error trying to locate MS_DUMP_DST_TBL"); + errlCommit(errhdl,RUNTIME_COMP_ID); } - else + else if( !errhdl + && (payload_kind != TARGETING::PAYLOAD_KIND_PHYP) + && (payload_kind != TARGETING::PAYLOAD_KIND_NONE) ) { - if( !errhdl ) - { - TS_FAIL("testHdat> Did not get expected error trying to locate MS_DUMP_DST_TBL for non-PHYP Payload"); - } - else - { - delete errhdl; - } + TS_FAIL("testHdat> Did not get expected error trying to locate MS_DUMP_DST_TBL for non-PHYP/Standalone Payload"); } + else if( ((dump_addr == 0) || (dump_size < 16)) + && (payload_kind != TARGETING::PAYLOAD_KIND_PHYP) + && (payload_kind != TARGETING::PAYLOAD_KIND_NONE) ) + { + TS_FAIL("testHdat> NULL or zero size returned for get_host_data_section(MS_DUMP_DST_TBL)"); + } + else if( (dump_size <16) + || (dump_size == RUNTIME::DATA_SIZE_UNKNOWN) ) + { + TS_FAIL("testHdat> Size of MS_DUMP_DST_TBL is unexpected"); + } + if( errhdl ) + { + delete errhdl; + } + errhdl = RUNTIME::get_host_data_section( RUNTIME::MS_DUMP_RESULTS_TBL, 0, dump_addr, dump_size ); - if( errhdl && (payload_kind == TARGETING::PAYLOAD_KIND_PHYP) ) + + if( errhdl + && ((payload_kind == TARGETING::PAYLOAD_KIND_PHYP) + || (payload_kind == TARGETING::PAYLOAD_KIND_NONE)) ) { - if( errhdl ) - { - TS_FAIL("testHdat> Error trying to locate MS_DUMP_RESULTS_TBL"); - errlCommit(errhdl,RUNTIME_COMP_ID); - } - else if( dump_addr == 0 ) - { - TS_FAIL("testHdat> NULL returned for get_host_data_section(MS_DUMP_RESULTS_TBL)"); - } - else if( dump_size < 16 ) //1 entry is 16 bytes - { - TRACFCOMP( g_trac_runtime, "testHdat> dump_size=%d", dump_size ); - TS_FAIL("testHdat> Size of MS_DUMP_RESULTS_TBL data too small"); - } + TS_FAIL("testHdat> Error trying to locate MS_DUMP_SRC_TBL"); + errlCommit(errhdl,RUNTIME_COMP_ID); } - else + else if( !errhdl + && (payload_kind != TARGETING::PAYLOAD_KIND_PHYP) + && (payload_kind != TARGETING::PAYLOAD_KIND_NONE) ) { - if( !errhdl ) - { - TS_FAIL("testHdat> Did not get expected error trying to locate MS_DUMP_RESULTS_TBL for non-PHYP Payload"); - } - else - { - delete errhdl; - } + TS_FAIL("testHdat> Did not get expected error trying to locate MS_DUMP_RESULTS_TBL for non-PHYP/Standalone Payload"); + } + else if( ((dump_addr == 0) || (dump_size < 16)) + && (payload_kind != TARGETING::PAYLOAD_KIND_PHYP) + && (payload_kind != TARGETING::PAYLOAD_KIND_NONE) ) + { + TS_FAIL("testHdat> NULL or zero size returned for get_host_data_section(MS_DUMP_RESULTS_TBL)"); + } + else if( (dump_size <16) + || (dump_size == RUNTIME::DATA_SIZE_UNKNOWN) ) + { + TS_FAIL("testHdat> Size of MS_DUMP_RESULTS_TBL is unexpected"); + } + if( errhdl ) + { + delete errhdl; } - TRACFCOMP( g_trac_runtime, "testHdat> finish" ); } -- cgit v1.2.1