void test_strings_exists(Ardb& db) { DBID dbid = 0; db.Del(dbid, "intkey1"); CHECK_FATAL(db.Exists(dbid, "intkey1"), "Exists intkey1 failed"); db.Set(dbid, "intkey1", "123"); CHECK_FATAL(db.Exists(dbid, "intkey1") == false, "Exists intkey failed"); }
void test_set_expire(Ardb& db) { DBID dbid = 0; db.SClear(dbid, "myset"); db.SAdd(dbid, "myset", "123"); db.Expire(dbid, "myset", 1); CHECK_FATAL(db.Exists(dbid, "myset") == false, "Expire myset failed"); sleep(2); CHECK_FATAL(db.Exists(dbid, "myset") == true, "Expire myset failed"); }
void test_strings_expire(Ardb& db) { DBID dbid = 0; ValueData v; db.Set(dbid, "intkey1", "123"); db.Expire(dbid, "intkey1", 1); CHECK_FATAL(db.Exists(dbid, "intkey1") == false, "Expire intkey1 failed"); sleep(2); CHECK_FATAL(db.Exists(dbid, "intkey1") == true, "Expire intkey failed"); }
void test_zset_expire(Ardb& db) { DBID dbid = 0; db.ZClear(dbid, "myzset"); db.ZAdd(dbid, "myzset", ValueData((int64) 1), "one"); db.Expire(dbid, "myzset", 1); CHECK_FATAL(db.Exists(dbid, "myzset") == false, "Expire myzset failed"); sleep(2); CHECK_FATAL(db.Exists(dbid, "myzset") == true, "Expire myzset failed"); }