Skip to content

Commit

Permalink
Added new test cases.
Browse files Browse the repository at this point in the history
Deleted old test cases.
  • Loading branch information
Chung Leong committed May 5, 2014
1 parent 4fe8f44 commit 6055ecf
Show file tree
Hide file tree
Showing 16 changed files with 260 additions and 638 deletions.
41 changes: 12 additions & 29 deletions tests/animated-gif.phpt
Original file line number Diff line number Diff line change
@@ -1,42 +1,25 @@
--TEST--
Animated gif test
Animated GIF test
--SKIPIF--
<?php
if(!function_exists('imagecreatetruecolor')) print 'skip GD not available';
if(!in_array('gif', av_get_encoders())) print 'skip GIF encoder not avilable';
?>
--FILE--
<?php

$folder = dirname(__FILE__);
$image = imagecreatetruecolor(852 / 4, 480 / 4);
$file_in = av_file_open("$folder/source-code.mkv", "r");
$file_out = av_file_open("$folder/source-code-output.gif", "w");

$v_strm_in = av_stream_open($file_in, "video");
$v_strm_out = av_stream_open($file_out, "video", array( "width" => imagesx($image), "height" => imagesy($image)));

if(!$file_in || !$file_out || !$v_strm_in || !$v_strm_out) {
die();
}
require("helpers.php");

$v_time = 0;
while(!av_file_eof($file_in)) {
if(av_stream_read_image($v_strm_in, $image, $v_time)) {
av_stream_write_image($v_strm_out, $image, $v_time);
}
if($v_time > 8) {
break;
}
}

av_stream_close($v_strm_out);
av_file_close($file_out);
$folder = dirname(__FILE__);
$filename = "test.gif";

av_stream_close($v_strm_in);
av_file_close($file_in);
$testVideo = new TestVideo("$folder/$filename", 640, 480, 24, 5.0, true, false);
$testVideo->create();
$testVideo->verify();
$testVideo->delete();

echo filesize("$folder/source-code-output.gif");
echo "OK\n";

?>
--EXPECTREGEX--
\d{7,8}
--EXPECT--
OK
32 changes: 0 additions & 32 deletions tests/extract-audio.phpt

This file was deleted.

Loading

0 comments on commit 6055ecf

Please sign in to comment.