summaryrefslogtreecommitdiffstats
path: root/test/tstab.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tstab.c')
-rw-r--r--test/tstab.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/test/tstab.c b/test/tstab.c
index 0b4c80c..7dddc6c 100644
--- a/test/tstab.c
+++ b/test/tstab.c
@@ -19,6 +19,7 @@
#include "H5ACprivate.h"
#include "H5Fprivate.h"
#include "H5Gprivate.h"
+#include "H5Oprivate.h"
/*-------------------------------------------------------------------------
@@ -41,11 +42,11 @@ test_stab (void)
{
hatom_t fid;
hdf5_file_t *f;
- haddr_t addr;
- H5G_entry_t root, sub;
+ H5G_entry_t cwd, sub;
int i;
char name[256];
herr_t status;
+ int nsyms = 5000;
MESSAGE (5, print_func("Testing Symbol Tables\n"););
@@ -55,20 +56,33 @@ test_stab (void)
f = H5Aatom_object (fid);
CHECK (f, NULL, "H5Aatom_object");
- /* create a new symbol table */
- addr = H5G_stab_new (f, &root, 100);
- CHECK_I (addr, "H5G_stab_new");
- MESSAGE (8, print_func ("Root address is %lu\n", (unsigned long)addr););
-
- /* create some empty symbol tables as objects in the root stab */
- for (i=0; i<16384; i++) {
- addr = H5G_stab_new (f, &sub, 0);
- CHECK_I (addr, "H5G_stab_new");
+ /* create a new root symbol table */
+ status = H5G_mkroot (f, 100);
+ CHECK_I (status, "H5G_mkroot");
+ /*
+ * Create a directory that has so many entries that the root
+ * of the B-tree ends up splitting.
+ */
+ status = H5G_new (f, NULL, NULL, "/big", nsyms*10+2, &cwd);
+ CHECK_I (status, "H5G_new");
+ H5G_stab_new (f, &sub, 0);
+ status = H5O_link (f, sub.header, &sub, nsyms-1);
+ CHECK_I (status, "H5O_link");
+
+
+ for (i=0; i<5000; i++) {
sprintf (name, "sub%05d", i);
MESSAGE (8, print_func ("%s\n", name););
- status = H5G_stab_insert (f, &root, name, &sub);
+#if 1
+ status = H5G_insert (f, &cwd, NULL, name, &sub);
+ CHECK_I (status, "H5G_insert");
+#else
+ status = H5G_stab_new (f, &sub, 0);
+ CHECK_I (status, "H5G_stab_new");
+ status = H5G_stab_insert (f, &cwd, name, &sub);
CHECK_I (status, "H5G_stab_insert");
+#endif
}