gnome-power-manager r2921 - in trunk: . libidletime test



Author: rhughes
Date: Thu Sep  4 12:15:16 2008
New Revision: 2921
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2921&view=rev

Log:
2008-09-04  Richard Hughes  <richard hughsie com>

* Makefile.am:
* configure.ac:
* libidletime/Makefile.am:
* libidletime/libidletime.c:
* libidletime/libidletime.h:
Nuke this, nothing uses it.

* test/Makefile.am:
* test/gpm-st-hal-device.c: (egg_test_hal_device):
* test/gpm-st-hal-devicestore.c: (egg_test_hal_devicestore):
* test/gpm-st-hal-manager.c: (egg_test_hal_manager):
* test/gpm-st-hal-power.c: (egg_test_hal_power):
* test/gpm-st-idletime.c:
* test/gpm-st-proxy.c: (egg_test_proxy):
Rename some of the gpm self test function to egg names.


Removed:
   trunk/libidletime/
   trunk/test/gpm-st-idletime.c
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/configure.ac
   trunk/test/Makefile.am
   trunk/test/gpm-st-hal-device.c
   trunk/test/gpm-st-hal-devicestore.c
   trunk/test/gpm-st-hal-manager.c
   trunk/test/gpm-st-hal-power.c
   trunk/test/gpm-st-proxy.c

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Thu Sep  4 12:15:16 2008
@@ -4,7 +4,6 @@
 SUBDIRS =						\
 	libdbus-glib					\
 	libhal-glib					\
-	libidletime					\
 	src						\
 	po						\
 	docs						\

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Thu Sep  4 12:15:16 2008
@@ -590,7 +590,6 @@
 applets/inhibit/Makefile
 libhal-glib/Makefile
 libdbus-glib/Makefile
-libidletime/Makefile
 docs/Makefile
 man/Makefile
 help/Makefile

Modified: trunk/test/Makefile.am
==============================================================================
--- trunk/test/Makefile.am	(original)
+++ trunk/test/Makefile.am	Thu Sep  4 12:15:16 2008
@@ -16,7 +16,6 @@
 	-DVERSION="\"$(VERSION)\"" 			\
 	-DGPM_DATA=\""$(datadir)/gnome-power-manager/"\"\
 	-I$(top_srcdir)					\
-	-I$(top_srcdir)/libidletime			\
 	-I$(top_srcdir)/libhal-glib			\
 	-I$(top_srcdir)/libdbus-glib			\
 	$(NULL)

Modified: trunk/test/gpm-st-hal-device.c
==============================================================================
--- trunk/test/gpm-st-hal-device.c	(original)
+++ trunk/test/gpm-st-hal-device.c	Thu Sep  4 12:15:16 2008
@@ -27,110 +27,110 @@
 #include <libhal-gdevice.h>
 
 void
-gpm_st_hal_device (GpmSelfTest *test)
+egg_test_hal_device (GpmSelfTest *test)
 {
 	HalGDevice *device;
 	const char *udi;
 	char *retstr;
 	gboolean ret;
 
-	if (gpm_st_start (test, "HalGDevice") == FALSE) {
+	if (egg_test_start (test, "HalGDevice") == FALSE) {
 		return;
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we get a non null device");
+	egg_test_title (test, "make sure we get a non null device");
 	device = hal_gdevice_new ();
 	if (device != NULL) {
-		gpm_st_success (test, "got HalGDevice");
+		egg_test_success (test, "got HalGDevice");
 	} else {
-		gpm_st_failed (test, "could not get HalGDevice");
+		egg_test_failed (test, "could not get HalGDevice");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we get a null UDI");
+	egg_test_title (test, "make sure we get a null UDI");
 	udi = hal_gdevice_get_udi (device);
 	if (udi == NULL) {
-		gpm_st_success (test, "got NULL UDI");
+		egg_test_success (test, "got NULL UDI");
 	} else {
-		gpm_st_failed (test, "got non-null UDI: %s", udi);
+		egg_test_failed (test, "got non-null UDI: %s", udi);
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we can set a UDI");
+	egg_test_title (test, "make sure we can set a UDI");
 	ret = hal_gdevice_set_udi (device, HAL_ROOT_COMPUTER);
 	if (ret) {
-		gpm_st_success (test, "set UDI");
+		egg_test_success (test, "set UDI");
 	} else {
-		gpm_st_failed (test, "could not set UDI");
+		egg_test_failed (test, "could not set UDI");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we can get the UDI");
+	egg_test_title (test, "make sure we can get the UDI");
 	udi = hal_gdevice_get_udi (device);
 	if (udi && strcmp (udi, HAL_ROOT_COMPUTER) == 0) {
-		gpm_st_success (test, "got correct UDI: %s", udi);
+		egg_test_success (test, "got correct UDI: %s", udi);
 	} else {
-		gpm_st_failed (test, "got incorrect UDI: %s", udi);
+		egg_test_failed (test, "got incorrect UDI: %s", udi);
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we cannot set another UDI");
+	egg_test_title (test, "make sure we cannot set another UDI");
 	ret = hal_gdevice_set_udi (device, "foo");
 	if (!ret) {
-		gpm_st_success (test, "Cannot set another UDI");
+		egg_test_success (test, "Cannot set another UDI");
 	} else {
-		gpm_st_failed (test, "Able to overwrite UDI");
+		egg_test_failed (test, "Able to overwrite UDI");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we can get a string key");
+	egg_test_title (test, "make sure we can get a string key");
 	ret = hal_gdevice_get_string (device, "info.product", &retstr, NULL);
 	if (ret && retstr && strcmp (retstr, "Computer") == 0) {
-		gpm_st_success (test, "got correct key");
+		egg_test_success (test, "got correct key");
 	} else {
-		gpm_st_failed (test, "got invalid key");
+		egg_test_failed (test, "got invalid key");
 	}
 	g_free (retstr);
 
 	/************************************************************/
-	gpm_st_title (test, "try to get property modified events");
+	egg_test_title (test, "try to get property modified events");
 	ret = hal_gdevice_watch_property_modified (device);
 	if (ret) {
-		gpm_st_success (test, "got notification");
+		egg_test_success (test, "got notification");
 	} else {
-		gpm_st_failed (test, "could not get notification");
+		egg_test_failed (test, "could not get notification");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "try to get duplicate property modified events");
+	egg_test_title (test, "try to get duplicate property modified events");
 	ret = hal_gdevice_watch_property_modified (device);
 	if (!ret) {
-		gpm_st_success (test, "duplicate notification refused");
+		egg_test_success (test, "duplicate notification refused");
 	} else {
-		gpm_st_failed (test, "got duplicate notification");
+		egg_test_failed (test, "got duplicate notification");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "try to cancel property modified events");
+	egg_test_title (test, "try to cancel property modified events");
 	ret = hal_gdevice_remove_property_modified (device);
 	if (ret) {
-		gpm_st_success (test, "cancel notification");
+		egg_test_success (test, "cancel notification");
 	} else {
-		gpm_st_failed (test, "could not cancel notification");
+		egg_test_failed (test, "could not cancel notification");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "try to get duplicate property modified cancel");
+	egg_test_title (test, "try to get duplicate property modified cancel");
 	ret = hal_gdevice_remove_property_modified (device);
 	if (!ret) {
-		gpm_st_success (test, "duplicate cancel refused");
+		egg_test_success (test, "duplicate cancel refused");
 	} else {
-		gpm_st_failed (test, "did duplicate cancel");
+		egg_test_failed (test, "did duplicate cancel");
 	}
 
 	g_object_unref (device);
 
-	gpm_st_end (test);
+	egg_test_end (test);
 }
 

Modified: trunk/test/gpm-st-hal-devicestore.c
==============================================================================
--- trunk/test/gpm-st-hal-devicestore.c	(original)
+++ trunk/test/gpm-st-hal-devicestore.c	Thu Sep  4 12:15:16 2008
@@ -27,7 +27,7 @@
 #include <libhal-gdevicestore.h>
 
 void
-gpm_st_hal_devicestore (GpmSelfTest *test)
+egg_test_hal_devicestore (GpmSelfTest *test)
 {
 	HalGDevicestore *devicestore;
 	HalGDevice *device;
@@ -35,109 +35,109 @@
 	HalGDevice *device3;
 	gboolean ret;
 
-	if (gpm_st_start (test, "HalGDevicestore") == FALSE) {
+	if (egg_test_start (test, "HalGDevicestore") == FALSE) {
 		return;
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we get a non null devicestore");
+	egg_test_title (test, "make sure we get a non null devicestore");
 	devicestore = hal_gdevicestore_new ();
 	if (devicestore != NULL) {
-		gpm_st_success (test, "got HalGDevicestore");
+		egg_test_success (test, "got HalGDevicestore");
 	} else {
-		gpm_st_failed (test, "could not get HalGDevicestore");
+		egg_test_failed (test, "could not get HalGDevicestore");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure device not in devicestore");
+	egg_test_title (test, "make sure device not in devicestore");
 	device = hal_gdevice_new ();
 	hal_gdevice_set_udi (device, HAL_ROOT_COMPUTER);
 	ret = hal_gdevicestore_present (devicestore, device);
 	if (!ret) {
-		gpm_st_success (test, "could not get different device");
+		egg_test_success (test, "could not get different device");
 	} else {
-		gpm_st_failed (test, "got computer in empty store");
+		egg_test_failed (test, "got computer in empty store");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "insert device");
+	egg_test_title (test, "insert device");
 	ret = hal_gdevicestore_insert (devicestore, device);
 	if (ret) {
-		gpm_st_success (test, "inserted device");
+		egg_test_success (test, "inserted device");
 	} else {
-		gpm_st_failed (test, "could not insert device");
+		egg_test_failed (test, "could not insert device");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "insert duplicate device");
+	egg_test_title (test, "insert duplicate device");
 	ret = hal_gdevicestore_insert (devicestore, device);
 	if (!ret) {
-		gpm_st_success (test, "cannot insert duplicate device");
+		egg_test_success (test, "cannot insert duplicate device");
 	} else {
-		gpm_st_failed (test, "inserted duplicate device");
+		egg_test_failed (test, "inserted duplicate device");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure device in store");
+	egg_test_title (test, "make sure device in store");
 	ret = hal_gdevicestore_present (devicestore, device);
 	if (ret) {
-		gpm_st_success (test, "found device");
+		egg_test_success (test, "found device");
 	} else {
-		gpm_st_failed (test, "could not find device");
+		egg_test_failed (test, "could not find device");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "find device by UDI");
+	egg_test_title (test, "find device by UDI");
 	device3 = hal_gdevicestore_find_udi (devicestore, HAL_ROOT_COMPUTER);
 	if (device3 == device) {
-		gpm_st_success (test, "found device");
+		egg_test_success (test, "found device");
 	} else {
-		gpm_st_failed (test, "could not find device");
+		egg_test_failed (test, "could not find device");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "find missing device by UDI");
+	egg_test_title (test, "find missing device by UDI");
 	device3 = hal_gdevicestore_find_udi (devicestore, "/foo");
 	if (device3 == NULL) {
-		gpm_st_success (test, "not found invalid device");
+		egg_test_success (test, "not found invalid device");
 	} else {
-		gpm_st_failed (test, "Found /foo device");
+		egg_test_failed (test, "Found /foo device");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we can match on UDI");
+	egg_test_title (test, "make sure we can match on UDI");
 	device2 = hal_gdevice_new ();
 	hal_gdevice_set_udi (device2, HAL_ROOT_COMPUTER);
 	ret = hal_gdevicestore_present (devicestore, device2);
 	if (ret) {
-		gpm_st_success (test, "found device");
+		egg_test_success (test, "found device");
 	} else {
-		gpm_st_failed (test, "could not find device");
+		egg_test_failed (test, "could not find device");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "remove device");
+	egg_test_title (test, "remove device");
 	g_object_ref (device); /* so we can test it in a minute */
 	ret = hal_gdevicestore_remove (devicestore, device);
 	if (ret) {
-		gpm_st_success (test, "removed device");
+		egg_test_success (test, "removed device");
 	} else {
-		gpm_st_failed (test, "could not remove device");
+		egg_test_failed (test, "could not remove device");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure device not in devicestore");
+	egg_test_title (test, "make sure device not in devicestore");
 	ret = hal_gdevicestore_present (devicestore, device);
 	if (!ret) {
-		gpm_st_success (test, "could not get device from empty devicestore");
+		egg_test_success (test, "could not get device from empty devicestore");
 	} else {
-		gpm_st_failed (test, "got computer in empty store");
+		egg_test_failed (test, "got computer in empty store");
 	}
 
 	g_object_unref (device);
 	g_object_unref (device2);
 	g_object_unref (devicestore);
 
-	gpm_st_end (test);
+	egg_test_end (test);
 }
 

Modified: trunk/test/gpm-st-hal-manager.c
==============================================================================
--- trunk/test/gpm-st-hal-manager.c	(original)
+++ trunk/test/gpm-st-hal-manager.c	Thu Sep  4 12:15:16 2008
@@ -25,47 +25,47 @@
 #include <libhal-gmanager.h>
 
 void
-gpm_st_hal_manager (GpmSelfTest *test)
+egg_test_hal_manager (GpmSelfTest *test)
 {
 	HalGManager *manager;
 	gboolean ret;
 
-	if (gpm_st_start (test, "HalGManager") == FALSE) {
+	if (egg_test_start (test, "HalGManager") == FALSE) {
 		return;
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we get a non null device");
+	egg_test_title (test, "make sure we get a non null device");
 	manager = hal_gmanager_new ();
 	if (manager != NULL) {
-		gpm_st_success (test, "got HalGManager");
+		egg_test_success (test, "got HalGManager");
 	} else {
-		gpm_st_failed (test, "could not get HalGManager");
+		egg_test_failed (test, "could not get HalGManager");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "check if we are a laptop");
+	egg_test_title (test, "check if we are a laptop");
 	ret = hal_gmanager_is_laptop (manager);
 	if (ret) {
-		gpm_st_success (test, "identified as a laptop");
+		egg_test_success (test, "identified as a laptop");
 	} else {
-		gpm_st_failed (test, "not identified as a laptop");
+		egg_test_failed (test, "not identified as a laptop");
 	}
 
 
 	/************************************************************/
 	gchar **value;
-	gpm_st_title (test, "search for battery devices");
+	egg_test_title (test, "search for battery devices");
 	ret = hal_gmanager_find_capability (manager, "battery", &value, NULL);
 	if (ret && value != NULL && value[0] != NULL) {
-		gpm_st_success (test, "found battery device");
+		egg_test_success (test, "found battery device");
 	} else {
-		gpm_st_failed (test, "did not find battery device");
+		egg_test_failed (test, "did not find battery device");
 	}
 	hal_gmanager_free_capability (value);
 
 	g_object_unref (manager);
 
-	gpm_st_end (test);
+	egg_test_end (test);
 }
 

Modified: trunk/test/gpm-st-hal-power.c
==============================================================================
--- trunk/test/gpm-st-hal-power.c	(original)
+++ trunk/test/gpm-st-hal-power.c	Thu Sep  4 12:15:16 2008
@@ -25,35 +25,35 @@
 #include <libhal-gpower.h>
 
 void
-gpm_st_hal_power (GpmSelfTest *test)
+egg_test_hal_power (GpmSelfTest *test)
 {
 	HalGPower *power;
 	gboolean ret;
 
-	if (gpm_st_start (test, "HalGPower") == FALSE) {
+	if (egg_test_start (test, "HalGPower") == FALSE) {
 		return;
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we get a non null device");
+	egg_test_title (test, "make sure we get a non null device");
 	power = hal_gpower_new ();
 	if (power != NULL) {
-		gpm_st_success (test, "got HalGPower");
+		egg_test_success (test, "got HalGPower");
 	} else {
-		gpm_st_failed (test, "could not get HalGPower");
+		egg_test_failed (test, "could not get HalGPower");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we have pm support");
+	egg_test_title (test, "make sure we have pm support");
 	ret = hal_gpower_has_support (power);
 	if (ret) {
-		gpm_st_success (test, "has pm support");
+		egg_test_success (test, "has pm support");
 	} else {
-		gpm_st_failed (test, "does not have pm support");
+		egg_test_failed (test, "does not have pm support");
 	}
 
 	g_object_unref (power);
 
-	gpm_st_end (test);
+	egg_test_end (test);
 }
 

Modified: trunk/test/gpm-st-proxy.c
==============================================================================
--- trunk/test/gpm-st-proxy.c	(original)
+++ trunk/test/gpm-st-proxy.c	Thu Sep  4 12:15:16 2008
@@ -26,57 +26,57 @@
 #include "../src/gpm-common.h"
 
 void
-gpm_st_proxy (GpmSelfTest *test)
+egg_test_proxy (GpmSelfTest *test)
 {
 	DbusProxy *gproxy = NULL;
 	DBusGProxy *proxy = NULL;
 
-	if (gpm_st_start (test, "DbusProxy") == FALSE) {
+	if (egg_test_start (test, "DbusProxy") == FALSE) {
 		return;
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we can get a new gproxy");
+	egg_test_title (test, "make sure we can get a new gproxy");
 	gproxy = dbus_proxy_new ();
 	if (gproxy != NULL) {
-		gpm_st_success (test, "got gproxy");
+		egg_test_success (test, "got gproxy");
 	} else {
-		gpm_st_failed (test, "could not get gproxy");
+		egg_test_failed (test, "could not get gproxy");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure proxy if NULL when no assign");
+	egg_test_title (test, "make sure proxy if NULL when no assign");
 	proxy = dbus_proxy_get_proxy (gproxy);
 	if (proxy == NULL) {
-		gpm_st_success (test, "got NULL proxy");
+		egg_test_success (test, "got NULL proxy");
 	} else {
-		gpm_st_failed (test, "did not get NULL proxy");
+		egg_test_failed (test, "did not get NULL proxy");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure we can assign and connect");
+	egg_test_title (test, "make sure we can assign and connect");
 	proxy = dbus_proxy_assign (gproxy,
 				  DBUS_PROXY_SESSION,
 				  GPM_DBUS_SERVICE,
 				  GPM_DBUS_PATH_INHIBIT,
 				  GPM_DBUS_INTERFACE_INHIBIT);
 	if (proxy != NULL) {
-		gpm_st_success (test, "got proxy (init)");
+		egg_test_success (test, "got proxy (init)");
 	} else {
-		gpm_st_failed (test, "could not get proxy (init)");
+		egg_test_failed (test, "could not get proxy (init)");
 	}
 
 	/************************************************************/
-	gpm_st_title (test, "make sure proxy non NULL when assigned");
+	egg_test_title (test, "make sure proxy non NULL when assigned");
 	proxy = dbus_proxy_get_proxy (gproxy);
 	if (proxy != NULL) {
-		gpm_st_success (test, "got valid proxy");
+		egg_test_success (test, "got valid proxy");
 	} else {
-		gpm_st_failed (test, "did not get valid proxy");
+		egg_test_failed (test, "did not get valid proxy");
 	}
 
 	g_object_unref (gproxy);
 
-	gpm_st_end (test);
+	egg_test_end (test);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]