]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/libcephfs: Fix telldir/seekdir test
authorSam Lang <sam.lang@inktank.com>
Wed, 17 Oct 2012 17:45:20 +0000 (12:45 -0500)
committerSam Lang <sam.lang@inktank.com>
Wed, 17 Oct 2012 17:50:48 +0000 (12:50 -0500)
Signed-off-by: Sam Lang <sam.lang@inktank.com>
src/test/libcephfs/test.cc

index 16ea07caf15bc79ad3c7da30294a5e3d46df0e29..bab4ebf905aa8d735b8a850021f072403272bb08 100644 (file)
@@ -166,19 +166,15 @@ TEST(LibCephFS, Dir_ls) {
     ASSERT_STREQ(result->d_name, entries[i].first);
   }
 
-  int t = ceph_telldir(cmount, ls_dir);
-  ASSERT_GT(t, -1);
-
   ceph_rewinddir(cmount, ls_dir);
 
-  // test seekdir - move to end
-  ceph_seekdir(cmount, ls_dir, t);
+  int t = ceph_telldir(cmount, ls_dir);
+  ASSERT_GT(t, -1);
 
-  // check that we're at the end
   ASSERT_TRUE(ceph_readdir(cmount, ls_dir) != NULL);
-  ASSERT_TRUE(ceph_readdir(cmount, ls_dir) == NULL);
 
-  ceph_rewinddir(cmount, ls_dir);
+  // test seekdir - move back to the beginning
+  ceph_seekdir(cmount, ls_dir, t);
 
   // test getdents
   struct dirent *getdents_entries;