Commits

Anonymous committed 820eb8d

ENIF'd yatce; passed 267/271 tests.

Comments (0)

Files changed (7)

 #include <stdbool.h>
 #include <stdint.h>
 
+struct kv_pair{
+  ERL_NIF_TERM key;
+  ERL_NIF_TERM value;
+  ErlNifEnv * env;
+};
+
 static int my_enif_get_string(ErlNifEnv *env, ERL_NIF_TERM list, char* buf){ //thx to vostok92
   ERL_NIF_TERM head, tail;
   int val;
   return enif_make_atom(env, "ok");
 }
 
+
+void * put_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  struct kv_pair * pair = (struct kv_pair*)arg;
+  ErlNifBinary key_bin, value_bin;
+  if( enif_inspect_binary(pair->env, pair->key, &key_bin) 
+      && enif_inspect_binary(pair->env, pair->value, &value_bin) ){
+    bool result = tcadbput( tcadb, key_bin.data, key_bin.size, value_bin.data, value_bin.size );
+    return (void*)result;
+  }
+  return NULL;
+}
 static ERL_NIF_TERM ytcadb_put(ErlNifEnv * env, ERL_NIF_TERM string_tablename, ERL_NIF_TERM key, ERL_NIF_TERM value){
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  struct kv_pair pair = {key, value, env};
   
-  return enif_make_atom(env, "not_yet_implemented");
+  my_enif_get_string(env, string_tablename, tablename);
+  void * ret = operate_on_hash_entry(map, tablename, put_operation_, &pair );
+  
+  if( ret != NULL ){
+    return enif_make_atom(env, "ok");
+  }
+  return enif_make_atom(env, "error");
+}
+void * putkeep_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  struct kv_pair * pair = (struct kv_pair*)arg;
+  ErlNifBinary key_bin, value_bin;
+  if( enif_inspect_binary(pair->env, pair->key, &key_bin) 
+      && enif_inspect_binary(pair->env, pair->value, &value_bin) ){
+    bool result = tcadbputkeep( tcadb, key_bin.data, key_bin.size, value_bin.data, value_bin.size );
+    return (void*)result;
+  }
+  return NULL;
 }
 static ERL_NIF_TERM ytcadb_putkeep(ErlNifEnv * env, ERL_NIF_TERM string_tablename, ERL_NIF_TERM key, ERL_NIF_TERM value){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  struct kv_pair pair = {key, value, env};
+  
+  my_enif_get_string(env, string_tablename, tablename);
+  void * ret = operate_on_hash_entry(map, tablename, putkeep_operation_, &pair );
+  
+  if( ret != NULL ){
+    return enif_make_atom(env, "ok");
+  }
+  return enif_make_atom(env, "error");
+}
+
+
+void * out_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  struct kv_pair * pair = (struct kv_pair*)arg;
+  ErlNifBinary key_bin;
+  if( enif_inspect_binary(pair->env, pair->key, &key_bin) ){
+    if( tcadbout( tcadb, key_bin.data, key_bin.size) ){
+      return arg;
+    }
+  }
+  return NULL;
+}
 static ERL_NIF_TERM ytcadb_out(ErlNifEnv * env, ERL_NIF_TERM string_tablename, ERL_NIF_TERM key){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  struct kv_pair pair = {key, 0, env};
+  
+  my_enif_get_string(env, string_tablename, tablename);
+  
+  if( operate_on_hash_entry(map, tablename, out_operation_, &pair ) ){
+    return enif_make_atom(env, "ok");
+  }
+  return enif_make_atom(env, "error");
+}
+
+void * get_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  struct kv_pair * pair = (struct kv_pair*)arg;
+  ErlNifBinary key_bin;
+  ErlNifBinary * value_bin = (ErlNifBinary*)enif_alloc(pair->env,sizeof(ErlNifBinary));
+  if( enif_inspect_binary(pair->env, pair->key, &key_bin) ){
+    int size;
+    char * tmp_value = tcadbget( tcadb, key_bin.data, key_bin.size, &size );
+    if( tmp_value != NULL ){
+      if( enif_alloc_binary(pair->env, size, value_bin) ){
+	memcpy(value_bin->data, tmp_value, size);
+	tcfree(tmp_value);
+	return value_bin;
+      }
+      tcfree(tmp_value);
+    }
+  }
+  return NULL;
+}
+
 static ERL_NIF_TERM ytcadb_get(ErlNifEnv * env, ERL_NIF_TERM string_tablename, ERL_NIF_TERM key){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  struct kv_pair pair = {key, 0, env};
+  
+  my_enif_get_string(env, string_tablename, tablename);
+  ErlNifBinary * ret = operate_on_hash_entry(map, tablename, get_operation_, &pair );
+  
+  if( ret != NULL ){
+    return enif_make_tuple(env, 2, enif_make_atom(env, "ok"), enif_make_binary(env, ret));
+  }
+  return enif_make_atom(env, "error");
+}
+
+void * iterinit_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  return (( tcadbiterinit( tcadb ) )? value :  NULL );
+}
 static ERL_NIF_TERM ytcadb_iterinit(ErlNifEnv * env, ERL_NIF_TERM string_tablename){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  my_enif_get_string(env, string_tablename, tablename);
+  void * ret = operate_on_hash_entry(map, tablename, iterinit_operation_, NULL );
+  if( ret != NULL ){
+    return enif_make_atom(env, "ok");
+  }
+  return enif_make_atom(env, "error");
+}
+
+void * iternext_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  struct kv_pair * pair = (struct kv_pair*)arg;
+  ErlNifBinary * key_bin = (ErlNifBinary*)enif_alloc(pair->env,sizeof(ErlNifBinary));
+
+  int size;
+  char * tmp_value = tcadbiternext( tcadb, &size );
+  if( tmp_value != NULL ){
+    if( enif_alloc_binary(pair->env, size, key_bin) ){
+      memcpy(key_bin->data, tmp_value, size);
+      tcfree(tmp_value);
+      return key_bin;
+    }
+    tcfree(tmp_value);
+  }
+  return NULL;
+}
 static ERL_NIF_TERM ytcadb_iternext(ErlNifEnv * env, ERL_NIF_TERM string_tablename){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  struct kv_pair pair = {0, 0, env};
+  
+  my_enif_get_string(env, string_tablename, tablename);
+  ErlNifBinary * ret = operate_on_hash_entry(map, tablename, iternext_operation_, &pair );
+  
+  if( ret != NULL ){
+    return enif_make_tuple(env, 2, enif_make_atom(env, "ok"), enif_make_binary(env, ret));
+  }
+  return enif_make_atom(env, "end_of_data");
+}
+
+void * sync_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  return (( tcadbsync( tcadb ) )? value :  NULL );
+}
 static ERL_NIF_TERM ytcadb_sync(ErlNifEnv * env, ERL_NIF_TERM string_tablename){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  my_enif_get_string(env, string_tablename, tablename);
+  void * ret = operate_on_hash_entry(map, tablename, sync_operation_, NULL );
+  if( ret != NULL ){
+    return enif_make_atom(env, "ok");
+  }
+  return enif_make_atom(env, "error");
+}
+
+void * vanish_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  return (( tcadbvanish( tcadb ) )? value :NULL);
+}
 static ERL_NIF_TERM ytcadb_vanish(ErlNifEnv * env, ERL_NIF_TERM string_tablename){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  my_enif_get_string(env, string_tablename, tablename);
+  void * ret = operate_on_hash_entry(map, tablename, vanish_operation_, NULL );
+  if( ret != NULL ){
+    return enif_make_atom(env, "ok");
+  }
+  return enif_make_atom(env, "error");
+}
+
 static ERL_NIF_TERM ytcadb_copy(ErlNifEnv * env, ERL_NIF_TERM string_tablename, ERL_NIF_TERM string_filename){
   return enif_make_atom(env, "not_yet_implemented");}
+
+void * path_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  return (void*)tcadbpath(tcadb); 
+}
 static ERL_NIF_TERM ytcadb_path(ErlNifEnv * env, ERL_NIF_TERM string_tablename){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  my_enif_get_string(env, string_tablename, tablename);
+  const char * ret = (const char*)operate_on_hash_entry(map, tablename, path_operation_, NULL );
+  if( ret != NULL ){
+    return enif_make_tuple(env, 2, enif_make_atom(env, "ok"), enif_make_string(env, ret) );
+  }
+  return enif_make_atom(env, "error");
+}
+
+void * rnum_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  uint64_t * rnum = (uint64_t*)arg;
+  *rnum = tcadbrnum(tcadb); 
+  return NULL;
+}
 static ERL_NIF_TERM ytcadb_rnum(ErlNifEnv * env, ERL_NIF_TERM string_tablename){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  my_enif_get_string(env, string_tablename, tablename);
+  uint64_t rnum = 0xffff;
+  operate_on_hash_entry(map, tablename, rnum_operation_, (void*)&rnum );
+  return enif_make_int(env, rnum);
+}
+void * size_operation_(void * arg, const char * key, void * value ){
+  TCADB * tcadb = (TCADB*)value;
+  uint64_t * size = (uint64_t*)arg;
+  *size = tcadbsize(tcadb); 
+  return NULL;
+}
 static ERL_NIF_TERM ytcadb_size(ErlNifEnv * env, ERL_NIF_TERM string_tablename){
-  return enif_make_atom(env, "not_yet_implemented");}
+  char tablename[1024];
+  hash_map_t * map = (hash_map_t*) enif_get_data(env);
+  my_enif_get_string(env, string_tablename, tablename);
+  uint64_t size = 0xffff;
+  operate_on_hash_entry(map, tablename, size_operation_, (void*)&size );
+  return enif_make_int(env, size);
+}
 
 
 int load_(ErlNifEnv *env, void ** priv_data, ERL_NIF_TERM load_info){
 %% $ escript tctest.erl <path to libyatce.so>
 tcadb_test()->
 %    io:format("~p~n", [YatceLib]),
-    T = yatce:db('/tmp/test.tch', []),                 % tcadbnew()
-    {ok,opened} =T:open(),                                % tcadbopen()
+    T= 'test.tch',
+    ok=tcadb:open(T,[]),                                % tcadbopen()
     str_str(T),
     str_int(T),
     str_bin(T),
-    {ok, sync} = T:sync(),
-    {ok, vanished} = T:vanish(), io:format( "~p~n", ["vanish passed."]),
-    io:format("tcadb:path/0 -> ~p, tcadb:rnum/0 -> ~p, tcadb:size/0 -> ~p~n", [T:path(), T:rnum(), T:size()]),
+    ok = tcadb:sync(T),
+    ok = tcadb:vanish(T), io:format( "~p~n", ["vanish passed."]),
+    io:format("tcadb:path/0 -> ~p, tcadb:rnum/0 -> ~p, tcadb:size/0 -> ~p~n",
+	      [tcadb:path(T), tcadb:rnum(T), tcadb:size(T)]),
     str_tuple(T),
     str_ref(T),
-    {ok, closed} = T:close().
+    ok = tcadb:close(T).
 
 str_str(T)->
-    {ok,inserted}=T:put("key","value"),
-    {ok,"value"} =T:get("key"),
+    ok=tcadb:put(T,"key","value"),
+    {ok,"value"} =tcadb:get(T,"key"),
     io:format( "~p~n", ["-str_str passed."]),
-    {ok,deleted}=T:out("key"),
-    {error,record_doesnt_exist}=T:get("key").
+    ok=tcadb:out(T,"key").
 
 str_int(T)->    
-    {ok,inserted}=T:put("key2", 12),
-    {ok,12} =T:get("key2"),
+    ok=tcadb:put(T,"key2", 12),
+    {ok,12}=tcadb:get(T,"key2"),
     io:format( "~p~n", ["str_int passed."]).
 
 str_bin(T)->    
-    {ok,inserted}=T:put("key2", <<"binary!!!!">>),
-    {ok,<<"binary!!!!">>} =T:get("key2"),
+    ok=tcadb:put(T,"key2", <<"binary!!!!">>),
+    {ok,<<"binary!!!!">>} =tcadb:get(T,"key2"),
     io:format( "~p~n", ["str_bin passed."]).
 
 str_tuple(T)->    
     Key = {key, hoge}, Value = <<"binary!!!!">>,
-    {ok,inserted}=T:put(Key, Value),
-    {ok,Value} =T:get(Key),
+    ok=tcadb:put(T,Key, Value),
+    {ok,Value} =tcadb:get(T,Key),
     io:format( "~p passed.~n", [str_tuple]).
 
 str_ref(T)->    
     Key = hage_hoge_ref, Value = make_ref(),
-    {ok,inserted}=T:put(Key, Value),
-    {ok,Value} =T:get(Key),
+    ok=tcadb:put(T,Key, Value),
+    {ok,Value} =tcadb:get(T,Key),
     io:format( "~p passed.~n", [str_ref]).
 
 iter()->
     List=[{"key","value"}, {"afkls;d", 23536}, {"afd;sj", <<"q34refdv]90i">>}],
-    T=yatce:db('/tmp/test2_iter.tch', []),
-    {ok,opened}=T:open(),
-    {ok,init}=T:iterinit(),
+    T='test2_iter.tch',
+    ok=tcadb:open(T,[]),
+    ok=tcadb:iterinit(T),
     ok = insert_all(T,List),
     ok = iter_(T,List),
-    {ok,closed}=T:close().
+    ok =tcadb:close(T).
 
 insert_all(_, [])-> ok;
 insert_all(T, List) ->
     {Key,Value} = hd(List),
-    {ok, inserted} = T:put(Key,Value),
+    ok = tcadb:put(T,Key,Value),
     insert_all(T,tl(List)).
 
 iter_(_,[])-> 
     io:format( "~p~n", ["iter passed."]);
 iter_(T,List) ->
-    {ok,Key}=T:iternext(),
-    {ok,Value}=T:get(Key),    
+    {ok,Key}=tcadb:iternext(T),
+    {ok,Value}=tcadb:get(T,Key),    
     case lists:member({Key,Value}, List) of
 	true ->
 	    iter_(T, lists:subtract(List, [{Key,Value}]));
 main(_Argv)->
 %    [YatceLib|_] = Argv,
     code:add_path("./ebin"),
-    ok=application:start(yatce),
-%    erlang:display( application:get_env(yatce, libdir) ),
-%    {ok, _Pid} = yatce:start([{libdir, YatceLib}]), % initialize the library
-    {ok, all_passed} = yatce_server:test(),
+    tcadb:init(),
+%    {ok, all_passed} = yatce_server:test(),
     tcadb_test(),
-    iter(),
-%    yatce:stop().
-    application:stop(yatce).
-    
+    iter().
 
 -spec init() -> 'ok'.
 init()->
-    erlang:load_nif(filename:join(["../../../c_src", ?DYLIB_NAME]), 0).
+    case code:priv_dir(?MODULE) of
+	Path when is_list(Path)->
+	    case find_path_([Path, ".", "..", "../..", "../../.."]) of
+		{ok,NPath} when is_list(NPath)->
+		    erlang:load_nif(filename:join([NPath, ?DYLIB_NAME]), 0);
+		_ -> 
+		    error
+	    end;
+	_ -> 
+	    case find_path_([".", "..", "../..", "../../.."]) of
+		{ok,NPath} when is_list(NPath)->
+		    erlang:load_nif(filename:join([NPath, ?DYLIB_NAME]), 0);
+		_ -> 
+		    errorhoge
+	    end
+    end.
+
+find_path_([])->
+    {error, not_found};
+find_path_([Head|Tail])->
+    case file:open( filename:join([Head, "priv", "lib", ?DYLIB_NAME ++ ".so"]), [read] ) of
+   	{ok, IODevice}->
+    	    file:close(IODevice),
+    	    {ok, filename:join([Head, "priv", "lib"])};
+    	{error, _} ->
+    	    find_path_(Tail)
+    end.
 
 -spec open( atom(), list() ) -> ok | {error, tcadbopen_failure} | not_loaded.
 open('*', Options) ->
 
 -spec get(atom(), key() )-> {ok, value()} | {error, record_doesnt_exist}.
 get(TableName, Key) when is_atom(TableName)->
-    get_(make_table_identifier(TableName), term_to_binary(Key)).
+    case get_(make_table_identifier(TableName), term_to_binary(Key)) of
+	{ok,Bin}->   {ok,binary_to_term(Bin)};
+	Other ->     Other
+    end.
 
 get_(_,_)-> not_loaded.
 
 
 -spec iternext(atom()) -> {key(), value()} | eod | error.
 iternext(TableName) when is_atom(TableName)->
-    iternext_(make_table_identifier(TableName)).
+    case iternext_(make_table_identifier(TableName)) of
+	{ok,Bin}->   {ok,binary_to_term(Bin)};
+	Other ->     Other
+    end.
+	    
 iternext_(_)-> not_loaded.
 
 -spec sync(atom()) -> ok | {error, not_synced}.

test/elementary_SUITE.erl

 %% TBD: doesn't work, don't know why.
 %    {save_config, Config}.
 
-all() -> [{group, tch},
-	  {group, tcb}
+all() -> [{group, tch}
+	  ,{group, tcb}
 %	  ,{group, tcf}
 %	  ,{group, tct} %% in Debian, .tct test doesn't work.
 	  ,{group, '*'}
-%	  ,{group, '+'}
+	  ,{group, '+'}
 	 ].
 
 groups()->
-    Set= [open_close, insertion_only, one_path, deletion, putkeep,    %%	  putcat,
-	  path_test, sync_test, vanish_test, iter_test, rnum_test, size_test ],
+    Set= [open_close, insertion_only, one_path, deletion, putkeep , path_test,
+	  sync_test, vanish_test, iter_test, rnum_test, size_test ],
     Suffices = [tch,tcb,tcf,tct], 
-    MemSet = [open_close, insertion_only, one_path, deletion, putkeep,    %%	  putcat,
-	      path_test, vanish_test, iter_test, rnum_test, size_test ],
+    MemSet = [open_close, insertion_only, one_path, deletion, putkeep , path_test, 
+	      vanish_test, iter_test, rnum_test, size_test ],
     MemSuffices = ['*', '+'],
     [ {X, [sequencial], Set} || X <- Suffices ] ++ [ {X, [sequencial], MemSet} || X <- MemSuffices].
 	   
 
 insertion_only(Config)->
     Table = ?config(tablename, Config),
-    ok = tcadb:open(),
-    ok = tcadb:put(?TESTKEY, ?TESTVALUE),
-    ok = tcadb:close(),
+    ok = tcadb:open(Table, []),
+    ok = tcadb:put(Table, ?TESTKEY, ?TESTVALUE),
+    ok = tcadb:close(Table),
     Config.
 
 one_path(Config)->
     ok = tcadb:open(Table, []),
 %    ct:log("~p key: ~p, value: ~p ~n", [TCADB, ?TESTKEY, 
     ct:log("~p key: ~p~n", [tcadb, ?TESTKEY]),
-    {ok, inserted} = tcadb:put(?TESTKEY, ?TESTVALUE),
-    {ok, deleted}= tcadb:out(?TESTKEY),
-    {error, record_doesnt_exist}=tcadb:get(?TESTKEY),
-    {ok, closed} = tcadb:close(),
+    ok = tcadb:put(Table,?TESTKEY, ?TESTVALUE),
+    ok = tcadb:out(Table, ?TESTKEY),
+    error=tcadb:get(Table,?TESTKEY),
+    ok = tcadb:close(Table),
     Config.
 
 putkeep(Config)->
     Table = ?config(tablename, Config),
     ok = tcadb:open(Table, []),
-    {ok, inserted}= tcadb:putkeep(?TESTKEY, ?TESTVALUE),
-    {ok, closed} = tcadb:close(),
+    ok = tcadb:putkeep(Table,?TESTKEY, ?TESTVALUE),
+    ok = tcadb:close(Table),
     Config.
     
-putcat(Config)->
-    Table = ?config(tablename, Config),
-    ok = tcadb:open(Table, []),
-    {ok, appended}= tcadb:putcat(?TESTKEY, ?TESTVALUE),
-    {ok, closed} = tcadb:close(),
-    Config.
+%% putcat(Config)->
+%%     Table = ?config(tablename, Config),
+%%     ok = tcadb:open(Table, []),
+%%     ok = tcadb:putcat(Table,?TESTKEY, ?TESTVALUE),
+%%     ok = tcadb:close(Table),
+%%     Config.
 
 intvalue(Config)->
     Table = ?config(tablename, Config),
     ok = tcadb:open(Table, []),
-    lists:map( fun({Key,Value})-> ok = tcadb:put(Table, Key,Value)  end,
+    lists:map( fun({Key,Value})-> ok = tcadb:put(Table,Table, Key,Value)  end,
 	       get_test_data()
 	      ),
     ok = tcadb:close(Table),
 
 path_test(Config)->    
     Table = ?config(tablename, Config),
-    tcadb:path(Table),
+    ok = tcadb:open(Table, []),
+    {ok,Path}=tcadb:path(Table),
+    ok = tcadb:close(Table),
+    true=is_list(Path),
     Config.
 
 sync_test(Config)->
 vanish_test(Config)->
     Table = ?config(tablename, Config),
     ok = tcadb:open(Table, []),
-    ok = tcadb:vanish(Table), % see tc_wrapper.c#tc_sync for details
+    ok = tcadb:vanish(Table),
     ok = tcadb:close(Table),
     Config.
 
 rnum_test(Config)->
     Table = ?config(tablename, Config),
     ok = tcadb:open(Table, []),
-    {ok, Rnum} = tcadb:rnum(Table),
+    Rnum = tcadb:rnum(Table),
     if not is_integer(Rnum)-> 
 	    ok = tcadb:close(Table),
 	    ct:fail( "tcadb:rnum/0 failed" );
  
 size_test(Config)->
     Table = ?config(tablename, Config),
+    ct:pal("~p~n", [Table]),
     ok = tcadb:open(Table, []),
-    {ok, Size} = tcadb:size(Table),
+    Size = tcadb:size(Table),
     if not is_integer(Size)->
- 	    ok = tcadb:close(Table),
 	    ct:fail( "tcadb:size/0 failed" );
        true ->
-	    ct:log("size for ~p: ~p.~n", [tcadb:path(Table), Size]),
-	    ok = tcadb:close(Table)
+	    ct:log("size for ~p: ~p.~n", [tcadb:path(Table), Size])
     end,
+    ok = tcadb:close(Table),
     Config.
 
 get_test_data()->

test/tcadb_SUITE.erl

 end_per_suite(Config) ->  
     Config.
 
-all() -> [{group, tch},
+all() -> [ {group, tch},
 	  {group, tcb}
 %	  ,{group, tcf} 
 %	  ,{group, tct}
-%	  ,{group, '*'}
-%	  ,{group, '+'}
+	  ,{group, '*'}
+	  ,{group, '+'}
 	 ].
 
 groups()->
     NewConfig.
     
 reset_config(Config)->
-    T1 = ?config(t1, Config),
-    T2 = ?config(t2, Config),
     TmpConfig = proplists:delete(t1, Config),
     NewConfig = proplists:delete(t2, TmpConfig),
     ct:log("Config: ~p~n", [NewConfig] ),

test/types_SUITE.erl

 %	  ,{group, tcf}
 %	  ,{group, tct}
 	  ,{group, '*'}
-%	  ,{group, '+'}
+	  ,{group, '+'}
 	 ].
 
 groups()->
     Key=?config(key,Config),
     T = ?config(tablename, Config),
     ct:log("{key,value}=~p~n", [{Key,Value}]),
-    {ok, inserted}=T:put(Key,Value),
-    {ok,Value}=T:get(Key).
+    ok=tcadb:put(T,Key,Value),
+    {ok,Value}=tcadb:get(T, Key).
 
 binv(Config)->
     Value=?BIN,
     T = ?config(tablename, Config),
     ct:log("{key,value}=~p~n", [{Key,Value}]),
     ok=tcadb:put(T,Key,Value),
-    {ok,Value}=T:get(Key).
+    {ok,Value}=tcadb:get(T, Key).
 
 dblv(Config)->
     Value=?DBL,
     T = ?config(tablename, Config),
     ct:log("{key,value}=~p~n", [{Key,Value}]),
     ok=tcadb:put(T,Key,Value),
-    {ok,Value}==T:get(Key).
+    {ok,Value}==tcadb:get(T, Key).
 
 tupv(Config)->
     Value=?TUPLE,
-YATCE_VSN = 0.10.0
+YATCE_VSN = 0.20.0