All pastes #132560 Raw Edit

Casanova

public text v1 · immutable
#132560 ·published 2006-08-15 10:55 UTC
rendered paste body
Index: ldtp-request.c
===================================================================
RCS file: /cvs/ldtp/ldtp/src/ldtp-request.c,v
retrieving revision 1.8
diff -u -p -r1.8 ldtp-request.c
--- ldtp-request.c	1 Aug 2006 07:51:18 -0000	1.8
+++ ldtp-request.c	15 Aug 2006 10:54:29 -0000
@@ -212,8 +212,11 @@ ldtp_request_fill_request (LDTPRequest* 
 		  NOTE: A better way to do this is, to have a seperate for loop to iterate
 		  childrens of ARGUMENTS
 		*/
-		if (!node)
+		if (!node) {
+			req->arg_list = g_slist_prepend (req->arg_list,
+							 NULL);
 			break;
+		}
 		if (!xmlStrcmp (node->name, (const xmlChar *) "ARGUMENT")) {
 			if (doc && node->xmlChildrenNode) {
 				tmp = (guchar *)xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
Index: text.c
===================================================================
RCS file: /cvs/ldtp/ldtp/src/text.c,v
retrieving revision 1.14
diff -u -p -r1.14 text.c
--- text.c	25 Jul 2006 20:06:42 -0000	1.14
+++ text.c	15 Aug 2006 10:54:31 -0000
@@ -51,12 +51,7 @@ set_text_value (Accessible *object, char
 {
 	LDTPError *error;
 	AccessibleEditableText *editableText;
-
-	if (!text) {
-		error = ldtp_error_get_error (LDTP_ERROR_UNABLE_TO_SET_TEXT);
-		log_msg (LDTP_LOG_CAUSE, error->message, log_fp);
-		return error;
-	}

 	if (Accessible_isEditableText (object)) {
 		SPIBoolean flag;
 		editableText = Accessible_getEditableText (object);
@@ -360,7 +355,7 @@ verify_partial_match (Accessible *object
 	LDTPError *error;
 	AccessibleText *accessibleText;
 	int i, j, k;
-
+	
 	sub = textvalue;
 	accessibleText = Accessible_getText (object);
 	if (accessibleText == NULL) {
@@ -373,7 +368,7 @@ verify_partial_match (Accessible *object
 	Accessible_unref (accessibleText);
 	
 	for (i = 0 ; tmp[i] != '\0' ; i++) {
-		for(j = i , k=0 ; sub[k] != '\0' && tmp[j] == sub[k] ; j++ , k++) 
+		for(j = i, k=0; sub && sub[k] != '\0' && tmp[j] == sub[k] ; j++ , k++) 
 			; /* Do nothing */
 		if( k > 0 && sub[k] == '\0')
 			return ldtp_error_get_error (LDTP_ERROR_SUCCESS);
@@ -883,9 +878,13 @@ text_main (LDTPClientContext* cctxt, int
 	LDTPError *error = NULL;
 	switch (command) {
 	case LDTP_CMD_SETTEXTVALUE:
-		error = set_text_value (cctxt->gui_handle->handle,
-					cctxt->req->arg_list->data,
-					cctxt->log_fp);
+		if (cctxt->req->arg_list->data = NULL)
+			error = set_text_value (cctxt->gui_handle->handle,
+						"", cctxt->log_fp);
+		else
+			error = set_text_value (cctxt->gui_handle->handle,
+						cctxt->req->arg_list->data,
+						cctxt->log_fp);
 		break;
 	case LDTP_CMD_CUTTEXT: {
 		long startpos = 0;
@@ -959,7 +958,7 @@ text_main (LDTPClientContext* cctxt, int
 	case LDTP_CMD_VERIFYPARTIALMATCH:
 		error = verify_partial_match (cctxt->gui_handle->handle,
 					      cctxt->req->arg_list->data, cctxt->log_fp);
-		break;
+		break;	
 	case LDTP_CMD_GETTEXTVALUE:
 		error = get_text (cctxt->gui_handle->handle, &cctxt->req->arg_list);
 		if (error->err_code == LDTP_ERROR_SUCCESS) {
Index: ChangeLog
===================================================================
RCS file: /cvs/ldtp/ldtp/src/ChangeLog,v
retrieving revision 1.41
diff -u -p -r1.41 ChangeLog
--- ChangeLog	15 Aug 2006 04:29:36 -0000	1.41
+++ ChangeLog	15 Aug 2006 10:54:32 -0000
@@ -1,3 +1,8 @@
+2006-08-15  Prashanth Mohan  <prashmohan@gmail.com>
+
+	* ldtp-request.c (ldtp_request_fill_request): Added NULL value to
+	argument list in case of no arguments specified
+
 2006-08-14  Rodney Dawes  <dobey@novell.com>
 
 	* remap.c (add_appmap_data): Add support for the description property