Exemplo n.º 1
0
void test_strings_setrange(Ardb& db)
{
    DBID dbid = 0;
    std::string v;
    db.Set(dbid, "skey", "abcabc");
    db.SetRange(dbid, "skey", 3, "12345");
    db.Get(dbid, "skey", v);
    CHECK_FATAL(v != "abc12345", "SetRange failed:%s", v.c_str());
}
Exemplo n.º 2
0
void test_strings_append(Ardb& db)
{
    DBID dbid = 0;
    std::string v;
    //append
    db.Set(dbid, "skey", "abc");
    db.Append(dbid, "skey", "abc");
    int ret = db.Get(dbid, "skey", v);
    CHECK_FATAL(ret != 0, "Failed to get skey.");
    CHECK_FATAL(v != "abcabc", "Invalid str:%s", v.c_str());
}