rem: status_t status = waitForMessage(port,"File 2 renamed (should stay in query, time out):",B_TIMED_OUT,"_query_test_2_and_more"); if (status == B_ENTRY_REMOVED) waitForMessage(port,"Received B_ENTRY_REMOVED, now expecting file 2 to be added again:",B_ENTRY_CREATED,NULL);
add: status_t status = waitForMessage(port,"File 2 renamed (should stay in query, time out):", B_TIMED_OUT, "_query_test_2_and_more"); if (status == B_ENTRY_REMOVED) { waitForMessage(port,"Received B_ENTRY_REMOVED, now expecting file 2 to be added again:", B_ENTRY_CREATED, NULL); }
context: main(int argc,char **argv){	port_id port = create_port(100,"query port");	printf("port id = %ld\n",port);	printf("  B_ENTRY_REMOVED = %ld, B_ENTRY_CREATED = %ld\n\n",B_ENTRY_REMOVED,B_ENTRY_CREATED);	dev_t device = dev_for_path(".");	DIR *query = fs_open_live_query(device,"name=_query_test_*",B_LIVE_QUERY,port,12345);	createFile(1);	waitForMessage(port,"File 1 created:",B_ENTRY_CREATED,"_query_test_1");	createFile(2);	waitForMessage(port,"File 2 created:",B_ENTRY_CREATED,"_query_test_2");	BEntry *entry = getEntry(2);	if (entry->InitCheck() < B_OK) {		fprintf(stderr,"Could not get entry for file 2\n");		fs_close_query(query);		return -1;	}	entry->Rename("_some_other_name_");	waitForMessage(port,"File 2 renamed (should fall out of query):",B_ENTRY_REMOVED,NULL);	entry->Rename("_some_other_");	waitForMessage(port,"File 2 renamed again (should time out):",B_TIMED_OUT,NULL);	entry->Rename("_query_test_2");	waitForMessage(port,"File 2 renamed back (should be added to query):",B_ENTRY_CREATED,"_query_test_2");	entry->Rename("_query_test_2_and_more");	status_t status = waitForMessage(port,"File 2 renamed (should stay in query, time out):",B_TIMED_OUT,"_query_test_2_and_more");	if (status == B_ENTRY_REMOVED)		waitForMessage(port,"Received B_ENTRY_REMOVED, now expecting file 2 to be added again:",B_ENTRY_CREATED,NULL);	entry->Remove();	delete entry;	waitForMessage(port,"File 2 removed:",B_ENTRY_REMOVED,NULL);		entry = getEntry(1);	if (entry->InitCheck() < B_OK) {		fprintf(stderr,"Could not get entry for file 1\n");		fs_close_query(query);		return -1;	}	entry->Rename("_some_other_name_");	waitForMessage(port,"File 1 renamed (should fall out of query):",B_ENTRY_REMOVED,NULL);			entry->Remove();	delete entry;	waitForMessage(port,"File 1 removed (should time out):",B_TIMED_OUT,NULL);	fs_close_query(query);	return 0;}