[FFmpeg-devel] [PATCH] libavcodec/tests: Added test for libavcodec/avpacket.c
michael at niedermayer.cc
Wed Oct 26 16:45:41 EEST 2016
On Wed, Oct 26, 2016 at 03:03:07PM +0200, wm4 wrote:
> On Wed, 26 Oct 2016 14:56:01 +0200
> Michael Niedermayer <michael at niedermayer.cc> wrote:
> > On Wed, Oct 26, 2016 at 02:00:46PM +0200, wm4 wrote:
> > > On Sat, 22 Oct 2016 23:40:42 -0700
> > > Thomas Turner <thomastdt at googlemail.com> wrote:
> > >
> > > > Function(s) Tested: av_packet_clone().
> > > >
> > > > This test checks if av_packet_clone() can successfully make a copy of an AVPacket.
> > > > Compares all data members in AVPacket EXCEPT for "buf" because "buf" is initialized
> > > > to NIL in the original AVPacket [to be cloned].
> > > >
> > > > This test also prints out the all the contents of the original and cloned AVPackets.
> > > >
> > > > Signed-off-by: Thomas Turner <thomastdt at googlemail.com>
> > > > ---
> > >
> > > Am I the only one who thinks this test is overly complex and worthless?
> > > (Checks if each field got copied... come on, that's not useful. And
> > > would probably bitrot quickly as nobody would add new fields to the
> > > test anyway.)
> > what do you suggest, how to test it ?
> > or should we deprecate av_packet_clone()
> > nothing uses it, so the total lack of tests and uses means noone
> > would notice (quickly) if it broke ever
> > [...]
> I don't think it's the choice between either adding a test
> for av_packet_clone or deprecating it?
Its desirable to have code tested to identify problems, code thats
not tested at all bit rots eventually. The issue is propotional to
the complexity of the code and how activly it changes so the risk is
low with av_packet_clone() but still
> Also, av_packet_clone is 100% implemented using public functions and
> doesn't access any AVPacket fields itself.
yes but these public functions themselfs arent tested for completness
iam not arguing for a specific way of testing this, but that some
clean test would be desirable
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 181 bytes
Desc: Digital signature
More information about the ffmpeg-devel