Lines Matching refs:path

57 		BPath path;
58 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
59 CPPUNIT_ASSERT( path.Path() == NULL );
63 // absolute existing path (root dir), no leaf, no normalization
67 BPath path(pathName);
68 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
69 CPPUNIT_ASSERT( string(pathName) == path.Path() );
71 // absolute existing path, no leaf, no normalization
75 BPath path(pathName);
76 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
77 CPPUNIT_ASSERT( string(pathName) == path.Path() );
79 // absolute non-existing path, no leaf, no normalization
83 BPath path(pathName);
84 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
85 CPPUNIT_ASSERT( string(pathName) == path.Path() );
87 // absolute existing path (root dir), no leaf, auto normalization
92 BPath path(pathName);
93 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
94 CPPUNIT_ASSERT( string(normalizedPathName) == path.Path() );
96 // absolute existing path, no leaf, auto normalization
101 BPath path(pathName);
102 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
103 CPPUNIT_ASSERT( string(normalizedPathName) == path.Path() );
105 // absolute non-existing path, no leaf, auto normalization
109 BPath path(pathName);
110 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
111 CPPUNIT_ASSERT( path.Path() == NULL );
113 // absolute existing path (root dir), no leaf, normalization forced
117 BPath path(pathName, NULL, true);
118 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
119 CPPUNIT_ASSERT( string(pathName) == path.Path() );
121 // absolute existing path, no leaf, normalization forced
125 BPath path(pathName, NULL, true);
126 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
127 CPPUNIT_ASSERT( string(pathName) == path.Path() );
129 // absolute non-existing path, no leaf, normalization forced
133 BPath path(pathName, NULL, true);
134 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
135 CPPUNIT_ASSERT( path.Path() == NULL );
137 // relative existing path, no leaf, no normalization needed, but done
143 BPath path(pathName);
144 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
145 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
147 // relative non-existing path, no leaf, no normalization needed, but done
152 BPath path(pathName);
153 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
154 CPPUNIT_ASSERT( path.Path() == NULL );
156 // relative existing path, no leaf, auto normalization
162 BPath path(pathName);
163 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
164 CPPUNIT_ASSERT( string(normalizedPathName) == path.Path() );
166 // relative non-existing path, no leaf, auto normalization
171 BPath path(pathName);
172 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
173 CPPUNIT_ASSERT( path.Path() == NULL );
175 // relative existing path, no leaf, normalization forced
181 BPath path(pathName, NULL, true);
182 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
183 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
185 // relative non-existing path, no leaf, normalization forced
190 BPath path(pathName, NULL, true);
191 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
192 CPPUNIT_ASSERT( path.Path() == NULL );
194 // absolute existing path (root dir), leaf, no normalization
200 BPath path(pathName, leafName);
201 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
202 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
204 // absolute existing path, leaf, no normalization
210 BPath path(pathName, leafName);
211 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
212 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
214 // absolute non-existing path, leaf, no normalization
220 BPath path(pathName, leafName);
221 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
222 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
224 // absolute existing path (root dir), leaf, auto normalization
230 BPath path(pathName, leafName);
231 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
232 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
234 // absolute existing path, leaf, auto normalization
240 BPath path(pathName, leafName);
241 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
242 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
244 // absolute non-existing path, leaf, auto normalization
249 BPath path(pathName, leafName);
250 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
251 CPPUNIT_ASSERT( path.Path() == NULL );
253 // absolute non-existing path, leaf, normalization forced
258 BPath path(pathName, leafName, true);
259 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
260 CPPUNIT_ASSERT( path.Path() == NULL );
262 // relative existing path, leaf, no normalization needed, but done
269 BPath path(pathName, leafName);
270 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
271 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
273 // relative non-existing path, leaf, no normalization needed, but done
279 BPath path(pathName, leafName);
280 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
281 CPPUNIT_ASSERT( path.Path() == NULL );
283 // relative existing path, leaf, auto normalization
290 BPath path(pathName, leafName);
291 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
292 CPPUNIT_ASSERT( string(normalizedPathName) == path.Path() );
299 BPath path(pathName, leafName);
300 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
301 CPPUNIT_ASSERT( path.Path() == NULL );
306 BPath path((const char*)NULL, "test");
307 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
308 CPPUNIT_ASSERT( path.Path() == NULL );
313 BPath path((const char*)NULL);
314 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
315 CPPUNIT_ASSERT( path.Path() == NULL );
324 BPath path(&dir, NULL);
325 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
326 CPPUNIT_ASSERT( string(pathName) == path.Path() );
333 BPath path(&dir, NULL);
334 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
335 CPPUNIT_ASSERT( string(pathName) == path.Path() );
342 BPath path(&dir, NULL, true);
343 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
344 CPPUNIT_ASSERT( string(pathName) == path.Path() );
351 BPath path(&dir, NULL, true);
352 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
353 CPPUNIT_ASSERT( string(pathName) == path.Path() );
362 BPath path(&dir, leafName);
363 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
364 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
373 BPath path(&dir, leafName);
374 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
375 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
384 BPath path(&dir, leafName);
385 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
386 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
394 BPath path(&dir, leafName);
395 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
396 CPPUNIT_ASSERT( path.Path() == NULL );
402 BPath path(&dir, "test");
403 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
404 CPPUNIT_ASSERT( path.Path() == NULL );
410 BPath path(&dir, "test");
411 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
412 CPPUNIT_ASSERT( path.Path() == NULL );
419 BPath path((const BDirectory*)NULL, "test");
420 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
421 CPPUNIT_ASSERT( path.Path() == NULL );
426 BPath path((const BDirectory*)NULL, NULL);
427 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
428 CPPUNIT_ASSERT( path.Path() == NULL );
438 BPath path(&entry);
439 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
440 CPPUNIT_ASSERT( string(pathName) == path.Path() );
447 BPath path(&entry);
448 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
449 CPPUNIT_ASSERT( string(pathName) == path.Path() );
456 BPath path(&entry);
457 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
458 CPPUNIT_ASSERT( string(pathName) == path.Path() );
464 BPath path(&entry);
465 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
466 CPPUNIT_ASSERT( path.Path() == NULL );
472 BPath path(&entry);
473 CPPUNIT_ASSERT( equals(path.InitCheck(), B_NO_INIT, B_ENTRY_NOT_FOUND) );
474 CPPUNIT_ASSERT( path.Path() == NULL );
479 BPath path((const BEntry*)NULL);
480 CPPUNIT_ASSERT( equals(path.InitCheck(), B_NO_INIT, B_BAD_VALUE) );
481 CPPUNIT_ASSERT( path.Path() == NULL );
492 BPath path(&ref);
493 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
494 CPPUNIT_ASSERT( string(pathName) == path.Path() );
503 BPath path(&ref);
504 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
505 CPPUNIT_ASSERT( string(pathName) == path.Path() );
514 BPath path(&ref);
515 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
516 CPPUNIT_ASSERT( string(pathName) == path.Path() );
521 BPath path((const entry_ref*)NULL);
522 CPPUNIT_ASSERT( equals(path.InitCheck(), B_NO_INIT, B_BAD_VALUE) );
523 CPPUNIT_ASSERT( path.Path() == NULL );
531 BPath path;
541 // absolute existing path (root dir), no leaf, no normalization
544 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
545 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
546 CPPUNIT_ASSERT( string(pathName) == path.Path() );
547 path.Unset();
548 // absolute existing path, no leaf, no normalization
551 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
552 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
553 CPPUNIT_ASSERT( string(pathName) == path.Path() );
554 path.Unset();
555 // absolute non-existing path, no leaf, no normalization
558 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
559 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
560 CPPUNIT_ASSERT( string(pathName) == path.Path() );
561 path.Unset();
562 // absolute existing path (root dir), no leaf, auto normalization
566 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
567 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
568 CPPUNIT_ASSERT( string(normalizedPathName) == path.Path() );
569 path.Unset();
570 // absolute existing path, no leaf, auto normalization
574 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
575 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
576 CPPUNIT_ASSERT( string(normalizedPathName) == path.Path() );
577 path.Unset();
578 // absolute non-existing path, no leaf, auto normalization
581 CPPUNIT_ASSERT( path.SetTo(pathName) == B_ENTRY_NOT_FOUND );
582 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
583 CPPUNIT_ASSERT( path.Path() == NULL );
584 path.Unset();
585 // absolute existing path (root dir), no leaf, normalization forced
588 CPPUNIT_ASSERT( path.SetTo(pathName, NULL, true) == B_OK );
589 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
590 CPPUNIT_ASSERT( string(pathName) == path.Path() );
591 path.Unset();
592 // absolute existing path, no leaf, normalization forced
595 CPPUNIT_ASSERT( path.SetTo(pathName, NULL, true) == B_OK );
596 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
597 CPPUNIT_ASSERT( string(pathName) == path.Path() );
598 path.Unset();
599 // absolute non-existing path, no leaf, normalization forced
602 CPPUNIT_ASSERT( path.SetTo(pathName, NULL, true) == B_ENTRY_NOT_FOUND );
603 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
604 CPPUNIT_ASSERT( path.Path() == NULL );
605 path.Unset();
606 // relative existing path, no leaf, no normalization needed, but done
611 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
612 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
613 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
614 path.Unset();
615 // relative non-existing path, no leaf, no normalization needed, but done
620 CPPUNIT_ASSERT( path.SetTo(pathName) == B_ENTRY_NOT_FOUND );
621 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
622 CPPUNIT_ASSERT( path.Path() == NULL );
623 path.Unset();
624 // relative existing path, no leaf, auto normalization
629 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
630 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
631 CPPUNIT_ASSERT( string(normalizedPathName) == path.Path() );
632 path.Unset();
633 // relative non-existing path, no leaf, auto normalization
637 CPPUNIT_ASSERT( path.SetTo(pathName) == B_ENTRY_NOT_FOUND );
638 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
639 CPPUNIT_ASSERT( path.Path() == NULL );
640 path.Unset();
641 // relative existing path, no leaf, normalization forced
646 CPPUNIT_ASSERT( path.SetTo(pathName, NULL, true) == B_OK );
647 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
648 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
649 path.Unset();
650 // relative non-existing path, no leaf, normalization forced
654 CPPUNIT_ASSERT( path.SetTo(pathName, NULL, true) == B_ENTRY_NOT_FOUND );
655 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
656 CPPUNIT_ASSERT( path.Path() == NULL );
657 path.Unset();
658 // absolute existing path (root dir), leaf, no normalization
663 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_OK );
664 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
665 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
666 path.Unset();
667 // absolute existing path, leaf, no normalization
672 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_OK );
673 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
674 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
675 path.Unset();
676 // absolute non-existing path, leaf, no normalization
681 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_OK );
682 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
683 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
684 path.Unset();
685 // absolute existing path (root dir), leaf, auto normalization
690 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_OK );
691 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
692 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
693 path.Unset();
694 // absolute existing path, leaf, auto normalization
699 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_OK );
700 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
701 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
702 path.Unset();
703 // absolute existing path, leaf, self assignment
708 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
709 CPPUNIT_ASSERT( path.SetTo(path.Path(), ".///./") == B_OK );
710 CPPUNIT_ASSERT( string(pathName) == path.Path() );
711 CPPUNIT_ASSERT( path.SetTo(path.Path(), "..") == B_OK );
712 CPPUNIT_ASSERT( string("/boot") == path.Path() );
713 CPPUNIT_ASSERT( path.SetTo(path.Path(), leafName) == B_OK );
714 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
715 path.Unset();
716 // absolute non-existing path, leaf, auto normalization
720 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_ENTRY_NOT_FOUND );
721 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
722 CPPUNIT_ASSERT( path.Path() == NULL );
723 path.Unset();
724 // absolute non-existing path, leaf, normalization forced
728 CPPUNIT_ASSERT( path.SetTo(pathName, leafName, true) == B_ENTRY_NOT_FOUND );
729 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
730 CPPUNIT_ASSERT( path.Path() == NULL );
731 path.Unset();
732 // relative existing path, leaf, no normalization needed, but done
738 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_OK );
739 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
740 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
741 path.Unset();
742 // relative non-existing path, leaf, no normalization needed, but done
747 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_ENTRY_NOT_FOUND );
748 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
749 CPPUNIT_ASSERT( path.Path() == NULL );
750 path.Unset();
751 // relative existing path, leaf, auto normalization
757 CPPUNIT_ASSERT( path.SetTo(pathName, leafName) == B_OK );
758 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
759 CPPUNIT_ASSERT( string(normalizedPathName) == path.Path() );
760 path.Unset();
763 CPPUNIT_ASSERT( path.SetTo("/", "/boot") == B_BAD_VALUE );
764 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
765 CPPUNIT_ASSERT( path.Path() == NULL );
766 path.Unset();
769 CPPUNIT_ASSERT( path.SetTo((const char*)NULL, "test") == B_BAD_VALUE );
770 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
771 CPPUNIT_ASSERT( path.Path() == NULL );
772 path.Unset();
775 CPPUNIT_ASSERT( path.SetTo((const char*)NULL) == B_BAD_VALUE );
776 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
777 CPPUNIT_ASSERT( path.Path() == NULL );
778 path.Unset();
785 CPPUNIT_ASSERT( path.SetTo(&dir, NULL) == B_OK );
786 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
787 CPPUNIT_ASSERT( string(pathName) == path.Path() );
788 path.Unset();
794 CPPUNIT_ASSERT( path.SetTo(&dir, NULL) == B_OK );
795 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
796 CPPUNIT_ASSERT( string(pathName) == path.Path() );
797 path.Unset();
803 CPPUNIT_ASSERT( path.SetTo(&dir, NULL, true) == B_OK );
804 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
805 CPPUNIT_ASSERT( string(pathName) == path.Path() );
806 path.Unset();
812 CPPUNIT_ASSERT( path.SetTo(&dir, NULL, true) == B_OK );
813 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
814 CPPUNIT_ASSERT( string(pathName) == path.Path() );
815 path.Unset();
823 CPPUNIT_ASSERT( path.SetTo(&dir, leafName) == B_OK );
824 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
825 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
826 path.Unset();
834 CPPUNIT_ASSERT( path.SetTo(&dir, leafName) == B_OK );
835 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
836 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
837 path.Unset();
845 CPPUNIT_ASSERT( path.SetTo(&dir, leafName) == B_OK );
846 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
847 CPPUNIT_ASSERT( string(absolutePathName) == path.Path() );
848 path.Unset();
855 CPPUNIT_ASSERT( path.SetTo(&dir, leafName) == B_BAD_VALUE );
856 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
857 CPPUNIT_ASSERT( path.Path() == NULL );
858 path.Unset();
863 CPPUNIT_ASSERT( path.SetTo(&dir, "test") == B_BAD_VALUE );
864 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
865 CPPUNIT_ASSERT( path.Path() == NULL );
866 path.Unset();
871 CPPUNIT_ASSERT( path.SetTo(&dir, "test") == B_BAD_VALUE );
872 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
873 CPPUNIT_ASSERT( path.Path() == NULL );
874 path.Unset();
880 CPPUNIT_ASSERT( path.SetTo((const BDirectory*)NULL, "test") == B_BAD_VALUE );
881 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
882 CPPUNIT_ASSERT( path.Path() == NULL );
883 path.Unset();
887 CPPUNIT_ASSERT( path.SetTo((const BDirectory*)NULL, NULL) == B_BAD_VALUE );
888 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
889 CPPUNIT_ASSERT( path.Path() == NULL );
890 path.Unset();
899 CPPUNIT_ASSERT( path.SetTo(&entry) == B_OK );
900 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
901 CPPUNIT_ASSERT( string(pathName) == path.Path() );
902 path.Unset();
908 CPPUNIT_ASSERT( path.SetTo(&entry) == B_OK );
909 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
910 CPPUNIT_ASSERT( string(pathName) == path.Path() );
911 path.Unset();
917 CPPUNIT_ASSERT( path.SetTo(&entry) == B_OK );
918 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
919 CPPUNIT_ASSERT( string(pathName) == path.Path() );
920 path.Unset();
925 CPPUNIT_ASSERT( path.SetTo(&entry) == B_NO_INIT );
926 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
927 CPPUNIT_ASSERT( path.Path() == NULL );
928 path.Unset();
933 CPPUNIT_ASSERT( equals(path.SetTo(&entry), B_NO_INIT, B_ENTRY_NOT_FOUND) );
934 CPPUNIT_ASSERT( equals(path.InitCheck(), B_NO_INIT, B_ENTRY_NOT_FOUND) );
935 CPPUNIT_ASSERT( path.Path() == NULL );
936 path.Unset();
940 CPPUNIT_ASSERT( equals(path.SetTo((const BEntry*)NULL), B_NO_INIT,
942 CPPUNIT_ASSERT( equals(path.InitCheck(), B_NO_INIT, B_BAD_VALUE) );
943 CPPUNIT_ASSERT( path.Path() == NULL );
944 path.Unset();
953 CPPUNIT_ASSERT( path.SetTo(&ref) == B_OK );
954 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
955 CPPUNIT_ASSERT( string(pathName) == path.Path() );
956 path.Unset();
963 CPPUNIT_ASSERT( path.SetTo(&ref) == B_OK );
964 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
965 CPPUNIT_ASSERT( string(pathName) == path.Path() );
966 path.Unset();
973 CPPUNIT_ASSERT( path.SetTo(&ref) == B_OK );
974 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
975 CPPUNIT_ASSERT( string(pathName) == path.Path() );
976 path.Unset();
980 CPPUNIT_ASSERT( equals(path.SetTo((const entry_ref*)NULL), B_NO_INIT,
982 CPPUNIT_ASSERT( equals(path.InitCheck(), B_NO_INIT, B_BAD_VALUE) );
983 CPPUNIT_ASSERT( path.Path() == NULL );
984 path.Unset();
992 BPath path;
995 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
996 CPPUNIT_ASSERT( path.Append("test") == B_BAD_VALUE );
997 CPPUNIT_ASSERT( path.Path() == NULL );
998 path.Unset();
1001 CPPUNIT_ASSERT( path.SetTo("/") == B_OK );
1002 CPPUNIT_ASSERT( string("/") == path.Path() );
1003 CPPUNIT_ASSERT( path.Append("boot") == B_OK );
1004 CPPUNIT_ASSERT( string("/boot") == path.Path() );
1005 CPPUNIT_ASSERT( path.Append("home/Desktop") == B_OK );
1006 CPPUNIT_ASSERT( string("/boot/home/Desktop") == path.Path() );
1007 CPPUNIT_ASSERT( path.Append("non/existing") == B_OK );
1008 CPPUNIT_ASSERT( string("/boot/home/Desktop/non/existing") == path.Path() );
1010 CPPUNIT_ASSERT( path.Append("at/least/not//now") == B_ENTRY_NOT_FOUND );
1011 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
1012 CPPUNIT_ASSERT( path.Path() == NULL );
1013 path.Unset();
1016 CPPUNIT_ASSERT( path.SetTo("/boot") == B_OK );
1017 CPPUNIT_ASSERT( string("/boot") == path.Path() );
1018 CPPUNIT_ASSERT( path.Append("home/non-existing", true) == B_OK );
1019 CPPUNIT_ASSERT( string("/boot/home/non-existing") == path.Path() );
1020 CPPUNIT_ASSERT( path.Append("not/now", true) == B_ENTRY_NOT_FOUND );
1021 CPPUNIT_ASSERT( path.InitCheck() == B_ENTRY_NOT_FOUND );
1022 CPPUNIT_ASSERT( path.Path() == NULL );
1023 path.Unset();
1026 CPPUNIT_ASSERT( path.SetTo("/boot") == B_OK );
1027 CPPUNIT_ASSERT( path.Append(NULL) == B_OK );
1028 CPPUNIT_ASSERT( string("/boot") == path.Path() );
1029 CPPUNIT_ASSERT( path.SetTo("/boot") == B_OK );
1030 CPPUNIT_ASSERT( path.Append("/tmp") == B_BAD_VALUE );
1031 CPPUNIT_ASSERT( path.InitCheck() == B_BAD_VALUE );
1032 CPPUNIT_ASSERT( path.SetTo("/boot") == B_OK );
1033 CPPUNIT_ASSERT( path.Append("") == B_OK );
1034 CPPUNIT_ASSERT( string("/boot") == path.Path() );
1035 path.Unset();
1042 BPath path;
1045 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1046 CPPUNIT_ASSERT( path.Leaf() == NULL );
1047 path.Unset();
1050 CPPUNIT_ASSERT( path.SetTo("/") == B_OK );
1051 CPPUNIT_ASSERT( string("") == path.Leaf() );
1052 path.Unset();
1055 CPPUNIT_ASSERT( path.SetTo("/boot") == B_OK );
1056 CPPUNIT_ASSERT( string("boot") == path.Leaf() );
1057 CPPUNIT_ASSERT( path.SetTo("/boot/home") == B_OK );
1058 CPPUNIT_ASSERT( string("home") == path.Leaf() );
1059 CPPUNIT_ASSERT( path.SetTo("/boot/home/Desktop") == B_OK );
1060 CPPUNIT_ASSERT( string("Desktop") == path.Leaf() );
1061 path.Unset();
1064 CPPUNIT_ASSERT( path.SetTo("/non-existing") == B_OK );
1065 CPPUNIT_ASSERT( string("non-existing") == path.Leaf() );
1066 CPPUNIT_ASSERT( path.SetTo("/non/existing/dir") == B_OK );
1067 CPPUNIT_ASSERT( string("dir") == path.Leaf() );
1068 path.Unset();
1075 BPath path;
1081 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1082 CPPUNIT_ASSERT( path.GetParent(&parent) == B_NO_INIT );
1083 path.Unset();
1088 CPPUNIT_ASSERT( path.SetTo("/") == B_OK );
1089 CPPUNIT_ASSERT( path.GetParent(&parent) == B_ENTRY_NOT_FOUND );
1090 path.Unset();
1094 CPPUNIT_ASSERT( path.SetTo("/boot") == B_OK );
1095 CPPUNIT_ASSERT( path.GetParent(&parent) == B_OK );
1097 CPPUNIT_ASSERT( path.SetTo("/boot/home") == B_OK );
1098 CPPUNIT_ASSERT( path.GetParent(&parent) == B_OK );
1100 CPPUNIT_ASSERT( path.SetTo("/boot/home/Desktop") == B_OK );
1101 CPPUNIT_ASSERT( path.GetParent(&parent) == B_OK );
1103 path.Unset();
1107 CPPUNIT_ASSERT( path.SetTo("/non-existing") == B_OK );
1108 CPPUNIT_ASSERT( path.GetParent(&parent) == B_OK );
1110 CPPUNIT_ASSERT( path.SetTo("/non/existing/dir") == B_OK );
1111 CPPUNIT_ASSERT( path.GetParent(&parent) == B_OK );
1113 path.Unset();
1117 CPPUNIT_ASSERT( path.SetTo("/non/existing/dir") == B_OK );
1118 CPPUNIT_ASSERT( path.GetParent(&path) == B_OK );
1119 CPPUNIT_ASSERT( string("/non/existing") == path.Path() );
1120 CPPUNIT_ASSERT( path.GetParent(&path) == B_OK );
1121 CPPUNIT_ASSERT( string("/non") == path.Path() );
1122 CPPUNIT_ASSERT( path.GetParent(&path) == B_OK );
1123 CPPUNIT_ASSERT( string("/") == path.Path() );
1124 CPPUNIT_ASSERT( path.GetParent(&path) == B_ENTRY_NOT_FOUND );
1125 path.Unset();
1131 CPPUNIT_ASSERT( path.SetTo("/non/existing/dir") == B_OK );
1132 CPPUNIT_ASSERT( path.GetParent(NULL) == B_BAD_VALUE );
1133 path.Unset();
1142 BPath path;
1148 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1151 CPPUNIT_ASSERT( (path == path2) == true );
1152 CPPUNIT_ASSERT( (path != path2) == false );
1154 path.Unset();
1158 CPPUNIT_ASSERT( path.SetTo("/") == B_OK );
1160 CPPUNIT_ASSERT( (path == path2) == false );
1161 CPPUNIT_ASSERT( (path != path2) == true );
1162 path.Unset();
1166 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1168 CPPUNIT_ASSERT( (path == path2) == false );
1169 CPPUNIT_ASSERT( (path != path2) == true );
1170 path.Unset();
1178 CPPUNIT_ASSERT( path.SetTo(paths[i]) == B_OK );
1180 CPPUNIT_ASSERT( (path == path2) == (i == k) );
1181 CPPUNIT_ASSERT( (path != path2) == (i != k) );
1184 path.Unset();
1191 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1193 CPPUNIT_ASSERT( (path == pathName) == false );
1194 CPPUNIT_ASSERT( (path != pathName) == true );
1195 path.Unset();
1200 CPPUNIT_ASSERT( path.SetTo(paths[i]) == B_OK );
1202 CPPUNIT_ASSERT( (path == pathName) == (i == k) );
1203 CPPUNIT_ASSERT( (path != pathName) == (i != k) );
1206 path.Unset();
1208 // R5: initialized path equals NULL argument!
1209 // R5: uninitialized path does not equal NULL argument!
1211 CPPUNIT_ASSERT( path.SetTo("/") == B_OK );
1214 CPPUNIT_ASSERT( (path == pathName) == false );
1215 CPPUNIT_ASSERT( (path != pathName) == true );
1217 path.Unset();
1218 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1220 CPPUNIT_ASSERT( (path == pathName) == true );
1221 CPPUNIT_ASSERT( (path != pathName) == false );
1223 path.Unset();
1234 BPath path;
1235 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1236 BPath path2(path);
1242 BPath path("/boot/home/Desktop");
1243 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
1244 BPath path2(path);
1246 CPPUNIT_ASSERT( path == path2 );
1253 BPath path;
1255 path2 = path;
1256 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1261 BPath path;
1264 path2 = path;
1265 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1271 BPath path("/boot/home");
1272 CPPUNIT_ASSERT( path.InitCheck() == B_OK );
1274 path2 = path;
1276 CPPUNIT_ASSERT( path == path2 );
1303 BPath path;
1307 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1308 CPPUNIT_ASSERT( path.IsFixedSize() == false );
1309 CPPUNIT_ASSERT( path.TypeCode() == B_REF_TYPE );
1310 CPPUNIT_ASSERT( path.AllowsTypeCode(B_REF_TYPE) == true );
1311 CPPUNIT_ASSERT( path.AllowsTypeCode(B_STRING_TYPE) == false );
1312 CPPUNIT_ASSERT( path.AllowsTypeCode(B_FLOAT_TYPE) == false );
1313 path.Unset();
1316 CPPUNIT_ASSERT( path.SetTo("/boot/home") == B_OK );
1317 CPPUNIT_ASSERT( path.IsFixedSize() == false );
1318 CPPUNIT_ASSERT( path.TypeCode() == B_REF_TYPE );
1319 CPPUNIT_ASSERT( path.AllowsTypeCode(B_REF_TYPE) == true );
1320 CPPUNIT_ASSERT( path.AllowsTypeCode(B_STRING_TYPE) == false );
1321 CPPUNIT_ASSERT( path.AllowsTypeCode(B_FLOAT_TYPE) == false );
1322 path.Unset();
1328 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1329 ssize_t size = path.FlattenedSize();
1331 CPPUNIT_ASSERT( path.Flatten(buffer, sizeof(buffer)) == B_OK );
1332 CPPUNIT_ASSERT( path.Unflatten(B_REF_TYPE, buffer, size) == B_OK );
1333 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1334 path.Unset();
1342 // init the path and get an equivalent entry ref
1343 CPPUNIT_ASSERT( path.SetTo(pathName) == B_OK );
1348 // flatten the path
1350 size = path.FlattenedSize();
1354 CPPUNIT_ASSERT( path.Flatten(buffer, sizeof(buffer)) == B_OK );
1360 // unflatten the path
1361 path.Unset();
1362 CPPUNIT_ASSERT( path.InitCheck() == B_NO_INIT );
1363 CPPUNIT_ASSERT( path.Unflatten(B_REF_TYPE, buffer, size) == B_OK );
1364 CPPUNIT_ASSERT( path == pathName );
1365 path.Unset();
1371 CPPUNIT_ASSERT( path.SetTo("/boot/home") == B_OK );
1373 CPPUNIT_ASSERT( path.Flatten(NULL, sizeof(buffer)) == B_BAD_VALUE );
1374 CPPUNIT_ASSERT( path.Flatten(buffer, path.FlattenedSize() - 2)
1377 path.Unset();