Added qmafw-gst-subtitles-renderer-0.0.55 for Meego Harmattan 1.2
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / unittests / common / LibCredsStub.cpp
diff --git a/qmafw-gst-subtitles-renderer/unittests/common/LibCredsStub.cpp b/qmafw-gst-subtitles-renderer/unittests/common/LibCredsStub.cpp
new file mode 100644 (file)
index 0000000..f372630
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * This file is part of QMAFW
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+ * reserved.
+ *
+ * Contact: Visa Smolander <visa.smolander@nokia.com>
+ *
+ * This software, including documentation, is protected by copyright controlled
+ * by Nokia Corporation. All rights are reserved. Copying, including
+ * reproducing, storing, adapting or translating, any or all of this material
+ * requires the prior written consent of Nokia Corporation. This material also
+ * contains confidential information which may not be disclosed to others
+ * without the prior written consent of Nokia.
+ *
+ */
+
+#include <QObject>
+#include <sys/creds.h>
+
+namespace Stub
+{
+    bool global_route_provider_trusted = true;
+}
+
+creds_t creds_gettask(pid_t /*pid*/)
+{
+    return (creds_t)1;
+}
+
+int creds_have_p(const creds_t creds, creds_type_t type, creds_value_t value)
+{
+    Q_UNUSED(creds);
+    Q_UNUSED(type);
+    Q_UNUSED(value);
+
+    if( Stub::global_route_provider_trusted )
+    {
+        return 1;
+    }
+
+    return 0;
+}
+
+long creds_str2creds(const char *credential, creds_value_t *value)
+{
+    Q_UNUSED(credential);
+    Q_UNUSED(value);
+
+    return 1234;
+}