initial code repo
[stor4nfv.git] / src / ceph / src / test / old / testfilepath.cc
diff --git a/src/ceph/src/test/old/testfilepath.cc b/src/ceph/src/test/old/testfilepath.cc
new file mode 100644 (file)
index 0000000..ac21e10
--- /dev/null
@@ -0,0 +1,22 @@
+
+#include "include/filepath.h"
+#include <iostream>
+using namespace std;
+
+int print(string s) {
+  filepath fp = s;
+  cout << "s = " << s << "   filepath = " << fp << endl;
+  cout << "  depth " << fp.depth() << endl;
+  for (int i=0; i<fp.depth(); i++) {
+    cout << "\t" << i << " " << fp[i] << endl;
+  }
+}
+
+int main() {
+  filepath p;
+  print("/home/sage");
+  print("a/b/c");
+  print("/a/b/c");
+  print("/a/b/c/");
+  print("/a/b/../d");
+}