Ticket #18692: testquerysize.cpp

File testquerysize.cpp, 502 bytes (added by jeremy-list, 12 months ago)

An example program which triggers this bug.

Line 
1#include <Directory.h>
2#include <Query.h>
3#include <String.h>
4#include <Volume.h>
5
6int main(int argc, char **args) {
7 BQuery query;
8 {
9 BDirectory dir(".");
10 BVolume volume;
11 dir.GetVolume(&volume);
12 query.SetVolume(&volume);
13 }
14 for (int32 i = 0; i < 2048; i++) {
15 BString s;
16 s << i;
17 query.PushAttr("Category:Name");
18 query.PushString(s.String());
19 query.PushOp(B_EQ);
20 if (i > 0)
21 query.PushOp(B_OR);
22 }
23 query.Fetch();
24 entry_ref ref;
25 query.GetNextRef(&ref);
26}