Lines Matching defs:dir

134 static string get_shortest_relative_path(TestEntry *dir, TestEntry *entry);
397 BDirectory dir("/boot/home/Desktop");
398 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
399 BEntry entry(&dir, testEntry->cpath, traverse);
414 BDirectory dir(testEntry->super->cpath);
415 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
416 BEntry entry(&dir, testEntry->cname, traverse);
431 BDirectory dir(testEntry->super->super->cpath);
432 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
433 BEntry entry(&dir, entryName.c_str(), traverse);
547 // special cases (root dir)
553 // special cases (fs root dir)
698 // Haiku: Fails, because the implementation concatenates the dir and leaf
746 // Haiku: Fails, because the implementation concatenates the dir and leaf
752 // special cases (root dir)
755 BDirectory dir("/");
756 BEntry entry(&dir, ".");
759 // special cases (fs root dir)
762 BDirectory dir("/");
763 BEntry entry(&dir, "boot");
769 BDirectory dir("/");
770 BEntry entry(&dir, (const char*)NULL);
773 // bad args (NULL dir)
784 // strange args (badly initialized dir, absolute path)
787 BDirectory dir(badEntry1.cpath);
788 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
789 BEntry entry(&dir, "/tmp");
792 // bad args (NULL dir and path)
801 // bad args(NULL dir, absolute path)
880 BDirectory dir("/boot/home/Desktop");
881 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
882 status_t result = entry.SetTo(&dir, testEntry->cpath, traverse);
897 BDirectory dir(testEntry->super->cpath);
898 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
899 status_t result = entry.SetTo(&dir, testEntry->cname, traverse);
914 BDirectory dir(testEntry->super->super->cpath);
915 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
916 status_t result = entry.SetTo(&dir, entryName.c_str(), traverse);
1023 // special cases (root dir)
1028 // special cases (fs root dir)
1170 // Haiku: Fails, because the implementation concatenates the dir and leaf
1218 // Haiku: Fails, because the implementation concatenates the dir and leaf
1223 // special cases (root dir)
1226 BDirectory dir("/");
1227 CPPUNIT_ASSERT( entry.SetTo(&dir, ".") == B_OK );
1231 // special cases (fs root dir)
1234 BDirectory dir("/");
1235 CPPUNIT_ASSERT( entry.SetTo(&dir, "boot") == B_OK );
1242 BDirectory dir("/");
1243 CPPUNIT_ASSERT( entry.SetTo(&dir, (const char*)NULL) == B_OK );
1247 // bad args (NULL dir)
1260 // strange args (badly initialized dir, absolute path)
1263 BDirectory dir(badEntry1.cpath);
1264 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
1265 CPPUNIT_ASSERT( entry.SetTo(&dir, "/tmp") == B_OK );
1268 // bad args (NULL dir and path)
1279 // bad args(NULL dir, absolute path)
1331 // Haiku: Fails, because the implementation concatenates the dir and leaf
1335 BDirectory dir(tooLongDir16.super->super->cpath);
1337 CPPUNIT_ASSERT( entry.SetTo(&dir, entryName.c_str()) == B_OK );
1368 // parent of root dir
1386 // parent of root dir
1404 // ref for root dir
1419 BDirectory dir;
1424 //printf("path: `%s', dir: `%s', new name: `%s'\n", pathname.c_str(),
1442 CPPUNIT_ASSERT( dir.SetTo(dirname.c_str()) == B_OK );
1535 BDirectory dir;
1538 // same dir
1542 // different dir
1544 // different dir, existing file, clobber
1546 // different dir, existing file, no clobber
1548 // dir
1549 // same dir
1553 // different dir
1555 // different dir, existing file, clobber
1557 // different dir, existing file, no clobber
1560 // same dir
1564 // different dir
1566 // different dir, existing file, clobber
1568 // different dir, existing file, no clobber
1580 dir.Unset();
1590 dir.Unset();
1596 dir.Unset();
1602 dir.Unset();
1608 dir.Unset();
1640 BDirectory dir;
1654 //printf("path: `%s', dir: `%s', new name: `%s'\n", pathname.c_str(),
1672 CPPUNIT_ASSERT( dir.SetTo(dirname.c_str()) == B_OK );
1674 status_t result = entry.MoveTo(&dir, NULL, clobber);
1681 status_t result = entry.MoveTo(&dir, newName.c_str(), clobber);
1732 // Here is the right place to play a little bit with the dir and path
1779 BDirectory dir;
1783 // same dir
1786 // different dir
1788 // different dir, existing file, clobber
1790 // different dir, existing file, no clobber
1792 // dir
1793 // same dir
1796 // different dir
1798 // different dir, existing file, clobber
1800 // different dir, existing file, no clobber
1803 // same dir
1806 // different dir
1808 // different dir, existing file, clobber
1810 // different dir, existing file, no clobber
1815 // same dir
1821 // different dir
1823 // different dir, existing file, clobber
1825 // different dir, existing file, no clobber
1827 // dir
1828 // same dir
1834 // different dir
1836 // different dir, existing file, clobber
1838 // different dir, existing file, no clobber
1841 // same dir
1847 // different dir
1849 // different dir, existing file, clobber
1851 // different dir, existing file, no clobber
1857 CPPUNIT_ASSERT( dir.SetTo(dir1.super->cpath) == B_OK );
1858 CPPUNIT_ASSERT( entry.MoveTo(&dir, dir1.cname, true)
1864 dir.Unset();
1868 CPPUNIT_ASSERT( dir.SetTo(subDir1.super->cpath) == B_OK );
1869 CPPUNIT_ASSERT( entry.MoveTo(&dir, subDir1.cname, true) == B_OK );
1874 dir.Unset();
1877 CPPUNIT_ASSERT( dir.SetTo(dir2.cpath) == B_OK );
1878 CPPUNIT_ASSERT( entry.MoveTo(&dir) == B_ENTRY_NOT_FOUND );
1880 dir.Unset();
1883 CPPUNIT_ASSERT( dir.SetTo(dir2.cpath) == B_OK );
1884 CPPUNIT_ASSERT( entry.MoveTo(&dir) == B_NO_INIT );
1886 dir.Unset();
1889 CPPUNIT_ASSERT( dir.SetTo(dir2.cpath) == B_OK );
1890 CPPUNIT_ASSERT( entry.MoveTo(&dir) == B_NO_INIT );
1892 dir.Unset();
1893 // bad args (NULL dir)
1901 dir.Unset();
1903 // uninitialized dir, absolute path
1906 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
1907 CPPUNIT_ASSERT( entry.MoveTo(&dir, file3.cpath) == B_BAD_VALUE );
1910 dir.Unset();
1930 // empty dir
1936 // non-empty dir
2130 get_entry_ref_for_entry(const char *dir, const char *leaf, entry_ref *ref)
2132 status_t error = (dir && leaf ? B_OK : B_BAD_VALUE);
2134 if (lstat(dir, &dirStat) == 0) {
2211 // root dir
2220 // fs root dir
2278 EntryTest::CreateDir(const char *dir)
2280 if (dir && isHarmlessPathname(dir))
2281 execCommand(string("rm -rf ") + dir + " ; mkdir " + dir);
2381 // root dir for testing
2612 get_shortest_relative_path(TestEntry *dir, TestEntry *entry)
2615 // put all super directories (including dir itself) of the dir in a set
2618 for (TestEntry *superDir = dir;
2623 // find the first super dir that dir and entry have in common
2637 // entry == dir