summaryrefslogtreecommitdiffstats
path: root/test/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.cpp')
-rw-r--r--test/test.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/test.cpp b/test/test.cpp
index 6112dc4f5..e2358f4e6 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -1,9 +1,9 @@
#include "test.h"
-#include "core/polkitqt1-authority.h"
-#include "agent/polkitqt1-agent-session.h"
-#include "core/polkitqt1-details.h"
+#include "core/polkittqt1-authority.h"
+#include "agent/polkittqt1-agent-session.h"
+#include "core/polkittqt1-details.h"
#include <stdlib.h>
#include <unistd.h>
#include <pwd.h>
@@ -22,25 +22,25 @@ void wait()
void TestAuth::test_Auth_checkAuthorization()
{
- // This needs the file org.qt.policykit.examples.policy from examples to be installed
+ // This needs the file org.tqt.policykit.examples.policy from examples to be installed
UnixProcessSubject process(TQCoreApplication::applicationPid());
Authority::Result result;
// Check if this method returns good authorization results
Authority *authority = Authority::instance();
- result = authority->checkAuthorizationSync("org.qt.policykit.examples.kick", process, Authority::None);
+ result = authority->checkAuthorizationSync("org.tqt.policykit.examples.kick", process, Authority::None);
TQCOMPARE(result, Authority::No);
TQVERIFY(!authority->hasError());
- result = authority->checkAuthorizationSync("org.qt.policykit.examples.cry", process, Authority::None);
+ result = authority->checkAuthorizationSync("org.tqt.policykit.examples.cry", process, Authority::None);
TQCOMPARE(result, Authority::Yes);
TQVERIFY(!authority->hasError());
- result = authority->checkAuthorizationSync("org.qt.policykit.examples.bleed", process, Authority::None);
+ result = authority->checkAuthorizationSync("org.tqt.policykit.examples.bleed", process, Authority::None);
TQCOMPARE(result, Authority::Challenge);
TQVERIFY(!authority->hasError());
// Now we try async methods
TQSignalSpy spy(authority, SIGNAL(checkAuthorizationFinished(PolkitTQt1::Authority::Result)));
// Call asynchronous checkAuthorization
- authority->checkAuthorization("org.qt.policykit.examples.kick", process, Authority::None);
+ authority->checkAuthorization("org.tqt.policykit.examples.kick", process, Authority::None);
// Give the polkit time to obtain the result and emit the signal with it
wait();
// Test if the signal was emitted
@@ -52,14 +52,14 @@ void TestAuth::test_Auth_checkAuthorization()
spy.clear();
// Let's test the cancellability
- authority->checkAuthorization("org.qt.policykit.examples.kick", process, Authority::None);
+ authority->checkAuthorization("org.tqt.policykit.examples.kick", process, Authority::None);
authority->checkAuthorizationCancel();
// Wait and check if the signal arrieved
wait();
TQCOMPARE(spy.count(), 0);
// Check if it can cancel user authentication dialog
- authority->checkAuthorization("org.qt.policykit.examples.bleed", process, Authority::AllowUserInteraction);
+ authority->checkAuthorization("org.tqt.policykit.examples.bleed", process, Authority::AllowUserInteraction);
// Show it for second
sleep(1);
// And now kill it
@@ -71,15 +71,15 @@ void TestAuth::test_Auth_checkAuthorization()
void TestAuth::test_Auth_enumerateActions()
{
- // This needs the file org.qt.policykit.examples.policy from examples to be installed
+ // This needs the file org.tqt.policykit.examples.policy from examples to be installed
ActionDescription::List list = Authority::instance()->enumerateActionsSync();
TQVERIFY(!Authority::instance()->hasError());
// Check whether enumerateAction returns at least example actions
int count = 0;
Q_FOREACH(const ActionDescription &ad, list) {
- if ((ad.actionId() == "org.qt.policykit.examples.kick") ||
- (ad.actionId() == "org.qt.policykit.examples.cry") ||
- (ad.actionId() == "org.qt.policykit.examples.bleed"))
+ if ((ad.actionId() == "org.tqt.policykit.examples.kick") ||
+ (ad.actionId() == "org.tqt.policykit.examples.cry") ||
+ (ad.actionId() == "org.tqt.policykit.examples.bleed"))
count++;
}
TQCOMPARE(count, 3);
@@ -95,9 +95,9 @@ void TestAuth::test_Auth_enumerateActions()
list = qVariantValue<PolkitTQt1::ActionDescription::List> (spy.takeFirst()[0]);
TQVERIFY(!Authority::instance()->hasError());
Q_FOREACH(const ActionDescription &ad, list) {
- if ((ad.actionId() == "org.qt.policykit.examples.kick") ||
- (ad.actionId() == "org.qt.policykit.examples.cry") ||
- (ad.actionId() == "org.qt.policykit.examples.bleed"))
+ if ((ad.actionId() == "org.tqt.policykit.examples.kick") ||
+ (ad.actionId() == "org.tqt.policykit.examples.cry") ||
+ (ad.actionId() == "org.tqt.policykit.examples.bleed"))
count++;
}
TQCOMPARE(count, 3);
@@ -176,7 +176,7 @@ void TestAuth::test_Authority()
void TestAuth::test_Subject()
{
// Get pid of this appication
- qint64 pid = TQCoreApplication::applicationPid();
+ tqint64 pid = TQCoreApplication::applicationPid();
// Create unix process for it
UnixProcessSubject *process = new UnixProcessSubject(pid);
// Test if pid doesn't differ
@@ -205,7 +205,7 @@ void TestAuth::test_Session()
TQCOMPARE(spy_completed.count(), 1);
//UnixProcess *process = new UnixProcess(TQCoreApplication::applicationPid());
- //Authority::instance()->checkAuthorization("org.qt.policykit.examples.kick", process, Authority::None);
+ //Authority::instance()->checkAuthorization("org.tqt.policykit.examples.kick", process, Authority::None);
tqDebug() << "COMPLETED:" << spy_completed.count();
tqDebug() << "REQUEST:" << spy_request.count();