-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test logic for shared array (#1160)
* Fix shared array test * Remove use of deprecated functions in test suites and frameworks
- Loading branch information
1 parent
2b5da60
commit d622a26
Showing
7 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,33 +109,33 @@ def tearDown(self): | |
|
||
############################################################################ | ||
# Test read access of the sstsimulator configuration file | ||
# Note: We can only test the sstsimulator_conf_get_value_str(); as we have | ||
# No generic entries for _int, _float, _bool | ||
# Note: We can only test the sstsimulator_conf_get_value() with type=str; | ||
# as we have no generic entries for _int, _float, _bool | ||
############################################################################ | ||
|
||
def test_support_functions_get_info_from_sstsimulator_conf_success(self): | ||
# This should pass as we give valid data | ||
log_forced("NOTE: This Test Has an Expected Pass and should show as 'PASS'") | ||
sourcedir = sstsimulator_conf_get_value_str("SSTCore", "sourcedir") | ||
sourcedir = sstsimulator_conf_get_value(section="SSTCore", key="sourcedir", type=str) | ||
log_forced("SSTCore SourceDir = {0}; Type = {1}".format(sourcedir, type(sourcedir))) | ||
self.assertIsInstance(sourcedir, str) | ||
|
||
def test_support_functions_get_info_from_sstsimulator_conf_invalid_section_exception_success(self): | ||
# This should pass as we detect an expected exception due to invalid section | ||
log_forced("NOTE: This Test Has an Expected Pass (BUT GENERATES A WARNING) and should show as 'PASS'") | ||
with self.assertRaises(SSTTestCaseException): | ||
sstsimulator_conf_get_value_str("invalid_section", "invalid_key") | ||
sstsimulator_conf_get_value(section="invalid_section", key="invalid_key", type=str) | ||
|
||
@unittest.expectedFailure | ||
def test_support_functions_get_info_from_sstsimulator_conf_invalid_key_exception_error(self): | ||
# This should give an error as we detect an exception due to invalid key | ||
log_forced("NOTE: This Test Has an Expected ERROR (BUT GENERATES A WARNING) and should show as 'EXPECTED FAILURE'") | ||
sstsimulator_conf_get_value_str("SSTCore", "invalid_key") | ||
sstsimulator_conf_get_value(section="SSTCore", key="invalid_key", type=str) | ||
|
||
def test_support_functions_get_info_from_sstsimulator_conf_invalid_key_rtn_default_success_with_warning(self): | ||
# This should pass by failing to find a valid key and returning a default, but should log a warning | ||
log_forced("NOTE: This Test Has an Expected Pass (BUT GENERATES A WARNING) and should show as 'PASS'") | ||
sourcedir = sstsimulator_conf_get_value_str("SSTCore", "invalid_key", "kilroy_was_here") | ||
sourcedir = sstsimulator_conf_get_value(section="SSTCore", key="invalid_key", type=str, default="kilroy_was_here") | ||
log_forced("SSTCore SourceDir = {0}".format(sourcedir)) | ||
self.assertEqual(str, type(sourcedir)) | ||
self.assertEqual("kilroy_was_here", sourcedir) | ||
|
@@ -197,15 +197,15 @@ def test_support_functions_get_all_key_vaules_from_section_from_sstsimulator_con | |
def test_support_functions_get_info_from_sst_config_h_valid_key_rtn_int_success(self): | ||
# This should pass as we give/get valid data | ||
log_forced("NOTE: This Test Has an Expected Pass and should show as 'PASS'") | ||
test_define = sst_config_include_file_get_value_int("HAVE_CLOSEDIR", 123) | ||
test_define = sst_config_include_file_get_value(define="HAVE_CLOSEDIR", type=int, default=123) | ||
log_forced("#define HAVE_CLOSEDIR={0}; type={1}".format(test_define, type(test_define))) | ||
self.assertEqual(1, test_define) | ||
self.assertEqual(int, type(test_define)) | ||
|
||
def test_support_functions_get_info_from_sst_config_h_valid_key_rtn_str_success(self): | ||
# This should pass as we give/get valid data | ||
log_forced("NOTE: This Test Has an Expected Pass and should show as 'PASS'") | ||
test_define = sst_config_include_file_get_value_str("PACKAGE_BUGREPORT", "THIS_IS_DEFAULT_DATA") | ||
test_define = sst_config_include_file_get_value(define="PACKAGE_BUGREPORT", type=str, default="THIS_IS_DEFAULT_DATA") | ||
log_forced("#define PACKAGE_BUGREPORT={0}; type={1}".format(test_define, type(test_define))) | ||
self.assertEqual("[email protected]", test_define) | ||
self.assertEqual(str, type(test_define)) | ||
|
@@ -214,7 +214,7 @@ def test_support_functions_get_info_from_sst_config_h_invalid_key_rtn_default_st | |
# This should pass as we give valid data | ||
log_forced("NOTE: This Test Has an Expected Pass (BUT GENERATES A WARNING) and should show as 'PASS'") | ||
# This should pass by returning a default, but should log a warning | ||
test_define = sst_config_include_file_get_value_str("PACKAGE_BUGREPORT_KEYINVALID", "THIS_IS_DEFAULT_DATA") | ||
test_define = sst_config_include_file_get_value(define="PACKAGE_BUGREPORT_KEYINVALID", type=str, default="THIS_IS_DEFAULT_DATA") | ||
log_forced("#define PACKAGE_BUGREPORT_KEYINVALID={0}; type={1}".format(test_define, type(test_define))) | ||
self.assertEqual("THIS_IS_DEFAULT_DATA", test_define) | ||
self.assertEqual(str, type(test_define)) | ||
|
@@ -223,7 +223,7 @@ def test_support_functions_get_info_from_sst_config_h_invalid_key_exception_succ | |
# This should pass as we detect an expected exception | ||
log_forced("NOTE: This Test Has an Expected Pass (BUT GENERATES A WARNING) and should show as 'PASS'") | ||
with self.assertRaises(SSTTestCaseException): | ||
test_define = sst_config_include_file_get_value_str("PACKAGE_BUGREPORT_KEYINVALID") | ||
test_define = sst_config_include_file_get_value(define="PACKAGE_BUGREPORT_KEYINVALID", type=str) | ||
log_forced("#define PACKAGE_BUGREPORT_KEYINVALID={0}; type={1}".format(test_define, type(test_define))) | ||
|
||
############################################################################ | ||
|