Example #1
0
    void testGetBack() {
        FTList<int> listOfIntegers;

        listOfIntegers.push_back( 0);
        listOfIntegers.push_back( 1);
        listOfIntegers.push_back( 2);

        CPPUNIT_ASSERT( listOfIntegers.back() == 2);
    }
Example #2
0
    void testGetFront() {
        FTList<char> listOfChars;

        listOfChars.push_back( 'a');
        listOfChars.push_back( 'b');
        listOfChars.push_back( 'c');

        CPPUNIT_ASSERT( listOfChars.front() == 'a');
    }
Example #3
0
    void testPushBack() {
        FTList<float> listOfFloats;

        CPPUNIT_ASSERT( listOfFloats.size() == 0);

        listOfFloats.push_back( 0.1);
        listOfFloats.push_back( 1.2);
        listOfFloats.push_back( 2.3);

        CPPUNIT_ASSERT( listOfFloats.size() == 3);
    }
Example #4
0
RC FTIndexMgr::process(FTList& ftl,const PID& id,const PID& doc)
{
	const FTInfo *fti; RC rc=RC_OK; byte ext[XPINREFSIZE]; byte lext=0;
	PropertyID prev=STORE_INVALID_PROPID; long prevCnt=-1l;
	if (ftl.getCount()!=0) for (ftl.start(); (fti=ftl.next())!=NULL; ) {
		SearchKey key(fti->word,ushort(min(fti->lw,size_t(MAX_WORD_SIZE))));
		if (fti->propID!=prev || fti->count!=prevCnt) {
			PINRef pr(ctx->storeID,id); pr.def|=PR_U1; pr.u1=fti->propID;
			if (doc.pid!=STORE_INVALID_PID) {pr.def|=PR_PID2; pr.id2=doc;}
			if (fti->count!=1) {pr.def|=PR_COUNT; pr.count=fti->count;}
			prev=fti->propID; prevCnt=fti->count; lext=pr.enc(ext);
		}
		switch (fti->op) {
		default: assert(0);
		case OP_ADD: rc=indexFT.insert(key,ext,lext); break;
		case OP_DELETE: rc=indexFT.remove(key,ext,lext); break;
		}
		if (rc!=RC_OK) {
			report(MSG_ERROR,"FT %s failed, key: %.*s, id: "_LX_FM", rc:%d\n",fti->op==OP_ADD?"add":"del",fti->lw,fti->word,id.pid,rc);
			if (fti->op!=OP_DELETE || rc!=RC_NOTFOUND) break;
		}
	}
	return rc;
}
Example #5
0
 void testConstructor()
 {
     FTList<float> listOfFloats;
     
     CPPUNIT_ASSERT( listOfFloats.size() == 0);
 }