diff --git a/cwGutimReg.cpp b/cwGutimReg.cpp index 47b6e6d..32e746c 100644 --- a/cwGutimReg.cpp +++ b/cwGutimReg.cpp @@ -183,7 +183,7 @@ cw::rc_t cw::gutim::reg::create( handle_t& hRef, const char* fname ) errLabel: if(rc != kOkRC ) - rc = _destroy(p); + _destroy(p); destroy(csvH); @@ -248,3 +248,30 @@ void cw::gutim::reg::report( handle_t h ) } } + + +cw::rc_t cw::gutim::reg::test( const object_t* cfg ) +{ + const char* dir = nullptr; + rc_t rc = kOkRC; + handle_t h; + + if((rc = cfg->getv("dir",dir)) != kOkRC ) + { + rc = cwLogError(rc,"The arg. parse GUTIM registry test."); + goto errLabel; + } + + if((rc = create(h,dir)) != kOkRC ) + { + rc = cwLogError(rc,"The GUTIM registry create failed."); + goto errLabel; + } + + report(h); + +errLabel: + destroy(h); + + return rc; +} diff --git a/cwGutimReg.h b/cwGutimReg.h index 1e79c8a..de25753 100644 --- a/cwGutimReg.h +++ b/cwGutimReg.h @@ -30,7 +30,7 @@ namespace cw file_t file_record( handle_t h, unsigned file_idx ); void report( handle_t h ); - + rc_t test( const object_t* cfg ); } }