diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2009-01-14 19:48:39 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2009-01-14 19:48:39 (GMT) |
commit | f677f9fbcfe035593cc1989c171215c43933b12d (patch) | |
tree | 8524fdf8ca3d19f5a72eff107af9de309622cc7c /test | |
parent | 127792fc31119f192f6016871dcab29acc8504b4 (diff) | |
download | hdf5-f677f9fbcfe035593cc1989c171215c43933b12d.zip hdf5-f677f9fbcfe035593cc1989c171215c43933b12d.tar.gz hdf5-f677f9fbcfe035593cc1989c171215c43933b12d.tar.bz2 |
[svn-r16314] Added support for OpenVMS pathname for external link.
Tested on OpenVMS and jam.
Diffstat (limited to 'test')
-rw-r--r-- | test/links.c | 114 | ||||
-rw-r--r-- | test/stab.c | 2 |
2 files changed, 89 insertions, 27 deletions
diff --git a/test/links.c b/test/links.c index acbe946..36dba41 100644 --- a/test/links.c +++ b/test/links.c @@ -35,6 +35,53 @@ /* File for external link test. Created with gen_udlinks.c */ #define LINKED_FILE "be_extlink2.h5" +#ifdef H5_VMS +const char *FILENAME[] = { + "links0", + "links1", + "links2", + "links3", + "links4a", /* 4 */ + "links4b", /* 5 */ + "links4c", /* 6 */ + "links4d", /* 7 */ + "links5", /* 8 */ + "links6", /* 9 */ + "links7", /* 10 */ + "links8", /* 11 */ + "extlinks0", /* 12: main files */ + "[.tmp]extlinks0", /* 13: */ + "extlinks1", /* 14: target files */ + "[.tmp]extlinks1", /* 15: */ + "extlinks2", /* 16: */ + "[.tmp]extlinks2", /* 17: */ + "extlinks3", /* 18: */ + "[.tmp]extlinks3", /* 19: */ + "extlinks4", /* 20: */ + "[.tmp]extlinks4", /* 21: */ + "extlinks5", /* 22: */ + "[.tmp]extlinks6", /* 23: */ + "extlinks7", /* 24: */ + "[.tmp]extlinks7", /* 25: */ + "[.tmp]extlinks8", /* 26: */ + "extlinks9", /* 27: */ + "[.tmp]extlinks9", /* 28: */ + "extlinks10", /* 29: */ /* TESTS for windows */ + "[.tmp]extlinks10", /* 30: */ + "[.tmp]extlinks11", /* 31: */ + "[.tmp]extlinks12", /* 32: */ + "extlinks13", /* 33: */ + "[.tmp]extlinks13", /* 34: */ + "[.tmp]extlinks14", /* 35: */ + "[.tmp]extlinks15", /* 36: */ + "extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */ + "extlinks16B", /* 38: */ + "extlinks17", /* 39: */ + NULL +}; + +#define TMPDIR "[.tmp]" +#else const char *FILENAME[] = { "links0", "links1", @@ -83,7 +130,9 @@ const char *FILENAME[] = { NULL }; -#define TMPDIR "tmp" +#define TMPDIR "tmp" +#endif + #define FAMILY_SIZE 1024 #define CORE_INCREMENT 1024 #define NUM400 400 @@ -2825,6 +2874,37 @@ external_link_prefix(hid_t fapl, hbool_t new_format) /*------------------------------------------------------------------------- + * Function: fix_ext_filename + * + * Purpose: Internal function to append path to file name. It handles + * path name of Unix, Windows, and OpenVMS. + * + * Return: void + * + * Programmer: Raymond Lu + * 14 Jan. 2009 + *------------------------------------------------------------------------- + */ +static void +fix_ext_filename(char *path_name, char *cwd, const char *file_name) +{ + HDstrcpy(path_name, cwd); + +#ifdef H5_VMS + if(file_name[0] == '[') { + char *tmp = file_name; + path_name[strlen(cwd)-1] = '\0'; + HDstrcat(path_name, ++tmp); + } else + HDstrcat(path_name, file_name); +#else + HDstrcat(path_name, "/"); + HDstrcat(path_name, file_name); +#endif +} + + +/*------------------------------------------------------------------------- * Function: external_link_abs_mainpath: test 3 * * Purpose: 1. target link: "extlinks3" @@ -2871,10 +2951,9 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format) * set up name for main file: * Linux: "/CWD/tmp/extlinks0" * Window: "<cur drive>:/CWD/tmp/extlinks0" + * OpenVMS: "<cur disk>$<partition>:[CWD.tmp]extlinks0" */ - HDstrcpy(tmpname, cwdpath); - HDstrcat(tmpname, "/"); - HDstrcat(tmpname, FILENAME[13]); + fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); /* Create the target file */ @@ -3052,9 +3131,7 @@ external_link_cwd(hid_t fapl, hbool_t new_format) * Linux: "/CWD/tmp/extlinks0" * Windows: "<cur drive>:/CWD/tmp/extlinks0" */ - HDstrcpy(tmpname, cwdpath); - HDstrcat(tmpname, "/"); - HDstrcat(tmpname, FILENAME[13]); + fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); /* Create the target file */ @@ -3147,9 +3224,7 @@ external_link_abstar(hid_t fapl, hbool_t new_format) * Linux: "/CWD/tmp/extlinks6" * Windows: "<cur drive>:/CWD/tmp/extlinks6" */ - HDstrcpy(tmpname, cwdpath); - HDstrcat(tmpname, "/"); - HDstrcat(tmpname, FILENAME[23]); + fix_ext_filename(tmpname, cwdpath, FILENAME[23]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); /* set up name for target file: "tmp/extlinks6" */ @@ -3246,9 +3321,7 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format) * Linux: "/CWD/tmp/extlinks7" * Windows: "<cur drive>:/CWD/tmp/extlinks7" */ - HDstrcpy(tmpname, cwdpath); - HDstrcat(tmpname, "/"); - HDstrcat(tmpname, FILENAME[25]); + fix_ext_filename(tmpname, cwdpath, FILENAME[25]); h5_fixname(tmpname, fapl, filename2, sizeof filename2); /* Create the target file */ @@ -3539,9 +3612,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) * Linux: "/CWD/tmp/extlinks0" * Windows: "<cur drive>:/CWD/tmp/extlinks0" */ - HDstrcpy(tmpname, cwdpath); - HDstrcat(tmpname, "/"); - HDstrcat(tmpname, FILENAME[13]); + fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); /* create "family" fapl */ @@ -3741,9 +3812,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) * Linux: "/CWD/tmp/extlinks0" * Windows: "<cur drive>:/CWD/tmp/extlinks0" */ - HDstrcpy(tmpname, cwdpath); - HDstrcat(tmpname, "/"); - HDstrcat(tmpname, FILENAME[13]); + fix_ext_filename(tmpname, cwdpath, FILENAME[13]); h5_fixname(tmpname, fapl, filename1, sizeof filename1); /* create fapl for the target file to be a "core" file */ @@ -12616,19 +12685,15 @@ main(void) /* tests for external link */ nerrors += external_link_env(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_VMS nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0; -#endif nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0; -#ifndef H5_VMS nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0; -#endif nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0; nerrors += external_set_elink_acc_flags(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0; @@ -12649,7 +12714,7 @@ main(void) nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */ nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */ } /* end if */ -#ifndef H5_VMS + nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0; nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0; nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0; @@ -12662,7 +12727,6 @@ main(void) nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0; nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0; nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0; -#endif /* Keep this test last, it's testing files that are used above */ /* do not do this for files used by external link tests */ diff --git a/test/stab.c b/test/stab.c index 9ce3cfe..b57b542 100644 --- a/test/stab.c +++ b/test/stab.c @@ -856,7 +856,6 @@ no_compact(hid_t fapl2) /* Verify that file is correct size */ if(file_size != empty_size) TEST_ERROR - PASSED(); return 0; @@ -1153,4 +1152,3 @@ error: puts("*** TESTS FAILED ***"); return 1; } - |