summaryrefslogtreecommitdiffstats
path: root/testsuite/cdev01/test_main.c
diff options
context:
space:
mode:
authorChristian Mauderer <Christian.Mauderer@embedded-brains.de>2016-08-16 08:52:06 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-16 09:16:43 +0200
commit6634edbee85ed0b28c483d9fc6284f3ba6761f0f (patch)
tree0905d37bc5fe69c754b567765b84bd607397852e /testsuite/cdev01/test_main.c
parentrc.conf/net: Let interface option appear on a DHCP ifconfig_ line. (diff)
downloadrtems-libbsd-6634edbee85ed0b28c483d9fc6284f3ba6761f0f.tar.bz2
devfs: Create path.
Diffstat (limited to 'testsuite/cdev01/test_main.c')
-rw-r--r--testsuite/cdev01/test_main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/testsuite/cdev01/test_main.c b/testsuite/cdev01/test_main.c
index 898eb174..cbff9133 100644
--- a/testsuite/cdev01/test_main.c
+++ b/testsuite/cdev01/test_main.c
@@ -40,18 +40,24 @@
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include "test_cdev01.h"
#define TEST_NAME "LIBBSD CDEV 1"
-static void test_cdev(void)
+static void test_cdev(const char *path)
{
- const char *name = "test";
- const char *path = "/dev/test";
const struct timespec *timeout = NULL;
+ const char *name;
+
+ /* Remove leading "/dev/" and use the rest as a name. */
+ name = path + sizeof("/dev/") - 1;
+
+ printf("Test creating a cdev named \"%s\" at \"%s\".\n", name, path);
test_state state = TEST_NEW;
int rv = 0;
@@ -131,7 +137,8 @@ static void test_cdev(void)
static void
test_main(void)
{
- test_cdev();
+ test_cdev("/dev/test");
+ test_cdev("/dev/some/sub/dir/somedev");
exit(0);
}