Example #1
0
void TestSclientSetname(){
    CRedisClient redis;
    redis.connect( "127.0.0.1", 6379 );

    cout << "------test clientSetname------" << endl;
    redis.clientSetname("");
    TestServerPrint("redis.clientSetname(qwert)","OK");
}
Example #2
0
void TestSclientGetname(){
    CRedisClient redis;
    redis.connect( "127.0.0.1", 6379 );
    cout << "------test clientGetname------" << endl;
    string cName;

    if ( redis.clientGetname(cName))
        TestServerPrint("redis.clientGetname()",cName);
    else
        std::cout<<"no clientName"<<std::endl;
    redis.clientSetname("");

    if ( redis.clientGetname(cName))
        TestServerPrint("redis.clientGetname()",cName);
    else
        std::cout<<"no clientName"<<std::endl;
}