Lines Matching refs:dir

118 		BDirectory dir;
119 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
125 BDirectory dir(existing);
126 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
130 BDirectory dir(nonExisting);
131 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
135 BDirectory dir((const char *)NULL);
136 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
140 BDirectory dir("");
142 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
146 BDirectory dir(existingFile);
148 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
152 BDirectory dir(tooLongEntryname);
153 CPPUNIT_ASSERT( dir.InitCheck() == B_NAME_TOO_LONG );
157 BDirectory dir(fileDirname);
159 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
167 BDirectory dir(&entry);
168 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
174 BDirectory dir(&entry);
175 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
179 BDirectory dir((BEntry *)NULL);
180 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
185 BDirectory dir(&entry);
186 CPPUNIT_ASSERT( equals(dir.InitCheck(), B_BAD_ADDRESS, B_BAD_VALUE) );
192 BDirectory dir(&entry);
194 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
201 BDirectory dir(&entry);
202 CPPUNIT_ASSERT( equals(dir.InitCheck(), B_BAD_ADDRESS, B_BAD_VALUE) );
212 BDirectory dir(&ref);
213 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
221 BDirectory dir(&ref);
222 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
226 BDirectory dir((entry_ref *)NULL);
227 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
235 BDirectory dir(&ref);
237 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
247 BDirectory dir(&nref);
248 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
252 BDirectory dir((node_ref *)NULL);
253 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
261 BDirectory dir(&nref);
263 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
271 BDirectory dir(&pathDir, existingRelSub);
272 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
278 BDirectory dir(&pathDir, existingSub);
279 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
285 BDirectory dir(&pathDir, nonExistingRel);
286 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
290 BDirectory dir((BDirectory *)NULL, (const char *)NULL);
291 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
295 BDirectory dir((BDirectory *)NULL, existingSub);
296 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
302 BDirectory dir(&pathDir, (const char *)NULL);
303 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
309 BDirectory dir(&pathDir, "");
310 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_ENTRY_NOT_FOUND);
316 BDirectory dir(&pathDir, existingRelFile);
318 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
324 BDirectory dir(&pathDir, tooLongRelEntryname);
325 CPPUNIT_ASSERT( dir.InitCheck() == B_NAME_TOO_LONG );
331 BDirectory dir(&pathDir, fileRelDirname);
333 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
350 BDirectory dir;
353 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
354 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
355 dir.Unset();
358 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
359 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
360 dir.Unset();
363 CPPUNIT_ASSERT( dir.SetTo((const char *)NULL) == B_BAD_VALUE );
364 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
365 dir.Unset();
368 CPPUNIT_ASSERT( dir.SetTo("") == B_ENTRY_NOT_FOUND );
369 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
370 dir.Unset();
374 CPPUNIT_ASSERT_EQUAL(dir.SetTo(existingFile), B_NOT_A_DIRECTORY);
375 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
376 dir.Unset();
379 CPPUNIT_ASSERT( dir.SetTo(tooLongEntryname) == B_NAME_TOO_LONG );
380 CPPUNIT_ASSERT( dir.InitCheck() == B_NAME_TOO_LONG );
381 dir.Unset();
384 CPPUNIT_ASSERT_EQUAL(dir.SetTo(fileDirname), B_ENTRY_NOT_FOUND);
385 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_ENTRY_NOT_FOUND);
386 dir.Unset();
392 CPPUNIT_ASSERT( dir.SetTo(&entry) == B_OK );
393 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
394 dir.Unset();
399 CPPUNIT_ASSERT( dir.SetTo(&entry) == B_ENTRY_NOT_FOUND );
400 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
401 dir.Unset();
404 CPPUNIT_ASSERT( dir.SetTo((BEntry *)NULL) == B_BAD_VALUE );
405 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
406 dir.Unset();
410 CPPUNIT_ASSERT( equals(dir.SetTo(&entry), B_BAD_ADDRESS, B_BAD_VALUE) );
411 CPPUNIT_ASSERT( equals(dir.InitCheck(), B_BAD_ADDRESS, B_BAD_VALUE) );
412 dir.Unset();
418 CPPUNIT_ASSERT_EQUAL(dir.SetTo(&entry), B_NOT_A_DIRECTORY);
419 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
420 dir.Unset();
426 CPPUNIT_ASSERT( equals(dir.SetTo(&entry), B_BAD_ADDRESS, B_BAD_VALUE) );
427 CPPUNIT_ASSERT( equals(dir.InitCheck(), B_BAD_ADDRESS, B_BAD_VALUE) );
428 dir.Unset();
436 CPPUNIT_ASSERT( dir.SetTo(&ref) == B_OK );
437 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
438 dir.Unset();
444 CPPUNIT_ASSERT( dir.SetTo(&ref) == B_ENTRY_NOT_FOUND );
445 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
446 dir.Unset();
449 CPPUNIT_ASSERT( dir.SetTo((entry_ref *)NULL) == B_BAD_VALUE );
450 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
451 dir.Unset();
458 CPPUNIT_ASSERT_EQUAL(dir.SetTo(&ref), B_NOT_A_DIRECTORY);
459 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
460 dir.Unset();
468 CPPUNIT_ASSERT( dir.SetTo(&nref) == B_OK );
469 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
470 dir.Unset();
473 CPPUNIT_ASSERT( dir.SetTo((node_ref *)NULL) == B_BAD_VALUE );
474 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
475 dir.Unset();
481 CPPUNIT_ASSERT_EQUAL(dir.SetTo(&nref), B_NOT_A_DIRECTORY);
482 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
483 dir.Unset();
489 CPPUNIT_ASSERT( dir.SetTo(&pathDir, existingRelSub) == B_OK );
490 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
491 dir.Unset();
496 CPPUNIT_ASSERT( dir.SetTo(&pathDir, existingSub) == B_BAD_VALUE );
497 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
498 dir.Unset();
503 CPPUNIT_ASSERT( dir.SetTo(&pathDir, nonExistingRel) == B_ENTRY_NOT_FOUND );
504 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
505 dir.Unset();
508 CPPUNIT_ASSERT( dir.SetTo((BDirectory *)NULL, (const char *)NULL) == B_BAD_VALUE );
509 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
510 dir.Unset();
513 CPPUNIT_ASSERT( dir.SetTo((BDirectory *)NULL, existingSub) == B_BAD_VALUE );
514 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
515 dir.Unset();
520 CPPUNIT_ASSERT( dir.SetTo(&pathDir, (const char *)NULL) == B_BAD_VALUE );
521 CPPUNIT_ASSERT( dir.InitCheck() == B_BAD_VALUE );
522 dir.Unset();
527 // BeOS R5 initializes dir to pathDir instead of B_ENTRY_NOT_FOUND
528 CPPUNIT_ASSERT_EQUAL(dir.SetTo(&pathDir, ""), B_ENTRY_NOT_FOUND);
529 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_ENTRY_NOT_FOUND);
530 dir.Unset();
536 CPPUNIT_ASSERT_EQUAL(dir.SetTo(&pathDir, existingRelFile),
538 CPPUNIT_ASSERT_EQUAL(dir.InitCheck(), B_NOT_A_DIRECTORY);
539 dir.Unset();
544 CPPUNIT_ASSERT( dir.SetTo(&pathDir, tooLongRelEntryname)
546 CPPUNIT_ASSERT( dir.InitCheck() == B_NAME_TOO_LONG );
547 dir.Unset();
552 CPPUNIT_ASSERT( dir.SetTo(&pathDir, fileRelDirname) == B_ENTRY_NOT_FOUND );
553 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
554 dir.Unset();
565 BDirectory dir;
566 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
568 CPPUNIT_ASSERT( dir.GetEntry(&entry) == B_NO_INIT );
569 dir.Unset();
573 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
574 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
575 CPPUNIT_ASSERT( dir.GetEntry(&entry) == B_OK );
577 dir.Unset();
583 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
584 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
585 CPPUNIT_ASSERT( dir.GetEntry((BEntry *)NULL) == B_BAD_VALUE );
586 dir.Unset();
591 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
592 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
593 CPPUNIT_ASSERT( dir.GetEntry(&entry) == B_NO_INIT );
594 dir.Unset();
604 BDirectory dir;
605 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
606 CPPUNIT_ASSERT( dir.IsRootDirectory() == false );
609 CPPUNIT_ASSERT( dir.SetTo("/boot") == B_OK );
610 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
611 CPPUNIT_ASSERT( dir.IsRootDirectory() == true );
614 CPPUNIT_ASSERT(dir.SetTo("/boot/system") == B_OK);
615 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
616 CPPUNIT_ASSERT_EQUAL(dir.IsRootDirectory(), true);
619 CPPUNIT_ASSERT( dir.SetTo("/tmp") == B_OK );
620 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
621 CPPUNIT_ASSERT( dir.IsRootDirectory() == false );
624 CPPUNIT_ASSERT( dir.SetTo("/") == B_OK );
625 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
626 CPPUNIT_ASSERT( dir.IsRootDirectory() == true );
665 BDirectory dir;
668 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
669 CPPUNIT_ASSERT( dir.FindEntry(existing, &entry) == B_OK );
674 dir.Unset();
679 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
680 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
681 CPPUNIT_ASSERT( dir.FindEntry(existing, &entry) == B_OK );
686 dir.Unset();
689 // existing path relative to current dir, uninitialized BDirectory
691 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
693 CPPUNIT_ASSERT( dir.FindEntry(existingRelSub, &entry) == B_OK );
698 dir.Unset();
702 // existing path relative to current dir,
703 // initialized BDirectory != current dir
705 CPPUNIT_ASSERT( dir.SetTo(existingSub) == B_OK );
706 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
709 CPPUNIT_ASSERT( dir.FindEntry(existingRelSub, &entry) == B_ENTRY_NOT_FOUND );
711 dir.Unset();
717 CPPUNIT_ASSERT( dir.SetTo(nonExistingSuper) == B_OK );
718 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
721 CPPUNIT_ASSERT( dir.FindEntry(nonExistingRel, &entry) == B_ENTRY_NOT_FOUND );
723 dir.Unset();
729 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
730 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
731 CPPUNIT_ASSERT( dir.FindEntry(existingRelSub, NULL) == B_BAD_VALUE );
733 CPPUNIT_ASSERT( dir.FindEntry(NULL, &entry) == B_BAD_VALUE );
735 CPPUNIT_ASSERT( dir.FindEntry(NULL, NULL) == B_BAD_VALUE );
736 dir.Unset();
741 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
742 CPPUNIT_ASSERT( dir.FindEntry(dirLink, &entry) == B_OK );
747 dir.Unset();
752 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
753 CPPUNIT_ASSERT( dir.FindEntry(dirLink, &entry, true) == B_OK );
758 dir.Unset();
763 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
764 CPPUNIT_ASSERT( dir.FindEntry(badLink, &entry) == B_OK );
769 dir.Unset();
774 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
775 CPPUNIT_ASSERT( dir.FindEntry(badLink, &entry, true) == B_ENTRY_NOT_FOUND );
777 dir.Unset();
782 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
783 CPPUNIT_ASSERT( dir.FindEntry(cyclicLink1, &entry) == B_OK );
788 dir.Unset();
793 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
794 CPPUNIT_ASSERT( dir.FindEntry(cyclicLink1, &entry, true) == B_LINK_LIMIT );
796 dir.Unset();
818 BDirectory dir(existing);
819 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
820 CPPUNIT_ASSERT( dir.Contains(existingSub) == true );
821 dir.Unset();
824 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
827 CPPUNIT_ASSERT( dir.Contains(existing) == true );
829 CPPUNIT_ASSERT( dir.Contains(existing) == false );
831 dir.Unset();
834 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
835 CPPUNIT_ASSERT( dir.Contains(nonExisting) == false );
836 dir.Unset();
839 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
840 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
843 CPPUNIT_ASSERT( dir.Contains(existing) == true );
845 CPPUNIT_ASSERT( dir.Contains(existing) == false );
847 dir.Unset();
850 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
851 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
852 CPPUNIT_ASSERT( dir.Contains(nonExisting) == false );
853 dir.Unset();
856 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
857 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
858 CPPUNIT_ASSERT( dir.Contains((const char*)NULL) == true );
859 dir.Unset();
862 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
863 CPPUNIT_ASSERT( dir.Contains((const char*)NULL) == false );
864 dir.Unset();
867 CPPUNIT_ASSERT( dir.SetTo(existingSuper) == B_OK );
868 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
869 CPPUNIT_ASSERT( dir.Contains(existingSub) == true );
870 dir.Unset();
873 CPPUNIT_ASSERT( dir.SetTo(existingSuper) == B_OK );
874 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
875 CPPUNIT_ASSERT( dir.Contains(existingRelSub) == false );
876 dir.Unset();
879 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
880 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
881 CPPUNIT_ASSERT( dir.Contains(existing) == true );
882 dir.Unset();
883 // existing entry (dir), initialized BDirectory, matching node kind
885 CPPUNIT_ASSERT( dir.SetTo(existingSuper) == B_OK );
886 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
887 CPPUNIT_ASSERT( dir.Contains(existing, B_DIRECTORY_NODE) == true );
888 dir.Unset();
889 // existing entry (dir), initialized BDirectory, mismatching node kind
891 CPPUNIT_ASSERT( dir.SetTo(existingSuper) == B_OK );
892 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
893 CPPUNIT_ASSERT( dir.Contains(existing, B_FILE_NODE) == false );
894 dir.Unset();
897 CPPUNIT_ASSERT( dir.SetTo(existingSuperFile) == B_OK );
898 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
899 CPPUNIT_ASSERT( dir.Contains(existingFile, B_FILE_NODE) == true );
900 dir.Unset();
903 CPPUNIT_ASSERT( dir.SetTo(existingSuperFile) == B_OK );
904 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
905 CPPUNIT_ASSERT( dir.Contains(existingFile, B_SYMLINK_NODE) == false );
906 dir.Unset();
909 CPPUNIT_ASSERT( dir.SetTo(dirSuperLink) == B_OK );
910 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
911 CPPUNIT_ASSERT( dir.Contains(dirLink, B_SYMLINK_NODE) == true );
912 dir.Unset();
915 CPPUNIT_ASSERT( dir.SetTo(dirSuperLink) == B_OK );
916 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
917 CPPUNIT_ASSERT( dir.Contains(dirLink, B_DIRECTORY_NODE) == false );
918 dir.Unset();
922 CPPUNIT_ASSERT( dir.SetTo(existingSuperFile) == B_OK );
923 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
924 CPPUNIT_ASSERT( dir.Contains(existingRelFile, B_FILE_NODE) == true );
925 dir.Unset();
929 CPPUNIT_ASSERT( dir.SetTo(existingSuperFile) == B_OK );
930 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
931 CPPUNIT_ASSERT( dir.Contains(existingRelFile, B_SYMLINK_NODE) == false );
932 dir.Unset();
937 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
938 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
941 CPPUNIT_ASSERT( dir.Contains(&entry) == true );
942 dir.Unset();
947 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
949 CPPUNIT_ASSERT( dir.Contains(&entry) == false );
950 dir.Unset();
954 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
956 CPPUNIT_ASSERT( dir.Contains(&entry) == false );
957 dir.Unset();
963 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
964 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
966 CPPUNIT_ASSERT( dir.Contains(&entry) == false );
967 dir.Unset();
971 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
972 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
974 CPPUNIT_ASSERT( dir.Contains(&entry) == false );
975 dir.Unset();
981 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
982 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
983 CPPUNIT_ASSERT( dir.Contains((const BEntry*)NULL) == false );
984 dir.Unset();
988 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
989 CPPUNIT_ASSERT( dir.Contains((const BEntry*)NULL) == false );
990 dir.Unset();
993 CPPUNIT_ASSERT( dir.SetTo(existingSuper) == B_OK );
994 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
996 CPPUNIT_ASSERT( dir.Contains(&entry) == true );
997 dir.Unset();
1003 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
1004 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1006 CPPUNIT_ASSERT( equals(dir.Contains(&entry), false, true) );
1007 dir.Unset();
1009 // existing entry (dir), initialized BDirectory, matching node kind
1011 CPPUNIT_ASSERT( dir.SetTo(existingSuper) == B_OK );
1012 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1014 CPPUNIT_ASSERT( dir.Contains(&entry, B_DIRECTORY_NODE) == true );
1015 dir.Unset();
1017 // existing entry (dir), initialized BDirectory, mismatching node kind
1019 CPPUNIT_ASSERT( dir.SetTo(existingSuper) == B_OK );
1020 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1022 CPPUNIT_ASSERT( dir.Contains(&entry, B_FILE_NODE) == false );
1023 dir.Unset();
1029 CPPUNIT_ASSERT( dir.SetTo(existingSuperFile) == B_OK );
1030 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1032 CPPUNIT_ASSERT( dir.Contains(&entry, B_FILE_NODE) == true );
1033 dir.Unset();
1038 CPPUNIT_ASSERT( dir.SetTo(existingSuperFile) == B_OK );
1039 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1041 CPPUNIT_ASSERT( dir.Contains(&entry, B_SYMLINK_NODE) == false );
1042 dir.Unset();
1048 CPPUNIT_ASSERT( dir.SetTo(dirSuperLink) == B_OK );
1049 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1051 CPPUNIT_ASSERT( dir.Contains(&entry, B_SYMLINK_NODE) == true );
1052 dir.Unset();
1059 CPPUNIT_ASSERT( dir.SetTo(dirSuperLink) == B_OK );
1060 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1062 CPPUNIT_ASSERT( dir.Contains(&entry, B_DIRECTORY_NODE) == false );
1063 dir.Unset();
1076 // uninitialized dir, existing entry, absolute path
1078 BDirectory dir;
1083 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
1084 CPPUNIT_ASSERT( dir.GetStatFor(existing, &stat1) == B_NO_INIT );
1085 dir.Unset();
1087 // badly initialized dir, existing entry, absolute path
1089 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
1090 CPPUNIT_ASSERT( dir.InitCheck() == B_ENTRY_NOT_FOUND );
1093 CPPUNIT_ASSERT( dir.GetStatFor(existing, &stat1) == B_NO_INIT );
1094 dir.Unset();
1096 // initialized dir, existing entry, absolute path
1098 CPPUNIT_ASSERT( dir.SetTo("/") == B_OK );
1099 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1102 CPPUNIT_ASSERT( dir.GetStatFor(existing, &stat1) == B_OK );
1106 dir.Unset();
1108 // initialized dir, existing entry, relative path
1110 CPPUNIT_ASSERT( dir.SetTo(existingSuper) == B_OK );
1111 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1114 CPPUNIT_ASSERT( dir.GetStatFor(existingRel, &stat1) == B_OK );
1118 dir.Unset();
1120 // initialized dir, non-existing entry, absolute path
1122 CPPUNIT_ASSERT( dir.SetTo("/") == B_OK );
1123 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1126 CPPUNIT_ASSERT( dir.GetStatFor(nonExisting, &stat1) == B_ENTRY_NOT_FOUND );
1127 dir.Unset();
1129 // initialized dir, bad args (NULL path)
1132 CPPUNIT_ASSERT( dir.SetTo("/") == B_OK );
1133 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1136 CPPUNIT_ASSERT( dir.GetStatFor(NULL, &stat1) == B_OK );
1140 dir.Unset();
1142 // initialized dir, bad args (empty path)
1145 CPPUNIT_ASSERT( dir.SetTo("/") == B_OK );
1146 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1147 CPPUNIT_ASSERT( dir.GetStatFor("", &stat1) == B_ENTRY_NOT_FOUND );
1148 dir.Unset();
1150 // initialized dir, bad args
1153 CPPUNIT_ASSERT( dir.SetTo("/") == B_OK );
1154 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1155 CPPUNIT_ASSERT( equals(dir.GetStatFor(existing, NULL), B_BAD_ADDRESS,
1157 CPPUNIT_ASSERT( equals(dir.GetStatFor(NULL, NULL), B_BAD_ADDRESS,
1159 dir.Unset();
1178 BDirectory dir(testDir1);
1179 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1181 CPPUNIT_ASSERT( dir.GetNextEntry(&entry) == B_ENTRY_NOT_FOUND );
1182 CPPUNIT_ASSERT( dir.Rewind() == B_OK );
1183 dir.Unset();
1188 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1189 CPPUNIT_ASSERT( dir.GetNextRef(&ref) == B_ENTRY_NOT_FOUND );
1190 CPPUNIT_ASSERT( dir.Rewind() == B_OK );
1191 dir.Unset();
1198 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1199 while (dir.GetNextDirents(ents, bufSize, 1) == 1)
1202 CPPUNIT_ASSERT( dir.Rewind() == B_OK );
1203 dir.Unset();
1208 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1209 CPPUNIT_ASSERT( dir.CountEntries() == 0 );
1210 dir.Unset();
1248 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1249 while (dir.GetNextEntry(&entry) == B_OK) {
1256 CPPUNIT_ASSERT( dir.Rewind() == B_OK );
1257 dir.Unset();
1264 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1265 while (dir.GetNextRef(&ref) == B_OK)
1268 CPPUNIT_ASSERT( dir.Rewind() == B_OK );
1269 dir.Unset();
1274 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1275 while (dir.GetNextDirents(ents, bufSize, 1) == 1)
1278 CPPUNIT_ASSERT( dir.Rewind() == B_OK );
1279 dir.Unset();
1284 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1285 CPPUNIT_ASSERT( dir.CountEntries() == 9 );
1286 CPPUNIT_ASSERT( dir.GetNextRef(&ref) == B_OK );
1287 CPPUNIT_ASSERT( dir.CountEntries() == 9 );
1288 dir.Unset();
1292 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1293 while (dir.GetNextDirents(ents, bufSize, 1) == 1) {
1295 if (dir.GetNextRef(&ref) == B_OK)
1297 if (dir.GetNextEntry(&entry) == B_OK) {
1307 CPPUNIT_ASSERT( dir.Rewind() == B_OK );
1308 dir.Unset();
1314 dir.Unset();
1316 CPPUNIT_ASSERT( dir.GetNextEntry(&entry) == B_FILE_ERROR );
1317 CPPUNIT_ASSERT( equals(dir.GetNextRef(&ref), B_NO_INIT, B_FILE_ERROR) );
1318 CPPUNIT_ASSERT( dir.Rewind() == B_FILE_ERROR );
1319 CPPUNIT_ASSERT( dir.GetNextDirents(ents, bufSize, 1) == B_FILE_ERROR );
1320 CPPUNIT_ASSERT( dir.CountEntries() == B_FILE_ERROR );
1321 dir.Unset();
1325 CPPUNIT_ASSERT( dir.SetTo(nonExisting) == B_ENTRY_NOT_FOUND );
1327 CPPUNIT_ASSERT( dir.GetNextEntry(&entry) == B_FILE_ERROR );
1328 CPPUNIT_ASSERT( equals(dir.GetNextRef(&ref), B_NO_INIT, B_FILE_ERROR) );
1329 CPPUNIT_ASSERT( dir.Rewind() == B_FILE_ERROR );
1330 CPPUNIT_ASSERT( dir.GetNextDirents(ents, bufSize, 1) == B_FILE_ERROR );
1331 CPPUNIT_ASSERT( dir.CountEntries() == B_FILE_ERROR );
1332 dir.Unset();
1338 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1339 CPPUNIT_ASSERT( dir.GetNextEntry(NULL) == B_BAD_VALUE );
1340 CPPUNIT_ASSERT( dir.GetNextRef(NULL) == B_BAD_VALUE );
1341 CPPUNIT_ASSERT( equals(dir.GetNextDirents(NULL, bufSize, 1),
1343 dir.Unset();
1353 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1354 CPPUNIT_ASSERT( dir.GetNextEntry(&entry, true) == B_OK );
1360 dir.Unset();
1377 BDirectory dir(testDir1);
1378 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1380 // dir doesn't already exist
1385 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), &subdir) == B_OK );
1394 // dir does already exist
1396 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), &subdir)
1405 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, true) == B_OK );
1413 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, false) == B_OK );
1421 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, true)
1430 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, &link)
1438 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, &link)
1444 dir.Unset();
1447 CPPUNIT_ASSERT( dir.SetTo(existing) == B_OK );
1449 // dir doesn't already exist
1452 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), &subdir) == B_OK );
1460 // dir does already exist
1462 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), &subdir)
1470 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, true) == B_OK );
1477 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, false) == B_OK );
1484 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, true)
1492 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, &link)
1500 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, &link)
1506 dir.Unset();
1509 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
1511 // dir doesn't already exist
1514 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), &subdir) == B_OK );
1522 // dir does already exist
1524 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), &subdir)
1532 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, true) == B_OK );
1539 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, false) == B_OK );
1546 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, true)
1554 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, &link)
1562 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, &link)
1568 dir.Unset();
1571 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
1574 // dir doesn't already exist
1577 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), &subdir) == B_OK );
1585 // dir does already exist
1587 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), &subdir)
1595 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, true) == B_OK );
1603 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, false) == B_OK );
1611 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), &file, true)
1619 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, &link)
1627 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, &link)
1634 dir.Unset();
1637 CPPUNIT_ASSERT( dir.SetTo(testDir1) == B_OK );
1641 CPPUNIT_ASSERT( equals(dir.CreateDirectory(NULL, &subdir),
1650 CPPUNIT_ASSERT( equals(dir.CreateFile(NULL, &file), B_ENTRY_NOT_FOUND,
1657 CPPUNIT_ASSERT( equals(dir.CreateSymLink(NULL, existingFile, &link),
1660 CPPUNIT_ASSERT( equals(dir.CreateSymLink(entryName.c_str(), NULL, &link),
1666 dir.Unset();
1669 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
1671 // dir doesn't already exist
1674 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), NULL) == B_OK );
1677 // dir does already exist
1679 CPPUNIT_ASSERT( dir.CreateDirectory(entryName.c_str(), NULL)
1686 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), NULL, true) == B_OK );
1691 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), NULL, false) == B_OK );
1696 CPPUNIT_ASSERT( dir.CreateFile(entryName.c_str(), NULL, true)
1702 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, NULL)
1708 CPPUNIT_ASSERT( dir.CreateSymLink(entryName.c_str(), existingFile, NULL)
1722 BDirectory dir;
1723 CPPUNIT_ASSERT( dir.InitCheck() == B_NO_INIT );
1724 BDirectory dir2(dir);
1728 // existing dir
1731 BDirectory dir(existing);
1732 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1733 BDirectory dir2(dir);
1741 BDirectory dir;
1743 dir2 = dir;
1749 BDirectory dir;
1752 dir2 = dir;
1756 // existing dir
1759 BDirectory dir(existing);
1760 CPPUNIT_ASSERT( dir.InitCheck() == B_OK );
1762 dir2 = dir;
1791 // existing dir
1814 // existing dir