#include "MP_index.hpp" #include #include "MP_domain.hpp" #include "MP_set.hpp" #include "TestItem.hpp" using namespace flopc; bool indexTest() { TestItem *ti = new TestItem("flopc:indexTest"); MP_index idx; if(idx.isInstantiated()) {ti->failItem(__SPOT__); return false;} idx.instantiate(); if(!idx.isInstantiated()) {ti->failItem(__SPOT__); return false;} idx.unInstantiate(); if(idx.isInstantiated()) {ti->failItem(__SPOT__); return false;} idx.assign(3); if(idx.evaluate()!=3) {ti->failItem(__SPOT__); return false;} MP_index *pIdx = idx.getIndex(); if(pIdx!=&idx) { ti->failItem(__SPOT__); return false;} MP_index &any=MP_index::Any; MP_index &any2=MP_index::Any; if(&any!=&any2) {ti->failItem(__SPOT__); return false; } MP_index &empty=MP_index::getEmpty(); MP_index &empty2=MP_index::getEmpty(); if(&empty!=&empty2) { ti->failItem(__SPOT__); return false; } // test constant construction through add/subtr indices. Constant constant1 = idx+5; std::cout<<"How tell if this is successful?"<failItem(__SPOT__); return false;} std::cout<<"Is there a way to test the correctness of an MP_index_exp directly?"<passItem(); return true; }