-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.h
41 lines (39 loc) · 1.22 KB
/
test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef TEST_H
#define TEST_H
#include <QString>
#include <QList>
#include <QDebug>
#include "com/util.h"
#include "libxdb.h"
char* strchar(QString s) {
QString str1 = s;
QByteArray ba = str1.toLocal8Bit();
char *c_str2 = ba.data();
return c_str2;
}
QString charToStr(char* c) {
QByteArray ba(c);
return ba;
}
void test() {
qDebug() << "------------------------- TEST START -----------------------";
qDebug() << ut::time::getCurMills();
qDebug() << "------------------------- TEST START -----------------------";
}
void test1() {
qDebug() << "------------------------- TEST5 START -----------------------";
XdbInit(strchar(""));
QString r0 = charToStr(Xdb(strchar("find h:pobi:%d")));
QString r1 = charToStr(Xdb(strchar("find h:pobi:%d(*)")));
qDebug() << r0;
qDebug() << r1;
qDebug() << "------------------------- TEST5 END -------------------------";
}
void test2() {
qDebug() << "------------------------- TEST5 START -----------------------";
XdbInit(strchar("localhost,8893,,5,20,1000,5"));
QString r0 = charToStr(Xdb(strchar("/get maxId:pk")));
qDebug() << r0;
qDebug() << "------------------------- TEST5 END -------------------------";
}
#endif // TEST_H