[svn-r13474] Purpose: Fixed bugs

Description:
    VMS revealed a problem in calling C++ test functions from C AddTest.

Solution:
    Per Quincey's suggestion, added
        #ifdef __cplusplus
        extern "C"
        #endif
    to the called C++ functions.

Platforms tested
    AIX 5.1 (copper)
    Linux 2.6 (kagiso)
    On pending: waiting for Elena to test on VMS when she comes back.
This commit is contained in:
Binh-Minh Ribler 2007-03-08 04:50:55 -05:00
parent 25bcff7681
commit 5a4bf8171d
9 changed files with 37 additions and 9 deletions

View File

@ -95,6 +95,9 @@ class InvalidActionException : public Exception {
};
/* Prototypes for the test routines */
#ifdef __cplusplus
extern "C" {
#endif
void test_attr(void);
void test_compound(void);
void test_file(void);
@ -113,6 +116,11 @@ void cleanup_h5s(void);
void cleanup_reference(void);
void cleanup_types(void);
void cleanup_vlstrings(void);
#ifdef __cplusplus
}
#endif
/* not yet
void cleanup_select(void);
void cleanup_time(void);

View File

@ -1200,8 +1200,10 @@ test_string_attr(void)
** test_attr(): Main attribute testing routine.
**
****************************************************************/
void
test_attr(void)
#ifdef __cplusplus
extern "C"
#endif
void test_attr(void)
{
// Output message about test being performed
MESSAGE(5, ("Testing Attributes\n"));

View File

@ -596,7 +596,7 @@ static void test_compound_6(void)
buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
for (int i=0; i<nelmts; i++) {
for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->b = (i*8+1) & 0x7fff;
s_ptr->d = (i*8+6) & 0x7fff;
@ -731,6 +731,9 @@ static void test_compound_7(void)
*
*-------------------------------------------------------------------------
*/
#ifdef __cplusplus
extern "C"
#endif
void test_compound(void)
{
// Output message about test being performed

View File

@ -492,8 +492,10 @@ test_file_name()
*
*-------------------------------------------------------------------------
*/
void
test_file(void)
#ifdef __cplusplus
extern "C"
#endif
void test_file(void)
{
// Output message about test being performed
MESSAGE(5, ("Testing File I/O operations\n"));

View File

@ -248,6 +248,9 @@ void test_szip_filter(H5File& file1)
**
****************************************************************/
const H5std_string FILE1("tfilters.h5");
#ifdef __cplusplus
extern "C"
#endif
void test_filters(void)
{
// Output message about test being performed

View File

@ -591,8 +591,10 @@ test_h5s_compound_scalar_read(void)
* Modifications:
*-------------------------------------------------------------------------
*/
void
test_h5s(void)
#ifdef __cplusplus
extern "C"
#endif
void test_h5s(void)
{
// Output message about test being performed
MESSAGE(5, ("Testing Dataspaces\n"));

View File

@ -277,8 +277,10 @@ test_reference_obj(void)
** test_reference(): Main reference testing routine.
**
****************************************************************/
void
test_reference(void)
#ifdef __cplusplus
extern "C"
#endif
void test_reference(void)
{
// Output message about test being performed
MESSAGE(5, ("Testing References\n"));

View File

@ -774,6 +774,9 @@ cerr << "all the way here?" << endl;
** test_types(): Main data types testing routine.
**
****************************************************************/
#ifdef __cplusplus
extern "C"
#endif
void test_types(void)
{
// Output message about test being performed

View File

@ -758,6 +758,9 @@ static void test_vl_rewrite(void)
** test_vlstrings(): Main VL string testing routine.
**
****************************************************************/
#ifdef __cplusplus
extern "C"
#endif
void test_vlstrings(void)
{
// Output message about test being performed