Lines Matching refs:query

71 	virtual status_t push(Query &query) const = 0;
85 virtual status_t push(Query &query) const
87 return query.PushValue(value);
129 virtual status_t push(Query &query) const
131 return query.PushValue(value, caseInsensitive);
171 virtual status_t push(Query &query) const
173 return query.PushDate(value.String());
195 virtual status_t push(Query &query) const
197 return query.PushAttr(value.String());
241 virtual status_t push(Query &query) const
245 error = child->push(query);
281 virtual status_t push(Query &query) const
283 status_t error = ListNode::push(query);
285 error = query.PushOp(op);
407 static const char *testVolumeImage = "/tmp/query-test-image";
549 fApplication = new BTestApp("application/x-vnd.obos.query-test");
584 Query query;
585 // CPPUNIT_ASSERT( predicateNode.push(query) == pushResult );
586 status_t error = predicateNode.push(query);
594 // CPPUNIT_ASSERT( query.GetPredicate(&predicate) == getResult );
595 error = query.GetPredicate(&predicate);
602 CPPUNIT_ASSERT( (int32)query.PredicateLength()
610 Query query;
611 CPPUNIT_ASSERT( predicateNode.push(query) == pushResult );
614 CPPUNIT_ASSERT( query.GetPredicate(buffer, sizeof(buffer))
622 Query query;
623 CPPUNIT_ASSERT( predicateNode.push(query) == pushResult );
627 CPPUNIT_ASSERT( query.PredicateLength() == expectedLength );
632 Query query;
633 CPPUNIT_ASSERT( query.SetPredicate(predicateString.String()) == B_OK );
634 CPPUNIT_ASSERT( (int32)query.PredicateLength()
637 CPPUNIT_ASSERT( query.GetPredicate(&predicate) == B_OK );
685 Query query;
687 CPPUNIT_ASSERT( query.GetPredicate(&predicate) == B_NO_INIT );
690 Query query;
691 CPPUNIT_ASSERT( query.GetPredicate(buffer, sizeof(buffer))
783 Query query;
789 CPPUNIT_ASSERT( predicate1.push(query) == B_OK );
790 CPPUNIT_ASSERT( query.SetPredicate(predicate2.toString().String())
793 CPPUNIT_ASSERT( query.GetPredicate(&predicate) == B_OK );
799 Query query;
805 CPPUNIT_ASSERT( predicate1.push(query) == B_OK );
807 CPPUNIT_ASSERT( query.GetPredicate(&predicate) == B_OK );
809 CPPUNIT_ASSERT( query.SetPredicate(predicate2.toString().String())
811 CPPUNIT_ASSERT( query.GetPredicate(&predicate) == B_OK );
817 Query query;
823 CPPUNIT_ASSERT( predicate1.push(query) == B_OK );
824 CPPUNIT_ASSERT( (int32)query.PredicateLength()
826 CPPUNIT_ASSERT( query.SetPredicate(predicate2.toString().String())
829 CPPUNIT_ASSERT( query.GetPredicate(&predicate) == B_OK );
835 Query query;
836 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
840 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
841 CPPUNIT_ASSERT( query.Fetch() == B_OK );
842 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExistEither\"")
846 CPPUNIT_ASSERT( query.PushDate("20 May 2002") == B_OK );
847 CPPUNIT_ASSERT( query.PushValue((int32)42) == B_OK );
848 CPPUNIT_ASSERT( query.PushValue((uint32)42) == B_OK );
849 CPPUNIT_ASSERT( query.PushValue((int64)42) == B_OK );
850 CPPUNIT_ASSERT( query.PushValue((uint64)42) == B_OK );
851 CPPUNIT_ASSERT( query.PushValue((float)42) == B_OK );
852 CPPUNIT_ASSERT( query.PushValue((double)42) == B_OK );
853 CPPUNIT_ASSERT( query.PushValue("hello") == B_OK );
854 CPPUNIT_ASSERT( query.PushAttr("attribute") == B_OK );
855 CPPUNIT_ASSERT( query.PushOp(B_EQ) == B_OK );
857 CPPUNIT_ASSERT( query.PushDate("20 May 2002") == B_NOT_ALLOWED );
858 CPPUNIT_ASSERT( query.PushValue((int32)42) == B_NOT_ALLOWED );
859 CPPUNIT_ASSERT( query.PushValue((uint32)42) == B_NOT_ALLOWED );
860 CPPUNIT_ASSERT( query.PushValue((int64)42) == B_NOT_ALLOWED );
861 CPPUNIT_ASSERT( query.PushValue((uint64)42) == B_NOT_ALLOWED );
862 CPPUNIT_ASSERT( query.PushValue((float)42) == B_NOT_ALLOWED );
863 CPPUNIT_ASSERT( query.PushValue((double)42) == B_NOT_ALLOWED );
864 CPPUNIT_ASSERT( query.PushValue("hello") == B_NOT_ALLOWED );
865 CPPUNIT_ASSERT( query.PushAttr("attribute") == B_NOT_ALLOWED );
866 CPPUNIT_ASSERT( query.PushOp(B_EQ) == B_NOT_ALLOWED );
874 Query query;
875 CPPUNIT_ASSERT( query.SetPredicate(NULL) == B_BAD_VALUE );
876 CPPUNIT_ASSERT( query.SetPredicate("hello") == B_OK );
877 CPPUNIT_ASSERT( query.GetPredicate(NULL) == B_BAD_VALUE );
878 CPPUNIT_ASSERT( query.GetPredicate(NULL, 10) == B_BAD_VALUE );
895 BQuery query;
896 CPPUNIT_ASSERT( query.TargetDevice() == B_ERROR );
903 BQuery query;
904 CPPUNIT_ASSERT( query.SetVolume(NULL) == B_BAD_VALUE );
905 CPPUNIT_ASSERT( query.TargetDevice() == B_ERROR );
911 BQuery query;
914 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
915 CPPUNIT_ASSERT( query.TargetDevice() == B_ERROR );
920 BQuery query;
924 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
925 CPPUNIT_ASSERT( query.TargetDevice() == device );
932 BQuery query;
933 CPPUNIT_ASSERT( query.IsLive() == false );
938 BQuery query;
941 CPPUNIT_ASSERT( query.SetTarget(messenger) == B_BAD_VALUE );
942 CPPUNIT_ASSERT( query.IsLive() == false );
947 BQuery query;
950 CPPUNIT_ASSERT( query.SetTarget(messenger) == B_OK );
951 CPPUNIT_ASSERT( query.IsLive() == true );
957 Query query;
958 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
962 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
963 CPPUNIT_ASSERT( query.Fetch() == B_OK );
964 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_NOT_ALLOWED );
967 CPPUNIT_ASSERT( query.SetTarget(messenger) == B_NOT_ALLOWED );
973 Query query;
974 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
976 CPPUNIT_ASSERT( query.Fetch() == B_NO_INIT );
983 TestFetchPredicateInit(Query &query, TestSet &testSet, const char *mountPoint,
987 // init the query
988 CPPUNIT_ASSERT( query.SetPredicate(predicate) == B_OK );
991 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
992 CPPUNIT_ASSERT( query.Fetch() == B_OK );
1008 Query query;
1010 TestFetchPredicateInit(query, testSet, mountPoint, predicate, entries,
1013 while (query.GetNextEntry(&entry) == B_OK) {
1016 CPPUNIT_ASSERT( query.Rewind() == B_ERROR );
1018 CPPUNIT_ASSERT( query.CountEntries() == B_ERROR );
1025 CPPUNIT_ASSERT( query.GetNextEntry(&entry) == B_ENTRY_NOT_FOUND );
1029 Query query;
1031 TestFetchPredicateInit(query, testSet, mountPoint, predicate, entries,
1034 while (query.GetNextRef(&ref) == B_OK) {
1037 CPPUNIT_ASSERT( query.Rewind() == B_ERROR );
1039 CPPUNIT_ASSERT( query.CountEntries() == B_ERROR );
1045 CPPUNIT_ASSERT( query.GetNextRef(&ref) == B_ENTRY_NOT_FOUND );
1049 Query query;
1051 TestFetchPredicateInit(query, testSet, mountPoint, predicate, entries,
1056 while (query.GetNextDirents(ents, bufSize, 1) == 1) {
1059 CPPUNIT_ASSERT( query.Rewind() == B_ERROR );
1061 CPPUNIT_ASSERT( query.CountEntries() == B_ERROR );
1068 CPPUNIT_ASSERT( query.GetNextDirents(ents, bufSize, 1) == 0 );
1072 Query query;
1074 TestFetchPredicateInit(query, testSet, mountPoint, predicate, entries,
1081 while (query.GetNextDirents(ents, bufSize, 1) == 1) {
1084 CPPUNIT_ASSERT( query.Rewind() == B_ERROR );
1086 CPPUNIT_ASSERT( query.CountEntries() == B_ERROR );
1091 if (query.GetNextRef(&ref) == B_OK) {
1096 if (query.GetNextEntry(&entry) == B_OK) {
1103 CPPUNIT_ASSERT( query.GetNextEntry(&entry) == B_ENTRY_NOT_FOUND );
1104 CPPUNIT_ASSERT( query.GetNextRef(&ref) == B_ENTRY_NOT_FOUND );
1105 CPPUNIT_ASSERT( query.GetNextDirents(ents, bufSize, 1) == 0 );
1121 Query query;
1122 CPPUNIT_ASSERT( query.Fetch() == B_NO_INIT );
1127 Query query;
1130 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1131 CPPUNIT_ASSERT( query.Fetch() == B_NO_INIT );
1136 Query query;
1137 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
1139 CPPUNIT_ASSERT( query.Fetch() == B_NO_INIT );
1144 Query query;
1145 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"&&")
1149 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1150 CPPUNIT_ASSERT( query.Fetch() == B_BAD_VALUE );
1155 Query query;
1156 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
1160 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1161 CPPUNIT_ASSERT( query.Fetch() == B_OK );
1162 CPPUNIT_ASSERT( query.Fetch() == B_NOT_ALLOWED );
1206 Query query;
1207 CPPUNIT_ASSERT( query.Clear() == B_OK );
1212 Query query;
1213 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
1217 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1218 CPPUNIT_ASSERT( query.Fetch() == B_OK );
1219 CPPUNIT_ASSERT( query.Clear() == B_OK );
1220 CPPUNIT_ASSERT( query.Fetch() == B_NO_INIT );
1225 Query query;
1226 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
1230 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1231 CPPUNIT_ASSERT( query.Fetch() == B_OK );
1232 CPPUNIT_ASSERT( query.Clear() == B_OK );
1233 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
1236 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1237 CPPUNIT_ASSERT( query.Fetch() == B_OK );
1244 Query query;
1245 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
1249 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1250 CPPUNIT_ASSERT( query.Fetch() == B_OK );
1256 CPPUNIT_ASSERT( query.GetNextEntry(&entry) == B_ENTRY_NOT_FOUND );
1257 CPPUNIT_ASSERT( query.GetNextRef(&ref) == B_ENTRY_NOT_FOUND );
1258 CPPUNIT_ASSERT( query.GetNextDirents(ents, bufSize, 1) == 0 );
1263 Query query;
1269 CPPUNIT_ASSERT( query.GetNextEntry(&entry) == B_FILE_ERROR );
1270 CPPUNIT_ASSERT( query.GetNextRef(&ref) == B_FILE_ERROR );
1271 CPPUNIT_ASSERT( query.GetNextDirents(ents, bufSize, 1)
1277 Query query;
1278 CPPUNIT_ASSERT( query.SetPredicate("name=\"ThisShouldNotExist\"")
1282 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1283 CPPUNIT_ASSERT( query.Fetch() == B_OK );
1287 CPPUNIT_ASSERT( query.GetNextEntry(NULL) == B_BAD_VALUE );
1288 CPPUNIT_ASSERT( query.GetNextRef(NULL) == B_BAD_VALUE );
1290 CPPUNIT_ASSERT( equals(query.GetNextDirents(NULL, bufSize, 1),
1396 // empty query, add some files, remove some files
1399 Query query;
1400 CPPUNIT_ASSERT( query.SetPredicate("name=\"*Argh\"")
1404 CPPUNIT_ASSERT( query.SetVolume(&volume) == B_OK );
1405 CPPUNIT_ASSERT( query.SetTarget(target) == B_OK );
1406 CPPUNIT_ASSERT( query.Fetch() == B_OK );
1408 CPPUNIT_ASSERT( query.GetNextEntry(&entry) == B_ENTRY_NOT_FOUND );
1430 // non-empty query, add some files, remove some files
1433 Query query;
1435 CPPUNIT_ASSERT( query.SetTarget(target) == B_OK );
1442 TestFetchPredicateInit(query, testSet, testMountPoint,
1446 while (query.GetNextEntry(&entry) == B_OK) {
1453 CPPUNIT_ASSERT( query.GetNextEntry(&entry) == B_ENTRY_NOT_FOUND );