Signed-off-by: Martin Storsjö <martin@martin.st>
Martin Storsjö authored on 2012/10/06 07:38:37383 | 384 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,58 @@ |
0 |
+/* |
|
1 |
+ * Copyright (c) 2012 Martin Storsjo |
|
2 |
+ * |
|
3 |
+ * This file is part of Libav. |
|
4 |
+ * |
|
5 |
+ * Libav is free software; you can redistribute it and/or |
|
6 |
+ * modify it under the terms of the GNU Lesser General Public |
|
7 |
+ * License as published by the Free Software Foundation; either |
|
8 |
+ * version 2.1 of the License, or (at your option) any later version. |
|
9 |
+ * |
|
10 |
+ * Libav is distributed in the hope that it will be useful, |
|
11 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 |
+ * Lesser General Public License for more details. |
|
14 |
+ * |
|
15 |
+ * You should have received a copy of the GNU Lesser General Public |
|
16 |
+ * License along with Libav; if not, write to the Free Software |
|
17 |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
18 |
+ */ |
|
19 |
+ |
|
20 |
+#include "internal.h" |
|
21 |
+ |
|
22 |
+#undef printf |
|
23 |
+#undef exit |
|
24 |
+ |
|
25 |
+static void test(const char *base, const char *rel) |
|
26 |
+{ |
|
27 |
+ char buf[200], buf2[200]; |
|
28 |
+ ff_make_absolute_url(buf, sizeof(buf), base, rel); |
|
29 |
+ printf("%s\n", buf); |
|
30 |
+ if (base) { |
|
31 |
+ /* Test in-buffer replacement */ |
|
32 |
+ snprintf(buf2, sizeof(buf2), "%s", base); |
|
33 |
+ ff_make_absolute_url(buf2, sizeof(buf2), buf2, rel); |
|
34 |
+ if (strcmp(buf, buf2)) { |
|
35 |
+ printf("In-place handling of %s + %s failed\n", base, rel); |
|
36 |
+ exit(1); |
|
37 |
+ } |
|
38 |
+ } |
|
39 |
+} |
|
40 |
+ |
|
41 |
+int main(void) |
|
42 |
+{ |
|
43 |
+ test(NULL, "baz"); |
|
44 |
+ test("/foo/bar", "baz"); |
|
45 |
+ test("/foo/bar", "../baz"); |
|
46 |
+ test("/foo/bar", "/baz"); |
|
47 |
+ test("http://server/foo/", "baz"); |
|
48 |
+ test("http://server/foo/bar", "baz"); |
|
49 |
+ test("http://server/foo/", "../baz"); |
|
50 |
+ test("http://server/foo/bar/123", "../../baz"); |
|
51 |
+ test("http://server/foo/bar/123", "/baz"); |
|
52 |
+ test("http://server/foo/bar/123", "https://other/url"); |
|
53 |
+ test("http://server/foo/bar?param=value/with/slashes", "/baz"); |
|
54 |
+ test("http://server/foo/bar?param&otherparam", "?someparam"); |
|
55 |
+ test("http://server/foo/bar", "//other/url"); |
|
56 |
+ return 0; |
|
57 |
+} |
... | ... |
@@ -47,6 +47,7 @@ include $(SRC_PATH)/tests/fate/h264.mak |
47 | 47 |
include $(SRC_PATH)/tests/fate/image.mak |
48 | 48 |
include $(SRC_PATH)/tests/fate/indeo.mak |
49 | 49 |
include $(SRC_PATH)/tests/fate/libavcodec.mak |
50 |
+include $(SRC_PATH)/tests/fate/libavformat.mak |
|
50 | 51 |
include $(SRC_PATH)/tests/fate/libavutil.mak |
51 | 52 |
include $(SRC_PATH)/tests/fate/lossless-audio.mak |
52 | 53 |
include $(SRC_PATH)/tests/fate/lossless-video.mak |
... | ... |
@@ -81,6 +82,7 @@ FATE_AVCONV += $(FATE_AVCONV-yes) |
81 | 81 |
FATE-$(CONFIG_AVCONV) += $(FATE_AVCONV) |
82 | 82 |
|
83 | 83 |
FATE-$(CONFIG_AVCODEC) += $(FATE_LIBAVCODEC) |
84 |
+FATE-$(CONFIG_AVFORMAT) += $(FATE_LIBAVFORMAT) |
|
84 | 85 |
|
85 | 86 |
FATE_SAMPLES-$(CONFIG_AVCONV) += $(FATE_SAMPLES_AVCONV) |
86 | 87 |
FATE_SAMPLES += $(FATE_SAMPLES-yes) |