delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / kwalletd / backend / tests / backendtest.cpp
blobdda342c579c8469f697f3dc703700f29a0dfeed6
1 #include <stdlib.h>
2 #include <stdio.h>
4 #include <kaboutdata.h>
5 #include <kcmdlineargs.h>
6 #include <kdebug.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);
15 KApplication a;
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);
30 rc = be.open(bpass);
32 printf("be.open(bpass) returned %d (should be 0 or 1)\n", rc);
34 rc = be.close(true);
36 printf("be.close(true) returned %d (should be 0)\n", rc);
38 rc = be.open(apass);
40 printf("be.open(apass) returned %d (should be negative)\n", rc);
42 rc = be.open(bpass);
44 printf("be.open(bpass) returned %d (should be 0)\n", rc);
46 return 0;