Source
2572
2572
FAIL_STACK_ERROR
2573
2573
2574
2574
TESTING("getting path to normal dataset in root group");
2575
2575
if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[0])) < 0) FAIL_STACK_ERROR
2576
2576
*buf = '\0';
2577
2577
namelen = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
2578
2578
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
2579
2579
if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(namelen == 9))) TEST_ERROR
2580
2580
*buf = '\0';
2581
2581
2582
-
/* Check H5Rget_name returns the correct length of the name when name is NULL */
2583
-
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 0);
2584
-
if(namelen != 9) TEST_ERROR
2585
-
/* Make sure size parameter is ignored */
2586
-
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 200);
2587
-
if(namelen != 9) TEST_ERROR
2588
-
2589
2582
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf));
2590
2583
if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(namelen == 9))) TEST_ERROR
2591
2584
PASSED()
2592
2585
2593
2586
HDmemset(buf, 0, sizeof(buf));
2594
2587
TESTING("getting path to dataset in /Group1");
2595
2588
if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR
2596
2589
*buf = '\0';
2597
2590
namelen = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
2598
2591
if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
2816
2809
/* Reopen the dataset with object references and read references to the buffer */
2817
2810
if((dsetr_id = H5Dopen2(file_id, REFREG_DSETNAMER, H5P_DEFAULT)) < 0)
2818
2811
TEST_ERROR
2819
2812
2820
2813
if(H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out) < 0)
2821
2814
TEST_ERROR
2822
2815
2823
2816
/* Get name of the dataset the first region reference points to using H5Rget_name */
2824
2817
TESTING("H5Rget_name to get name from region reference(hyperslab)");
2825
2818
*buf1 = '\0';
2826
-
2827
-
/* Check H5Rget_name returns the correct length of the name when name is NULL */
2828
-
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], NULL, 0);
2829
-
if(name_size1 != 7) TEST_ERROR
2830
-
2831
-
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE );
2819
+
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE);
2832
2820
if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR
2833
2821
PASSED()
2834
2822
2835
2823
TESTING("H5Iget_name to get name from region reference(hyperslab)");
2836
2824
2837
2825
/* Dereference the first reference */
2838
2826
dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[0]);
2839
2827
2840
2828
/* Get name of the dataset the first region reference points using H5Iget_name */
2841
2829
*buf2 = '\0';