summaryrefslogtreecommitdiffstats
path: root/test/tgenprop.c
blob: 7a4fdf560bda706326f09339a4d79fe7b48cc0a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
/****************************************************************************
 * NCSA HDF								                                    *
 * Software Development Group						                        *
 * National Center for Supercomputing Applications			                *
 * University of Illinois at Urbana-Champaign				                *
 * 605 E. Springfield, Champaign IL 61820				                    *
 *									                                        *
 * For conditions of distribution and use, see the accompanying		        *
 * hdf/COPYING file.							                            *
 *									                                        *
 ****************************************************************************/

/* $Id$ */

/***********************************************************
*
* Test program:	 tgenprop
*
* Test the Generic Property functionality
*
*************************************************************/

#include "testhdf5.h"
#include "hdf5.h"

#define FILENAME   "tgenprop.h5"

/* Property definitions */
#define CLASS1_NAME     "Class 1"
#define CLASS1_HASHSIZE 25

#define CLASS2_NAME     "Class 2"
#define CLASS2_HASHSIZE 25

/* Property definitions */
#define PROP1_NAME     "Property 1"
int         prop1_def=10;   /* Property 1 default value */
#define PROP1_SIZE      sizeof(prop1_def)
#define PROP1_DEF_VALUE (&prop1_def)

#define PROP2_NAME     "Property 2"
float         prop2_def=3.14;   /* Property 2 default value */
#define PROP2_SIZE      sizeof(prop2_def)
#define PROP2_DEF_VALUE (&prop2_def)

#define PROP3_NAME     "Property 3"
char          prop3_def[10]="Ten chars";   /* Property 3 default value */
#define PROP3_SIZE      sizeof(prop3_def)
#define PROP3_DEF_VALUE (&prop3_def)

#define PROP4_NAME     "Property 4"
double          prop4_def=1.41;   /* Property 4 default value */
#define PROP4_SIZE      sizeof(prop4_def)
#define PROP4_DEF_VALUE (&prop4_def)

/****************************************************************
**
**  test_genprop_basic_class(): Test basic generic property list code.
**      Tests creating new generic classes.
** 
****************************************************************/
static void 
test_genprop_basic_class(void)
{
    hid_t		cid1;		/* Generic Property class ID */
    hid_t		cid2;		/* Generic Property class ID */
    hid_t		cid3;		/* Generic Property class ID */
    char       *name;       /* Name of class */
    herr_t		ret;		/* Generic return value	*/

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n"));

    /* Create a new generic class, derived from the root of the class hierarchy */
    cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Check class name */
    name = H5Pget_class_name(cid1);
    CHECK_PTR(name, "H5Pget_class_name");
    if(HDstrcmp(name,CLASS1_NAME)!=0) {
        num_errs++;
        printf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
    } /* end if */
    free(name);

    /* Check class parent */
    cid2 = H5Pget_class_parent(cid1);
    CHECK_I(cid2, "H5Pget_class_parent");

    /* Verify class parent correct */
    ret = H5Pequal(cid2,H5P_NO_CLASS_NEW);
    VERIFY(ret, 1, "H5Pequal");

    /* Make certain false postives aren't being returned */
    ret = H5Pequal(cid2,H5P_FILE_CREATE_NEW);
    VERIFY(ret, 0, "H5Pequal");

    /* Close parent class */
    ret = H5Pclose_class(cid2);
    CHECK_I(ret, "H5Pclose_class");

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");

    /* Create another new generic class, derived from file creation class */
    cid1 = H5Pcreate_class(H5P_FILE_CREATE_NEW,CLASS2_NAME,CLASS2_HASHSIZE,NULL,NULL,NULL,NULL);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Check class name */
    name = H5Pget_class_name(cid1);
    CHECK_PTR(name, "H5Pget_class_name");
    if(HDstrcmp(name,CLASS2_NAME)!=0) {
        num_errs++;
        printf("Class names don't match!, name=%s, CLASS2_NAME=%s\n",name,CLASS2_NAME);
    } /* end if */
    free(name);

    /* Check class parent */
    cid2 = H5Pget_class_parent(cid1);
    CHECK_I(cid2, "H5Pget_class_parent");

    /* Verify class parent correct */
    ret = H5Pequal(cid2,H5P_FILE_CREATE_NEW);
    VERIFY(ret, 1, "H5Pequal");

    /* Check class parent's parent */
    cid3 = H5Pget_class_parent(cid2);
    CHECK_I(cid3, "H5Pget_class_parent");

    /* Verify class parent's parent correct */
    ret = H5Pequal(cid3,H5P_NO_CLASS_NEW);
    VERIFY(ret, 1, "H5Pequal");

    /* Close parent class's parent */
    ret = H5Pclose_class(cid3);
    CHECK_I(ret, "H5Pclose_class");

    /* Close parent class */
    ret = H5Pclose_class(cid2);
    CHECK_I(ret, "H5Pclose_class");

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");
} /* end test_genprop_basic_class() */

/****************************************************************
**
**  test_genprop_basic_class_prop(): Test basic generic property list code.
**      Tests adding properties to generic classes.
** 
****************************************************************/
static void 
test_genprop_basic_class_prop(void)
{
    hid_t		cid1;		/* Generic Property class ID */
    size_t		size;		/* Size of property */
    size_t		nprops;		/* Number of properties in class */
    herr_t		ret;		/* Generic return value	*/

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n"));

    /* Create a new generic class, derived from the root of the class hierarchy */
    cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 0, "H5Pget_nprops");

    /* Check the existance of the first property (should fail) */
    ret = H5Pexist(cid1,PROP1_NAME);
    VERIFY(ret, 0, "H5Pexist");

    /* Insert first property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Try to insert the first property again (should fail) */
    ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    VERIFY(ret, FAIL, "H5Pregister");

    /* Check the existance of the first property */
    ret = H5Pexist(cid1,PROP1_NAME);
    VERIFY(ret, 1, "H5Pexist");

    /* Check the size of the first property */
    ret = H5Pget_size(cid1,PROP1_NAME,&size);
    CHECK_I(ret, "H5Pget_size");
    VERIFY(size, PROP1_SIZE, "H5Pget_size");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 1, "H5Pget_nprops");

    /* Insert second property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Try to insert the second property again (should fail) */
    ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    VERIFY(ret, FAIL, "H5Pregister");

    /* Check the existance of the second property */
    ret = H5Pexist(cid1,PROP2_NAME);
    VERIFY(ret, 1, "H5Pexist");

    /* Check the size of the second property */
    ret = H5Pget_size(cid1,PROP2_NAME,&size);
    CHECK_I(ret, "H5Pget_size");
    VERIFY(size, PROP2_SIZE, "H5Pget_size");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 2, "H5Pget_nprops");

    /* Insert third property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Check the existance of the third property */
    ret = H5Pexist(cid1,PROP3_NAME);
    VERIFY(ret, 1, "H5Pexist");

    /* Check the size of the third property */
    ret = H5Pget_size(cid1,PROP3_NAME,&size);
    CHECK_I(ret, "H5Pget_size");
    VERIFY(size, PROP3_SIZE, "H5Pget_size");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 3, "H5Pget_nprops");

    /* Unregister first property */
    ret = H5Punregister(cid1,PROP1_NAME);
    CHECK_I(ret, "H5Punregister");

    /* Try to check the size of the first property (should fail) */
    ret = H5Pget_size(cid1,PROP1_NAME,&size);
    VERIFY(ret, FAIL, "H5Pget_size");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 2, "H5Pget_nprops");

    /* Unregister second property */
    ret = H5Punregister(cid1,PROP2_NAME);
    CHECK_I(ret, "H5Punregister");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 1, "H5Pget_nprops");

    /* Unregister third property */
    ret = H5Punregister(cid1,PROP3_NAME);
    CHECK_I(ret, "H5Punregister");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 0, "H5Pget_nprops");

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");
} /* end test_genprop_basic_class_prop() */

/****************************************************************
**
**  test_genprop_iter1(): Property iterator for test_genprop_class_iter
** 
****************************************************************/
static int 
test_genprop_iter1(hid_t id, const char *name, void *iter_data)
{
    struct {                /* Struct for iterations */
        int iter_count;
        const char **names;
    } *iter_struct=iter_data;

    /* Shut compiler up */
    id=id;

    return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++]));
}

/****************************************************************
**
**  test_genprop_class_iter(): Test basic generic property list code.
**      Tests iterating over properties in a generic class.
** 
****************************************************************/
static void 
test_genprop_class_iter(void)
{
    hid_t		cid1;		/* Generic Property class ID */
    size_t		nprops;		/* Number of properties in class */
    int         idx;        /* Index to start iteration at */
    struct {                /* Struct for iterations */
        int iter_count;
        const char **names;
    } iter_struct;
    const char *pnames[4]={ /* Names of properties for iterator */
        PROP1_NAME,
        PROP2_NAME,
        PROP3_NAME,
        PROP4_NAME};
    herr_t		ret;		/* Generic return value	*/

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n"));

    /* Create a new generic class, derived from the root of the class hierarchy */
    cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Insert first property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert second property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert third property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert third property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 4, "H5Pget_nprops");

    /* Iterate over all properties in class */
    iter_struct.iter_count=0;
    iter_struct.names=pnames;
    ret = H5Piterate(cid1,NULL,test_genprop_iter1,&iter_struct);
    VERIFY(ret, 0, "H5Piterate");

    /* Iterate over last three properties in class */
    idx=iter_struct.iter_count=1;
    ret = H5Piterate(cid1,&idx,test_genprop_iter1,&iter_struct);
    VERIFY(ret, 0, "H5Piterate");
    VERIFY(idx, (int)nprops, "H5Piterate");

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");
} /* end test_genprop_class_iter() */

/****************************************************************
**
**  test_genprop_cls_cb1(): Property List callback for test_genprop_class_callback
** 
****************************************************************/
static herr_t 
test_genprop_cls_cb1(hid_t list_id, void *create_data)
{
    struct {                /* Struct for iterations */
        int count;
        hid_t id;
    } *count_struct=create_data;

    count_struct->count++;
    count_struct->id=list_id;

    return(SUCCEED);
}

/****************************************************************
**
**  test_genprop_class_callback(): Test basic generic property list code.
**      Tests callbacks for property lists in a generic class.
** 
****************************************************************/
static void 
test_genprop_class_callback(void)
{
    hid_t	cid1;		/* Generic Property class ID */
    hid_t	lid1;		/* Generic Property list ID */
    hid_t	lid2;		/* Generic Property list ID */
    size_t	nprops;		/* Number of properties in class */
    struct {                    /* Struct for callbacks */
        int count;
        hid_t id;
    } crt_cb_struct, cls_cb_struct;
    herr_t		ret;		/* Generic return value	*/

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n"));

    /* Create a new generic class, derived from the root of the class hierarchy */
    cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,test_genprop_cls_cb1,&crt_cb_struct,test_genprop_cls_cb1,&cls_cb_struct);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Insert first property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert second property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert third property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert fourth property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 4, "H5Pget_nprops");

    /* Initialize class callback structs */
    crt_cb_struct.count=0;
    crt_cb_struct.id=(-1);
    cls_cb_struct.count=0;
    cls_cb_struct.id=(-1);

    /* Create a property list from the class */
    lid1 = H5Pcreate_list(cid1);
    CHECK_I(lid1, "H5Pcreate_list");

    /* Verify that the creation callback occurred */
    VERIFY(crt_cb_struct.count, 1, "H5Pcreate_list");
    VERIFY(crt_cb_struct.id, lid1, "H5Pcreate_list");

    /* Check the number of properties in list */
    ret = H5Pget_nprops(lid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 4, "H5Pget_nprops");

    /* Create another property list from the class */
    lid2 = H5Pcreate_list(cid1);
    CHECK_I(lid2, "H5Pcreate_list");

    /* Verify that the creation callback occurred */
    VERIFY(crt_cb_struct.count, 2, "H5Pcreate_list");
    VERIFY(crt_cb_struct.id, lid2, "H5Pcreate_list");

    /* Check the number of properties in list */
    ret = H5Pget_nprops(lid2,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 4, "H5Pget_nprops");

    /* Close first list */
    ret = H5Pclose_list(lid1);
    CHECK_I(ret, "H5Pclose_list");

    /* Verify that the close callback occurred */
    VERIFY(cls_cb_struct.count, 1, "H5Pclose_list");
    VERIFY(cls_cb_struct.id, lid1, "H5Pclose_list");

    /* Close second list */
    ret = H5Pclose_list(lid2);
    CHECK_I(ret, "H5Pclose_list");

    /* Verify that the close callback occurred */
    VERIFY(cls_cb_struct.count, 2, "H5Pclose_list");
    VERIFY(cls_cb_struct.id, lid2, "H5Pclose_list");

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");
} /* end test_genprop_class_callback() */

/****************************************************************
**
**  test_genprop_basic_list(): Test basic generic property list code.
**      Tests creating new generic property lists.
** 
****************************************************************/
static void 
test_genprop_basic_list(void)
{
    hid_t		cid1;		/* Generic Property class ID */
    hid_t		cid2;		/* Generic Property class ID */
    hid_t		lid1;		/* Generic Property list ID */
    size_t		nprops;		/* Number of properties */
    size_t		size;		/* Size of property */
    int                 prop1_value;    /* Value for property #1 */
    float               prop2_value;    /* Value for property #2 */
    herr_t		ret;		/* Generic return value	*/

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n"));

    /* Create a new generic class, derived from the root of the class hierarchy */
    cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Add several properties (w/default values) */

    /* Insert first property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert second property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 2, "H5Pget_nprops");

    /* Create a property list from the class */
    lid1 = H5Pcreate_list(cid1);
    CHECK_I(lid1, "H5Pcreate_list");

    /* Get the list's class */
    cid2 = H5Pget_class_new(lid1);
    CHECK_I(cid2, "H5Pget_class_new");

    /* Check that the list's class is correct */
    ret = H5Pequal(cid1,cid2);
    VERIFY(ret, 1, "H5Pequal");

    /* Check correct "is a" class/list relationship */
    ret = H5Pisa_class(lid1,cid1);
    VERIFY(ret, 1, "H5Pisa_class");

    /* Check "is a" class/list relationship another way */
    ret = H5Pisa_class(lid1,cid2);
    VERIFY(ret, 1, "H5Pisa_class");

    /* Close class */
    ret = H5Pclose_class(cid2);
    CHECK_I(ret, "H5Pclose_class");

    /* Check the number of properties in list */
    ret = H5Pget_nprops(lid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 2, "H5Pget_nprops");

    /* Check existence of properties */
    ret = H5Pexist(lid1,PROP1_NAME);
    VERIFY(ret, 1, "H5Pexist");
    ret = H5Pexist(lid1,PROP2_NAME);
    VERIFY(ret, 1, "H5Pexist");

    /* Check the sizes of the properties */
    ret = H5Pget_size(lid1,PROP1_NAME,&size);
    CHECK_I(ret, "H5Pget_size");
    VERIFY(size, PROP1_SIZE, "H5Pget_size");
    ret = H5Pget_size(lid1,PROP2_NAME,&size);
    CHECK_I(ret, "H5Pget_size");
    VERIFY(size, PROP2_SIZE, "H5Pget_size");

    /* Check values of properties (set with default values) */
    ret = H5Pget(lid1,PROP1_NAME,&prop1_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
    ret = H5Pget(lid1,PROP2_NAME,&prop2_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop2_value, *PROP2_DEF_VALUE, "H5Pget");

    /* Close list */
    ret = H5Pclose_list(lid1);
    CHECK_I(ret, "H5Pclose_list");

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");

} /* end test_genprop_basic_list() */

/****************************************************************
**
**  test_genprop_basic_list_prop(): Test basic generic property list code.
**      Tests creating new generic property lists and adding and
**      removing properties from them.
** 
****************************************************************/
static void 
test_genprop_basic_list_prop(void)
{
    hid_t		cid1;		/* Generic Property class ID */
    hid_t		lid1;		/* Generic Property list ID */
    size_t		nprops;		/* Number of properties */
    int                 prop1_value;    /* Value for property #1 */
    float               prop2_value;    /* Value for property #2 */
    char                prop3_value[10];/* Property #3 value */
    double              prop4_value;    /* Property #4 value */
    herr_t		ret;		/* Generic return value	*/

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n"));

    /* Create a new generic class, derived from the root of the class hierarchy */
    cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Add several properties (several w/default values) */

    /* Insert first property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert second property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Create a property list from the class */
    lid1 = H5Pcreate_list(cid1);
    CHECK_I(lid1, "H5Pcreate_list");

    /* Check the number of properties in list */
    ret = H5Pget_nprops(lid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 2, "H5Pget_nprops");

    /* Add temporary properties */

    /* Insert first temporary property into class (with no callbacks) */
    ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pinsert");

    /* Insert second temporary property into class (with no callbacks) */
    ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pinsert");

    /* Check the number of properties in list */
    ret = H5Pget_nprops(lid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 4, "H5Pget_nprops");

    /* Check existence of all properties */
    ret = H5Pexist(lid1,PROP1_NAME);
    VERIFY(ret, 1, "H5Pexist");
    ret = H5Pexist(lid1,PROP2_NAME);
    VERIFY(ret, 1, "H5Pexist");
    ret = H5Pexist(lid1,PROP3_NAME);
    VERIFY(ret, 1, "H5Pexist");
    ret = H5Pexist(lid1,PROP4_NAME);
    VERIFY(ret, 1, "H5Pexist");

    /* Check values of permanent properties (set with default values) */
    ret = H5Pget(lid1,PROP1_NAME,&prop1_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
    ret = H5Pget(lid1,PROP2_NAME,&prop2_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop2_value, *PROP2_DEF_VALUE, "H5Pget");

    /* Check values of temporary properties (set with regular values) */
    ret = H5Pget(lid1,PROP3_NAME,&prop3_value);
    CHECK_I(ret, "H5Pget");
    if(memcmp(&prop3_value,PROP3_DEF_VALUE,PROP3_SIZE)!=0) {
        num_errs++;
        printf("Property #3 doesn't match!, line=%d\n",__LINE__);
    } /* end if */
    ret = H5Pget(lid1,PROP4_NAME,&prop4_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop4_value, *PROP4_DEF_VALUE, "H5Pget");

    /* Delete permanent property */
    ret = H5Premove(lid1,PROP2_NAME);
    CHECK_I(ret, "H5Premove");

    /* Check number of properties */
    ret = H5Pget_nprops(lid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 3, "H5Pget_nprops");

    /* Delete temporary property */
    ret = H5Premove(lid1,PROP3_NAME);
    CHECK_I(ret, "H5Premove");

    /* Check number of properties */
    ret = H5Pget_nprops(lid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 2, "H5Pget_nprops");

    /* Check existence of remaining properties */
    ret = H5Pexist(lid1,PROP1_NAME);
    VERIFY(ret, 1, "H5Pexist");
    ret = H5Pexist(lid1,PROP4_NAME);
    VERIFY(ret, 1, "H5Pexist");

    /* Check values of permanent properties (set with default values) */
    ret = H5Pget(lid1,PROP1_NAME,&prop1_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");

    /* Check values of temporary properties (set with regular values) */
    ret = H5Pget(lid1,PROP4_NAME,&prop4_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop4_value, *PROP4_DEF_VALUE, "H5Pget");

    /* Close list */
    ret = H5Pclose_list(lid1);
    CHECK_I(ret, "H5Pclose_list");

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");

} /* end test_genprop_basic_list_prop() */

/****************************************************************
**
**  test_genprop_iter2(): Property iterator for test_genprop_list_iter
** 
****************************************************************/
static int 
test_genprop_iter2(hid_t id, const char *name, void *iter_data)
{
    struct {                /* Struct for iterations */
        int iter_count;
        const char **names;
    } *iter_struct=iter_data;

    /* Shut compiler up */
    id=id;

    return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++]));
}

/****************************************************************
**
**  test_genprop_list_iter(): Test basic generic property list code.
**      Tests iterating over generic property list properties.
** 
****************************************************************/
static void 
test_genprop_list_iter(void)
{
    hid_t		cid1;		/* Generic Property class ID */
    hid_t		lid1;		/* Generic Property list ID */
    size_t		nprops;		/* Number of properties */
    int         idx;        /* Index to start iteration at */
    struct {                /* Struct for iterations */
        int iter_count;
        const char **names;
    } iter_struct;
    const char *pnames[4]={ /* Names of properties for iterator */
        PROP1_NAME,
        PROP2_NAME,
        PROP3_NAME,
        PROP4_NAME};
    herr_t		ret;		/* Generic return value	*/

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n"));

    /* Create a new generic class, derived from the root of the class hierarchy */
    cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Add several properties (several w/default values) */

    /* Insert first property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert second property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Create a property list from the class */
    lid1 = H5Pcreate_list(cid1);
    CHECK_I(lid1, "H5Pcreate_list");

    /* Check the number of properties in list */
    ret = H5Pget_nprops(lid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 2, "H5Pget_nprops");

    /* Add temporary properties */

    /* Insert first temporary property into class (with no callbacks) */
    ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pinsert");

    /* Insert second temporary property into class (with no callbacks) */
    ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pinsert");

    /* Check the number of properties in list */
    ret = H5Pget_nprops(lid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 4, "H5Pget_nprops");

    /* Iterate over all properties in list */
    iter_struct.iter_count=0;
    iter_struct.names=pnames;
    ret = H5Piterate(lid1,NULL,test_genprop_iter2,&iter_struct);
    VERIFY(ret, 0, "H5Piterate");

    /* Iterate over last three properties in list */
    idx=iter_struct.iter_count=1;
    ret = H5Piterate(lid1,&idx,test_genprop_iter2,&iter_struct);
    VERIFY(ret, 0, "H5Piterate");
    VERIFY(idx, (int)nprops, "H5Piterate");

    /* Close list */
    ret = H5Pclose_list(lid1);
    CHECK_I(ret, "H5Pclose_list");

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");

} /* end test_genprop_list_iter() */

typedef struct {
    /* Creation information */
    int crt_count;
    char *crt_name;
    void *crt_value;

    /* Set information */
    int set_count;
    hid_t set_plist_id;
    char *set_name;
    void *set_value;

    /* Get information */
    int get_count;
    hid_t get_plist_id;
    char *get_name;
    void *get_value;

    /* Delete information */
    int del_count;
    hid_t del_plist_id;
    char *del_name;
    void *del_value;

    /* Close information */
    int cls_count;
    char *cls_name;
    void *cls_value;
} prop_cb_info;

/* Global variables for Callback information */
prop_cb_info prop1_cb_info;     /* Callback statistics for property #1 */
prop_cb_info prop2_cb_info;     /* Callback statistics for property #2 */

/****************************************************************
**
**  test_genprop_prop_crt_cb1(): Property creation callback for test_genprop_list_callback
** 
****************************************************************/
static herr_t 
test_genprop_prop_crt_cb1(const char *name, void *def_value)
{
    /* Set the information from the creation call */
    prop1_cb_info.crt_count++;
    prop1_cb_info.crt_name=HDstrdup(name);
    prop1_cb_info.crt_value=HDmalloc(PROP1_SIZE);
    HDmemcpy(prop1_cb_info.crt_value,def_value,PROP1_SIZE);

    return(SUCCEED);
}

/****************************************************************
**
**  test_genprop_prop_set_cb1(): Property set callback for test_genprop_list_callback
** 
****************************************************************/
static herr_t 
test_genprop_prop_set_cb1(hid_t plist_id, const char *name, void *value)
{
    /* Set the information from the set call */
    prop1_cb_info.set_count++;
    prop1_cb_info.set_plist_id=plist_id;
    if(prop1_cb_info.set_name==NULL)
        prop1_cb_info.set_name=HDstrdup(name);
    if(prop1_cb_info.set_value==NULL)
        prop1_cb_info.set_value=HDmalloc(PROP1_SIZE);
    HDmemcpy(prop1_cb_info.set_value,value,PROP1_SIZE);

    return(SUCCEED);
}

/****************************************************************
**
**  test_genprop_prop_get_cb1(): Property get callback for test_genprop_list_callback
** 
****************************************************************/
static herr_t 
test_genprop_prop_get_cb1(hid_t plist_id, const char *name, void *value)
{
    /* Set the information from the get call */
    prop1_cb_info.get_count++;
    prop1_cb_info.get_plist_id=plist_id;
    if(prop1_cb_info.get_name==NULL)
        prop1_cb_info.get_name=HDstrdup(name);
    if(prop1_cb_info.get_value==NULL)
        prop1_cb_info.get_value=HDmalloc(PROP1_SIZE);
    HDmemcpy(prop1_cb_info.get_value,value,PROP1_SIZE);

    return(SUCCEED);
}

/****************************************************************
**
**  test_genprop_prop_cls_cb1(): Property close callback for test_genprop_list_callback
** 
****************************************************************/
static herr_t 
test_genprop_prop_cls_cb1(const char *name, void *value)
{
    /* Set the information from the close call */
    prop1_cb_info.cls_count++;
    prop1_cb_info.cls_name=HDstrdup(name);
    prop1_cb_info.cls_value=HDmalloc(PROP1_SIZE);
    HDmemcpy(prop1_cb_info.cls_value,value,PROP1_SIZE);

    return(SUCCEED);
}

/****************************************************************
**
**  test_genprop_prop_del_cb2(): Property delete callback for test_genprop_list_callback
** 
****************************************************************/
static herr_t 
test_genprop_prop_del_cb2(hid_t plist_id, const char *name, void *value)
{
    /* Set the information from the delete call */
    prop2_cb_info.del_count++;
    prop2_cb_info.del_plist_id=plist_id;
    prop2_cb_info.del_name=HDstrdup(name);
    prop2_cb_info.del_value=HDmalloc(PROP2_SIZE);
    HDmemcpy(prop2_cb_info.del_value,value,PROP2_SIZE);

    return(SUCCEED);
}

/****************************************************************
**
**  test_genprop_list_callback(): Test basic generic property list code.
**      Tests callbacks for properties in a generic property list.
** 
****************************************************************/
static void 
test_genprop_list_callback(void)
{
    hid_t	cid1;		/* Generic Property class ID */
    hid_t	lid1;		/* Generic Property list ID */
    size_t	nprops;		/* Number of properties in class */
    int         prop1_value;    /* Value for property #1 */
    int         prop1_new_value=20;   /* Property #1 new value */
    float       prop2_value;    /* Value for property #2 */
    char        prop3_value[10];/* Property #3 value */
    double      prop4_value;    /* Property #4 value */
    herr_t	ret;		/* Generic return value	*/

    /* Output message about test being performed */
    MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n"));

    /* Create a new generic class, derived from the root of the class hierarchy */
    cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
    CHECK_I(cid1, "H5Pcreate_class");

    /* Insert first property into class (with callbacks) */
    ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,test_genprop_prop_crt_cb1,test_genprop_prop_set_cb1,test_genprop_prop_get_cb1,NULL,test_genprop_prop_cls_cb1);
    CHECK_I(ret, "H5Pregister");

    /* Insert second property into class (with only delete callback) */
    ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,test_genprop_prop_del_cb2,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert third property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Insert fourth property into class (with no callbacks) */
    ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
    CHECK_I(ret, "H5Pregister");

    /* Check the number of properties in class */
    ret = H5Pget_nprops(cid1,&nprops);
    CHECK_I(ret, "H5Pget_nprops");
    VERIFY(nprops, 4, "H5Pget_nprops");

    /* Initialize callback information for properties tracked */
    HDmemset(&prop1_cb_info,0,sizeof(prop_cb_info));

    /* Create a property list from the class */
    lid1 = H5Pcreate_list(cid1);
    CHECK_I(lid1, "H5Pcreate_list");

    /* Verify creation callback information for properties tracked */
    VERIFY(prop1_cb_info.crt_count, 1, "H5Pcreate_list");
    if(HDstrcmp(prop1_cb_info.crt_name,PROP1_NAME)!=0) {
        num_errs++;
        printf("Property #1 name doesn't match!, line=%d\n",__LINE__);
    } /* end if */
    if(HDmemcmp(prop1_cb_info.crt_value,PROP1_DEF_VALUE,PROP1_SIZE)!=0) {
        num_errs++;
        printf("Property #1 value doesn't match!, line=%d\n",__LINE__);
    } /* end if */

    /* Check values of permanent properties (set with default values) */
    ret = H5Pget(lid1,PROP1_NAME,&prop1_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
    ret = H5Pget(lid1,PROP2_NAME,&prop2_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop2_value, *PROP2_DEF_VALUE, "H5Pget");

    /* Check values of temporary properties (set with regular values) */
    ret = H5Pget(lid1,PROP3_NAME,&prop3_value);
    CHECK_I(ret, "H5Pget");
    if(memcmp(&prop3_value,PROP3_DEF_VALUE,PROP3_SIZE)!=0) {
        num_errs++;
        printf("Property #3 doesn't match!, line=%d\n",__LINE__);
    } /* end if */
    ret = H5Pget(lid1,PROP4_NAME,&prop4_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop4_value, *PROP4_DEF_VALUE, "H5Pget");

    /* Verify get callback information for properties tracked */
    VERIFY(prop1_cb_info.get_count, 1, "H5Pget");
    VERIFY(prop1_cb_info.get_plist_id, lid1, "H5Pget");
    if(HDstrcmp(prop1_cb_info.get_name,PROP1_NAME)!=0) {
        num_errs++;
        printf("Property #1 name doesn't match!, line=%d\n",__LINE__);
    } /* end if */
    if(HDmemcmp(prop1_cb_info.get_value,PROP1_DEF_VALUE,PROP1_SIZE)!=0) {
        num_errs++;
        printf("Property #1 value doesn't match!, line=%d\n",__LINE__);
    } /* end if */

    /* Set value of property #1 to different value */
    ret = H5Pset(lid1,PROP1_NAME,&prop1_new_value);
    CHECK_I(ret, "H5Pset");

    /* Verify set callback information for properties tracked */
    VERIFY(prop1_cb_info.set_count, 1, "H5Pset");
    VERIFY(prop1_cb_info.set_plist_id, lid1, "H5Pset");
    if(HDstrcmp(prop1_cb_info.set_name,PROP1_NAME)!=0) {
        num_errs++;
        printf("Property #1 name doesn't match!, line=%d\n",__LINE__);
    } /* end if */
    if(HDmemcmp(prop1_cb_info.set_value,&prop1_new_value,PROP1_SIZE)!=0) {
        num_errs++;
        printf("Property #1 value doesn't match!, line=%d\n",__LINE__);
    } /* end if */

    /* Check new value of tracked properties */
    ret = H5Pget(lid1,PROP1_NAME,&prop1_value);
    CHECK_I(ret, "H5Pget");
    VERIFY(prop1_value, prop1_new_value, "H5Pget");

    /* Verify get callback information again for properties tracked */
    VERIFY(prop1_cb_info.get_count, 2, "H5Pget");
    VERIFY(prop1_cb_info.get_plist_id, lid1, "H5Pget");
    if(HDstrcmp(prop1_cb_info.get_name,PROP1_NAME)!=0) {
        num_errs++;
        printf("Property #1 name doesn't match!, line=%d\n",__LINE__);
    } /* end if */
    if(HDmemcmp(prop1_cb_info.get_value,&prop1_new_value,PROP1_SIZE)!=0) {
        num_errs++;
        printf("Property #1 value doesn't match!, line=%d\n",__LINE__);
    } /* end if */

    /* Delete property #2 */
    ret = H5Premove(lid1,PROP2_NAME);
    CHECK_I(ret, "H5Premove");

    /* Verify delete callback information for properties tracked */
    VERIFY(prop2_cb_info.del_count, 1, "H5Premove");
    VERIFY(prop2_cb_info.del_plist_id, lid1, "H5Premove");
    if(HDstrcmp(prop2_cb_info.del_name,PROP2_NAME)!=0) {
        num_errs++;
        printf("Property #2 name doesn't match!, line=%d\n",__LINE__);
    } /* end if */
    if(HDmemcmp(prop2_cb_info.del_value,PROP2_DEF_VALUE,PROP2_SIZE)!=0) {
        num_errs++;
        printf("Property #2 value doesn't match!, line=%d\n",__LINE__);
    } /* end if */

    /* Close first list */
    ret = H5Pclose_list(lid1);
    CHECK_I(ret, "H5Pclose_list");

    /* Verify close callback information for properties tracked */
    VERIFY(prop1_cb_info.cls_count, 1, "H5Pclose");
    if(HDstrcmp(prop1_cb_info.cls_name,PROP1_NAME)!=0) {
        num_errs++;
        printf("Property #1 name doesn't match!, line=%d\n",__LINE__);
    } /* end if */
    if(HDmemcmp(prop1_cb_info.cls_value,&prop1_new_value,PROP1_SIZE)!=0) {
        num_errs++;
        printf("Property #1 value doesn't match!, line=%d\n",__LINE__);
    } /* end if */

    /* Free memory allocated for tracking properties */
    HDfree(prop1_cb_info.crt_name);
    HDfree(prop1_cb_info.crt_value);
    HDfree(prop1_cb_info.get_name);
    HDfree(prop1_cb_info.get_value);
    HDfree(prop1_cb_info.set_name);
    HDfree(prop1_cb_info.set_value);
    HDfree(prop1_cb_info.cls_name);
    HDfree(prop1_cb_info.cls_value);
    HDfree(prop2_cb_info.del_name);
    HDfree(prop2_cb_info.del_value);

    /* Close class */
    ret = H5Pclose_class(cid1);
    CHECK_I(ret, "H5Pclose_class");
} /* end test_genprop_list_callback() */

/****************************************************************
**
**  test_genprop(): Main generic property testing routine.
** 
****************************************************************/
void 
test_genprop(void)
{
    /* Output message about test being performed */
    MESSAGE(5, ("Testing Generic Properties\n"));

    /* These tests use the same file... */
    test_genprop_basic_class(); /* Test basic code for creating a generic class */
    test_genprop_basic_class_prop(); /* Test basic code for adding properties to a generic class */
    test_genprop_class_iter();  /* Test code for iterating over properties in a generic class */
    test_genprop_class_callback();  /* Test code for property class callbacks */

    test_genprop_basic_list();  /* Test basic code for creating a generic property list */
    test_genprop_basic_list_prop(); /* Test basic code for adding properties to a generic property list */
    test_genprop_list_iter();  /* Test basic code for iterating over properties in a generic property list */
    test_genprop_list_callback();  /* Test code for property list callbacks */

}   /* test_genprop() */


/*-------------------------------------------------------------------------
 * Function:	cleanup_genprop
 *
 * Purpose:	Cleanup temporary test files
 *
 * Return:	none
 *
 * Programmer:	Quincey Koziol
 *              June 8, 1999
 *
 * Modifications:
 *
 *-------------------------------------------------------------------------
 */
void
cleanup_genprop(void)
{
    remove(FILENAME);
}