summaryrefslogtreecommitdiff
path: root/tests/sys_stat_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sys_stat_test.cpp')
-rw-r--r--tests/sys_stat_test.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/sys_stat_test.cpp b/tests/sys_stat_test.cpp
index a23100a6c..176d46243 100644
--- a/tests/sys_stat_test.cpp
+++ b/tests/sys_stat_test.cpp
@@ -20,6 +20,8 @@
#include <stdlib.h>
#include <sys/stat.h>
+#include "TemporaryFile.h"
+
TEST(sys_stat, futimens) {
FILE* fp = tmpfile();
ASSERT_TRUE(fp != NULL);
@@ -51,3 +53,18 @@ TEST(sys_stat, futimens_EBADF) {
ASSERT_EQ(-1, futimens(-1, times));
ASSERT_EQ(EBADF, errno);
}
+
+TEST(sys_stat, mkfifo) {
+ // Racy but probably sufficient way to get a suitable filename.
+ std::string path;
+ {
+ TemporaryFile tf;
+ path = tf.filename;
+ }
+
+ ASSERT_EQ(0, mkfifo(path.c_str(), 0666));
+ struct stat sb;
+ ASSERT_EQ(0, stat(path.c_str(), &sb));
+ ASSERT_TRUE(S_ISFIFO(sb.st_mode));
+ unlink(path.c_str());
+}