Mercurial > hg > nginx-tests
comparison mp4.t @ 593:6c0a5903d0ae
Tests: cleanup now duplicating tests for no alerts.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 27 May 2015 17:09:22 +0300 |
parents | 847ea345becb |
children | 3021b44d0594 |
comparison
equal
deleted
inserted
replaced
592:355f2d5ff60f | 593:6c0a5903d0ae |
---|---|
56 . '-f lavfi -i testsrc=duration=20:size=320x200:rate=15 ' | 56 . '-f lavfi -i testsrc=duration=20:size=320x200:rate=15 ' |
57 . '-map 0:0 -map 1:0 -pix_fmt yuv420p -g 15 -c:v libx264 ' | 57 . '-map 0:0 -map 1:0 -pix_fmt yuv420p -g 15 -c:v libx264 ' |
58 . "${\($t->testdir())}/test.mp4") == 0 | 58 . "${\($t->testdir())}/test.mp4") == 0 |
59 or die "Can't create mp4 file: $!"; | 59 or die "Can't create mp4 file: $!"; |
60 | 60 |
61 $t->run()->plan(14); | 61 $t->run()->plan(13); |
62 | 62 |
63 ############################################################################### | 63 ############################################################################### |
64 | 64 |
65 is(durations($t, 0.0), '10.0 20.0', 'start zero'); | 65 is(durations($t, 0.0), '10.0 20.0', 'start zero'); |
66 is(durations($t, 2), '8.0 18.0', 'start integer'); | 66 is(durations($t, 2), '8.0 18.0', 'start integer'); |
84 unlike(http_head("/test.mp4?end=21"), qr!HTTP/1.1 500!, 'end beyond EOF'); | 84 unlike(http_head("/test.mp4?end=21"), qr!HTTP/1.1 500!, 'end beyond EOF'); |
85 unlike(http_head("/test.mp4?start=11"), qr!HTTP/1.1 500!, | 85 unlike(http_head("/test.mp4?start=11"), qr!HTTP/1.1 500!, |
86 'start beyond short track'); | 86 'start beyond short track'); |
87 like(http_head("/test.mp4?start=21"), qr!HTTP/1.1 500!, 'start beyond EOF'); | 87 like(http_head("/test.mp4?start=21"), qr!HTTP/1.1 500!, 'start beyond EOF'); |
88 | 88 |
89 # check for alerts, e.g., "zero buf in output", shouldn't be any | |
90 | |
91 like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); | |
92 | |
93 ############################################################################### | 89 ############################################################################### |
94 | 90 |
95 sub durations { | 91 sub durations { |
96 my ($t, $start, $end) = @_; | 92 my ($t, $start, $end) = @_; |
97 my $path = $t->{_testdir} . '/frag.mp4'; | 93 my $path = $t->{_testdir} . '/frag.mp4'; |