git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Create /sys directory if it doesn't exist already.
[libguestfs.git]
/
capitests
/
test-command.c
diff --git
a/capitests/test-command.c
b/capitests/test-command.c
index
1e29ee9
..
c23b7d1
100644
(file)
--- a/
capitests/test-command.c
+++ b/
capitests/test-command.c
@@
-20,45
+20,48
@@
* guestfs_command and guestfs_command_lines functions.
*/
* guestfs_command and guestfs_command_lines functions.
*/
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#define STREQ(a,b) (strcmp((a),(b)) == 0)
+
int
main (int argc, char *argv[])
{
if (argc > 1) {
int
main (int argc, char *argv[])
{
if (argc > 1) {
- if (
strcmp (argv[1], "1") == 0
) {
+ if (
STREQ (argv[1], "1")
) {
printf ("Result1");
printf ("Result1");
- } else if (
strcmp (argv[1], "2") == 0
) {
+ } else if (
STREQ (argv[1], "2")
) {
printf ("Result2\n");
printf ("Result2\n");
- } else if (
strcmp (argv[1], "3") == 0
) {
+ } else if (
STREQ (argv[1], "3")
) {
printf ("\nResult3");
printf ("\nResult3");
- } else if (
strcmp (argv[1], "4") == 0
) {
+ } else if (
STREQ (argv[1], "4")
) {
printf ("\nResult4\n");
printf ("\nResult4\n");
- } else if (
strcmp (argv[1], "5") == 0
) {
+ } else if (
STREQ (argv[1], "5")
) {
printf ("\nResult5\n\n");
printf ("\nResult5\n\n");
- } else if (
strcmp (argv[1], "6") == 0
) {
+ } else if (
STREQ (argv[1], "6")
) {
printf ("\n\nResult6\n\n");
printf ("\n\nResult6\n\n");
- } else if (
strcmp (argv[1], "7") == 0
) {
+ } else if (
STREQ (argv[1], "7")
) {
/* nothing */
/* nothing */
- } else if (
strcmp (argv[1], "8") == 0
) {
+ } else if (
STREQ (argv[1], "8")
) {
printf ("\n");
printf ("\n");
- } else if (
strcmp (argv[1], "9") == 0
) {
+ } else if (
STREQ (argv[1], "9")
) {
printf ("\n\n");
printf ("\n\n");
- } else if (
strcmp (argv[1], "10") == 0
) {
+ } else if (
STREQ (argv[1], "10")
) {
printf ("Result10-1\nResult10-2\n");
printf ("Result10-1\nResult10-2\n");
- } else if (
strcmp (argv[1], "11") == 0
) {
+ } else if (
STREQ (argv[1], "11")
) {
printf ("Result11-1\nResult11-2");
} else {
fprintf (stderr, "unknown parameter: %s\n", argv[1]);
printf ("Result11-1\nResult11-2");
} else {
fprintf (stderr, "unknown parameter: %s\n", argv[1]);
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
} else {
fprintf (stderr, "missing parameter\n");
}
} else {
fprintf (stderr, "missing parameter\n");
- exit (
1
);
+ exit (
EXIT_FAILURE
);
}
}
- exit (
0
);
+ exit (
EXIT_SUCCESS
);
}
}