#define main economy_base_main #include "economy_probe.cpp" #undef main #include "src/server/common/economy_view.h" #include struct ViewDB:TestDB { std::string failing;bool failed=false; bool Query(const std::string& sql,Rows& rows) { if(!failing.empty()&&sql.find(failing)!=std::string::npos){failed=true;rows.clear();return false;} #ifndef PORT_ECONOMY_MYSQL if(sql=="SET TRANSACTION ISOLATION LEVEL REPEATABLE READ"){rows.clear();return true;} #endif return TestDB::Query(sql,rows); } bool Begin(){return TestDB::Begin();} bool Commit(){if(failing=="COMMIT"){failed=true;return false;}return TestDB::Commit();} }; int main(int argc,char** argv) { assert(argc==2||argc==3);economy_base_main(2,argv);address=argv[1];ViewDB db;reset(db); sql(db,"UPDATE item SET port_extra=X'"+std::string(138,'0')+"' WHERE id=10"); uint64_t id=listing(db);Request r=req(UiStatus);r.generation=123;r.reference=0;r.slot=0;memset(r.token,'0',32);r.token[32]=0; Store store(db,itemSize);assert(Valid(r)&&!store.Enqueue(r)); std::vector frames; assert(View(db,r,itemSize,frames));assert(frames.front()=="MTECON1 begin 123 0 0 1 0 0");assert(frames.back()=="MTECON1 end 123"); assert(frames[1].find("MTECON1 row 123 0 "+std::to_string(id)+" 750 1 0 100 5 1 123456 0 0")==0); assert(frames[2].find("MTECON1 meta 123 0 631100")==0); for(const auto& frame:frames)assert(frame.size()<240); if(argc==3){std::ofstream output(argv[2]);for(const auto& frame:frames)output<