On Sat, 6 Oct 2012, Diego Biurrun wrote:

On Sat, Oct 06, 2012 at 02:05:21AM +0300, Martin Storsjö wrote:
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -376,7 +376,7 @@ SKIPHEADERS-$(CONFIG_NETWORK)            += network.h rtsp.h
 EXAMPLES  = metadata                                                    \
             output                                                      \

-TESTPROGS = seek
+TESTPROGS = seek url

Break the line, like above.

Fixed locally

--- a/tests/Makefile
+++ b/tests/Makefile
@@ -86,6 +87,7 @@ FATE_SAMPLES-$(CONFIG_AVCONV) += $(FATE_SAMPLES_AVCONV)

 FATE += $(FATE-yes)
+FATE += $(FATE_LIBAVFORMAT)
 FATE += $(FATE_LIBAVUTIL)

avformat can be disabled, so add this conditionally, similar to
avcodec above.

Fixed locally

--- /dev/null
+++ b/libavformat/url-test.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2012 Martin Storsjo

No 'ö'?

I prefer keeping the source files plain ascii as long as my name is the only thing that would require utf8.

+#include "internal.h"
+
+#undef printf
+#undef exit
+
+static void test(const char *base, const char *rel)
+{
+    char buf[200], buf2[200];
+    ff_make_absolute_url(buf, sizeof(buf), base, rel);
+    printf("%s\n", buf);
+    if (base) {
+        /* Test in-buffer replacement */
+        snprintf(buf2, sizeof(buf2), "%s", base);
+        ff_make_absolute_url(buf2, sizeof(buf2), buf2, rel);
+        if (strcmp(buf, buf2)) {
+            printf("In-place handling of %s + %s failed\n", base, rel);
+            exit(1);
+        }
+    }
+}
+
+int main(int argc, char **argv)
+{
+    test(NULL, "baz");
+    test("/foo/bar", "baz");
+    test("/foo/bar", "../baz");
+    test("/foo/bar", "/baz");
+    test("http://server/foo/";, "baz");
+    test("http://server/foo/bar";, "baz");
+    test("http://server/foo/";, "../baz");
+    test("http://server/foo/bar/123";, "../../baz");
+    test("http://server/foo/bar/123";, "/baz");
+    test("http://server/foo/bar/123";, "https://other/url";);
+    return 0;
+}
--- /dev/null
+++ b/tests/ref/fate/url
@@ -0,0 +1,10 @@
+baz
+/foo/baz
+/baz
+/baz
+http://server/foo/baz
+http://server/foo/baz
+http://server/baz
+http://server/baz
+http://server/baz
+https://other/url

I'd suggest that you move this patch to the end of the series so that
you don't have to make small changes to the test program in every
revision.  But do whatever you prefer.

Maybe, but adding them incrementally is slightly clearer about which feature addition is tested by which commit. But I'm ok with it either way if others prefer it one way or another as well.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to