summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2013-07-19 09:55:30 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-07-30 16:12:03 -0500
commit5168d4f925a1bcebf43547a44dd1108977b1c3b7 (patch)
tree5f8122bf2b9a016bb72e628339a8ddbfdf375110 /src/usr/targeting
parent80ff78be2e9d496e31ce39c6a20eb95eee54a91c (diff)
downloadtalos-hostboot-5168d4f925a1bcebf43547a44dd1108977b1c3b7.tar.gz
talos-hostboot-5168d4f925a1bcebf43547a44dd1108977b1c3b7.zip
SW214677 : FW810: Unknown type is coming for tod clk unit in target dump
Change-Id: I19690e0d2cc974501cf24ff6393a9e386dec51ae Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5495 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: Andrea Y. Ma <ayma@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting')
-rw-r--r--src/usr/targeting/common/entitypath.C4
-rw-r--r--src/usr/targeting/common/test/testcommontargeting.H14
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml6
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/xmltohb.pl79
4 files changed, 99 insertions, 4 deletions
diff --git a/src/usr/targeting/common/entitypath.C b/src/usr/targeting/common/entitypath.C
index 06a190d9b..5e453aebb 100644
--- a/src/usr/targeting/common/entitypath.C
+++ b/src/usr/targeting/common/entitypath.C
@@ -344,6 +344,10 @@ const char* EntityPath::pathElementTypeAsString(
return "FSP";
case TYPE_PNOR:
return "PNOR";
+ case TYPE_OSC:
+ return "OSC";
+ case TYPE_TODCLK:
+ return "TodClock";
case TYPE_NA:
return "NA";
// case TYPE_FSI_LINK:
diff --git a/src/usr/targeting/common/test/testcommontargeting.H b/src/usr/targeting/common/test/testcommontargeting.H
index e482dc0e8..1be1a4ba3 100644
--- a/src/usr/targeting/common/test/testcommontargeting.H
+++ b/src/usr/targeting/common/test/testcommontargeting.H
@@ -57,9 +57,17 @@ extern TARG_TD_t g_trac_targeting;
class CommonTargetingTestSuite: public CxxTest::TestSuite
{
public:
-
- /**
- * @brief Test the TargetService class (except debug cases)
+ /**
+ * @brief Test a portion of the debug code wich
+ * prints out the entity path types
+ */
+ void testEntityPathElementTypeAsString()
+ {
+ // test_ep.H is generated by xmltohb.pl
+ #include <test_ep.H>
+ }
+ /**
+ * @brief Test the TargetService class (except debug cases)
*/
void testTargetServiceClass()
{
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index 155c16341..ad4a0b240 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -179,9 +179,13 @@
<value>25</value>
</enumerator>
<enumerator>
- <name>LAST_IN_RANGE</name>
+ <name>TEST_FAIL</name>
<value>26</value>
</enumerator>
+ <enumerator>
+ <name>LAST_IN_RANGE</name>
+ <value>27</value>
+ </enumerator>
<default>NA</default>
</enumerationType>
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl
index 35dfaa235..421af5e4e 100755
--- a/src/usr/targeting/common/xmltohb/xmltohb.pl
+++ b/src/usr/targeting/common/xmltohb/xmltohb.pl
@@ -184,6 +184,7 @@ if( !($cfgSrcOutputDir =~ "none") )
writeStringImplementationFileHeader($stringImplementationFile);
writeStringImplementationFileStrings($attributes,$stringImplementationFile);
writeStringImplementationFileFooter($stringImplementationFile);
+ writeTestEntityPath($attributes);
close $stringImplementationFile;
open(STRUCTS_HEADER_FILE,">$cfgSrcOutputDir"."attributestructs.H")
@@ -958,6 +959,84 @@ VERBATIM
}
################################################################################
+# Writes test for toString entity path function
+################################################################################
+
+sub writeTestEntityPath {
+ my($attributes) = @_;
+
+ open EP_TEST_FILE, ">", "$cfgSrcOutputDir"."test_ep.H" or die $!;
+
+ print EP_TEST_FILE "#include <attributeenums.H>\n";
+ print EP_TEST_FILE "EntityPath l_path;\n";
+ print EP_TEST_FILE "const char * name = NULL;\n";
+ print(EP_TEST_FILE "const char * test_string = \"Unknown path" .
+ " type\";\n");
+ print EP_TEST_FILE "size_t size = strlen( test_string );\n";
+
+ foreach my $attribute (@{$attributes->{attribute}})
+ {
+ if(exists $attribute->{simpleType})
+ {
+ my $simpleType = $attribute->{simpleType};
+ if(exists $simpleType->{enumeration})
+ {
+ my $enumeration = $simpleType->{enumeration};
+
+ my $enumerationType = getEnumerationType($attributes,
+ $enumeration->{id});
+
+ foreach my $enumerator (@{$enumerationType->{enumerator}})
+ {
+ if( $attribute->{id} eq "TYPE" )
+ {
+ print(EP_TEST_FILE "name = " .
+ "l_path.pathElementTypeAsString( " .
+ "TYPE_$enumerator->{name} );\n");
+ print EP_TEST_FILE "size = strlen( name );\n";
+
+ if( $enumerator->{name} eq "LAST_IN_RANGE" )
+ {
+ print(EP_TEST_FILE "if( memcmp( name, " .
+ "test_string, size ))\n{\n");
+
+ print(EP_TEST_FILE "TS_FAIL(\"type " .
+ "attribute TYPE_$enumerator->{name}" .
+ " - did not return expected error " .
+ "message. - update entitypath.C\");\n}\n");
+
+ }
+ elsif( $enumerator->{name} eq "TEST_FAIL" )
+ {
+ #TEST_FAIL is not defined in the function
+ #pathElementTypeAsString - validate error string
+ print(EP_TEST_FILE "if( memcmp( name, " .
+ "test_string, size ))\n{\n");
+
+ print(EP_TEST_FILE "TS_FAIL(\"type " .
+ "attribute TYPE_$enumerator->{name}" .
+ " - did not return expected error " .
+ "message. - update entitypath.C\");\n}\n");
+ }
+ else
+ {
+ print(EP_TEST_FILE "if( !memcmp( name, " .
+ "test_string, size ))\n{\n");
+
+ print(EP_TEST_FILE "TS_FAIL(\"undefined TYPE " .
+ "attribute TYPE_$enumerator->{name}" .
+ " - update entitypath.C\");\n}\n");
+ }
+ }
+ }
+ }
+ }
+ }
+close EP_TEST_FILE;
+}
+
+
+################################################################################
# Writes string implementation
################################################################################
OpenPOWER on IntegriCloud