---
 libavutil/Makefile          |  1 +
 libavutil/tests/file_open.c | 28 ++++++++++++++++++++++++++++
 tests/fate/libavutil.mak    |  5 +++++
 3 files changed, 34 insertions(+)
 create mode 100644 libavutil/tests/file_open.c

diff --git a/libavutil/Makefile b/libavutil/Makefile
index 1647952f8f..8fef44c2c5 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -307,6 +307,7 @@ TESTPROGS = adler32                                         
            \
             tree                                                        \
             twofish                                                     \
             utf8                                                        \
+            file_open                                                   \
             uuid                                                        \
             video_enc_params                                            \
             xtea                                                        \
diff --git a/libavutil/tests/file_open.c b/libavutil/tests/file_open.c
new file mode 100644
index 0000000000..4ddbfa21c5
--- /dev/null
+++ b/libavutil/tests/file_open.c
@@ -0,0 +1,28 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <fcntl.h>
+#include "libavutil/file_open.h"
+
+int main(void)
+{
+    int fd = avpriv_open("no_such_file_xyz", O_RDONLY);
+    if (fd >= 0)
+        return 1; /* should have failed */
+    return 0;
+}
diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index e25f1e2b9c..077d750d24 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -204,6 +204,11 @@ fate-file: libavutil/tests/file$(EXESUF)
 fate-file: CMD = run libavutil/tests/file$(EXESUF) 
$(SRC_PATH)/libavutil/tests/file.c
 fate-file: CMP = null
 
+FATE_LIBAVUTIL += fate-avutil-file-open
+fate-avutil-file-open: libavutil/tests/file_open$(EXESUF)
+fate-avutil-file-open: CMD = run libavutil/tests/file_open$(EXESUF)
+fate-avutil-file-open: CMP = null
+
 FATE_LIBAVUTIL += $(FATE_LIBAVUTIL-yes)
 FATE-$(CONFIG_AVUTIL) += $(FATE_LIBAVUTIL)
 fate-libavutil: $(FATE_LIBAVUTIL)
-- 
2.51.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to