summaryrefslogtreecommitdiff
path: root/usertest.c
diff options
context:
space:
mode:
Diffstat (limited to 'usertest.c')
-rw-r--r--usertest.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/usertest.c b/usertest.c
index 5df95f3..7a12896 100644
--- a/usertest.c
+++ b/usertest.c
@@ -315,6 +315,33 @@ static int test_feature_detect(void)
return 0;
}
+static int test_cmdline(void)
+{
+ char cmdline[256];
+ int actual;
+ const char *s, *c;
+
+ if (semi_get_cmdline(cmdline, sizeof(cmdline), &actual)) {
+ semi_write0("FAIL couldn't recover command line\n");
+ return 1;
+ }
+
+ if (strlen(BINARY_NAME) != actual) {
+ semi_write0("FAIL cmdline length not what expected: ");
+ semi_write0(cmdline);
+ return 1;
+ }
+
+ if (strcmp(cmdline, BINARY_NAME) != 0) {
+ semi_write0("FAIL unexpected command line: ");
+ semi_write0(cmdline);
+ return 1;
+ }
+
+ semi_write0("PASS command line test\n");
+ return 0;
+}
+
int main(void)
{
void *bufp;
@@ -366,6 +393,10 @@ int main(void)
return 1;
}
+ if (test_cmdline()) {
+ return 1;
+ }
+
semi_write0("ALL TESTS PASSED\n");
/* If we have EXIT_EXTENDED then use it */