summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMartyn Russell <martyn@lanedo.com>2010-03-17 16:16:46 +0000
committerMartyn Russell <martyn@lanedo.com>2010-03-18 13:56:44 +0000
commitf614525f5a1cb0f67f1f833ec2d52cceadb7759b (patch)
tree6971c5e358a8c04fee553e2545fe500da2a0da81 /examples
parentdfacb82aa105575e11a9b9f668ff63c52125d8c9 (diff)
downloadtracker-f614525f5a1cb0f67f1f833ec2d52cceadb7759b.tar.gz
libtracker-miner: Move password provider test to tests
Diffstat (limited to 'examples')
-rw-r--r--examples/libtracker-miner/Makefile.am14
-rw-r--r--examples/libtracker-miner/password-provider-test.c112
2 files changed, 0 insertions, 126 deletions
diff --git a/examples/libtracker-miner/Makefile.am b/examples/libtracker-miner/Makefile.am
index 6e1da788c..a54f7972c 100644
--- a/examples/libtracker-miner/Makefile.am
+++ b/examples/libtracker-miner/Makefile.am
@@ -36,17 +36,3 @@ tracker_miner_test_LDADD = \
$(GLIB2_LIBS) \
-lz \
-lm
-
-password_provider_test_SOURCES = \
- password-provider-test.c
-
-password_provider_test_LDADD = \
- $(top_builddir)/src/libtracker-miner/libtracker-miner-@TRACKER_API_VERSION@.la \
- $(DBUS_LIBS) \
- $(GMODULE_LIBS) \
- $(GTHREAD_LIBS) \
- $(GIO_LIBS) \
- $(GCOV_LIBS) \
- $(GLIB2_LIBS) \
- -lz \
- -lm
diff --git a/examples/libtracker-miner/password-provider-test.c b/examples/libtracker-miner/password-provider-test.c
deleted file mode 100644
index e373b1a96..000000000
--- a/examples/libtracker-miner/password-provider-test.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2010, Adrien Bustany (abustany@gnome.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-
-#include <libtracker-miner/tracker-password-provider.h>
-
-#define SERVICE_NAME "TestService"
-#define TEST_USERNAME "test-user"
-#define TEST_PASSWORD "s3cr3t"
-
-int
-main (int argc, char **argv)
-{
- TrackerPasswordProvider *provider;
- gchar *username = NULL;
- gchar *password = NULL;
- GError *error = NULL;
-
- g_type_init ();
- g_set_application_name ("PasswordBackendTest");
-
- g_print ("Testing TrackerPasswordProvider...\n");
-
- provider = tracker_password_provider_get ();
-
- g_print ("Storing password '%s' for user '%s'\n",
- TEST_PASSWORD,
- TEST_USERNAME);
-
- tracker_password_provider_store_password (provider,
- SERVICE_NAME,
- "This is the test service",
- TEST_USERNAME,
- TEST_PASSWORD,
- &error);
-
- if (error) {
- g_printerr ("Calliung tracker_password_provider_store_password() failed, %s",
- error->message);
- g_error_free (error);
- g_object_unref (provider);
-
- return EXIT_FAILURE;
- }
-
- password = tracker_password_provider_get_password (provider,
- SERVICE_NAME,
- &username,
- &error);
-
- if (error) {
- g_printerr ("Calling tracker_password_provider_get_password() failed, %s",
- error->message);
- g_error_free (error);
- g_free (username);
- g_free (password);
- g_object_unref (provider);
-
- return EXIT_FAILURE;
- }
-
- g_print ("Found password is '%s' for username '%s'\n",
- password,
- username);
-
- g_free (username);
- g_free (password);
-
- /* Also test without getting the username */
- password = tracker_password_provider_get_password (provider,
- SERVICE_NAME,
- NULL,
- &error);
-
- if (error) {
- g_printerr ("Calling tracker_password_provider_get_password() failed, %s",
- error->message);
- g_error_free (error);
- g_free (password);
- g_object_unref (provider);
-
- return EXIT_SUCCESS;
- }
-
- g_print ("Found password is '%s' for NULL username\n", password);
-
- g_free (password);
- g_object_unref (provider);
-
- g_print ("Done\n");
-
- return EXIT_SUCCESS;
-}