Sfoglia il codice sorgente

Fix bug in test script which was causing test not to run.
Increase code coverage by allowing few more apis to be called.

(Logical change 1.136)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@489 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 21 anni fa
parent
commit
863b60f5c0
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      test/testamf.c

+ 7 - 0
test/testamf.c

@@ -304,6 +304,9 @@ int main (int argc, char **argv) {
 	setSanameT (&compName, "comp_a_in_su_x");
 	setSanameT (&csiName, "pgA");
 
+    result = saAmfComponentRegister (&handle, &compName, NULL);
+	printf ("saAmfComponentRegister with result %d (should be 1) is:", result);
+
 	result = saAmfCompNameGet (&handle, &compname_get_name);
 	printf ("saAmfCompNameGet with result %d (should be 1) is:", result);
 	printSaNameT (&compname_get_name);
@@ -331,7 +334,11 @@ int main (int argc, char **argv) {
 		HAState, result);
 
 	do {
+        FD_SET (STDIN_FILENO, &read_fds);
 		select (select_fd + 1, &read_fds, 0, 0, 0);
+        if (FD_ISSET (STDIN_FILENO, &read_fds)) {
+            break;
+        }
 		saAmfDispatch (&handle, SA_DISPATCH_ALL);
 	} while (result);