4 #include <kaboutdata.h>
5 #include <kcmdlineargs.h>
7 #include <kapplication.h>
8 #include <QtCore/QString>
10 #include "kwalletbackend.h"
12 int main(int argc
, char **argv
) {
13 KAboutData
aboutData("backendtest", 0, ki18n("backendtest"), "version");
14 KCmdLineArgs::init(argc
, argv
, &aboutData
);
17 KWallet::Backend
be("ktestwallet");
18 printf("KWalletBackend constructed\n");
20 QByteArray
apass("apassword", 9);
21 QByteArray
bpass("bpassword", 9);
22 QByteArray
cpass("cpassword", 9);
24 printf("Passwords initialised.\n");
25 be
.setPassword(apass
);
26 int rc
= be
.close(true);
28 printf("be.close(true) returned %d (should be -255)\n", rc
);
32 printf("be.open(bpass) returned %d (should be 0 or 1)\n", rc
);
36 printf("be.close(true) returned %d (should be 0)\n", rc
);
40 printf("be.open(apass) returned %d (should be negative)\n", rc
);
44 printf("be.open(bpass) returned %d (should be 0)\n", rc
);