diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-08-14 16:18:28 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-08-14 16:18:28 (GMT) |
commit | 0f61afce1cc9286e0da761d60f0c0db51423db32 (patch) | |
tree | 04c46c8276655eefa07cf8bc674c31d5df86d104 /hl/c++/test | |
parent | 89f36d62b776ef955eed82a109b83a187ef115bb (diff) | |
download | hdf5-0f61afce1cc9286e0da761d60f0c0db51423db32.zip hdf5-0f61afce1cc9286e0da761d60f0c0db51423db32.tar.gz hdf5-0f61afce1cc9286e0da761d60f0c0db51423db32.tar.bz2 |
[svn-r12576] Added funtions to query the "current position" for Packet Tables in C and C++.
Diffstat (limited to 'hl/c++/test')
-rw-r--r-- | hl/c++/test/ptableTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index 9cae7f5..3b97d3e 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -210,7 +210,10 @@ int TestGetNext() goto out; } + /* Reset the index and check that it worked */ wrapper.ResetIndex(); + if(wrapper.GetIndex(error) != 0) goto out; + if(error < 0) goto out; /* Ensure that we can interate through the records and get the right ones */ for(i = 1; i < 6; i++) @@ -221,6 +224,8 @@ int TestGetNext() } wrapper.SetIndex(1); + if(wrapper.GetIndex(error) != 1) goto out; + if(error < 0) goto out; /* Ensure we can get multiple records with our index pointer */ wrapper.GetNextPackets(2, records); @@ -342,11 +347,15 @@ int TestErrors() error = wrapper.SetIndex(-1); if(error >= 0) goto out; + if(wrapper.GetIndex(error) != 0) goto out; + if(error < 0) goto out; error = wrapper.GetNextPacket(&record); if(error < 0) goto out; if(record != 1) goto out; + if(wrapper.GetIndex(error) != 1) goto out; + if(error < 0) goto out; error = wrapper.SetIndex(20); if(error >= 0) goto out; @@ -361,6 +370,8 @@ int TestErrors() goto out; if(record != 4) goto out; + if(wrapper.GetIndex(error) != 4) goto out; + if(error < 0) goto out; error = wrapper.GetNextPacket(&record); if(error >= 0) goto out; @@ -387,6 +398,7 @@ int SystemTest() hid_t dtypeID1, dtypeID2; unsigned int count; + int error; /* Creating two inter-related datatypes. Create two datasets and put * one datatype in each. */ @@ -452,6 +464,10 @@ int SystemTest() wrapper1.ResetIndex(); wrapper1.GetNextPacket(&ct1[1]); wrapper2.GetPacket(1, &ct2[2]); + if(wrapper1.GetIndex(error) != 1) goto out; + if(error < 0) goto out; + if(wrapper2.GetIndex(error) != 0) goto out; + if(error < 0) goto out; if(ct1[1].b != ct2[2].g.b) goto out; |