From patchwork Tue Oct 11 03:56:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Turner X-Patchwork-Id: 964 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp187172vsd; Tue, 11 Oct 2016 23:22:44 -0700 (PDT) X-Received: by 10.28.54.140 with SMTP id y12mr1075525wmh.87.1476253364001; Tue, 11 Oct 2016 23:22:44 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id vu9si8499547wjb.227.2016.10.11.23.22.43; Tue, 11 Oct 2016 23:22:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE dis=QUARANTINE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 13A23689B91; Wed, 12 Oct 2016 09:22:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pa0-f65.google.com (mail-pa0-f65.google.com [209.85.220.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A16EB6898D0 for ; Tue, 11 Oct 2016 06:57:24 +0300 (EEST) Received: by mail-pa0-f65.google.com with SMTP id r9so734404paz.1 for ; Mon, 10 Oct 2016 20:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=433DAiaZft4vlhTc1oiH6YDGbcpso3eFwKHSSpdil94=; b=DVygv3vCg6XXWS9iXFr0u5Pn3FGKZiCTaj/OOTAv+mwoAD007pnWRQUcDognaPAQnn uPXIt9B0RbB5w4rtHHHSsKvq9n5rfi1SQe49jRftLF5/NiXL8u8NjyX3Za7VQ07LoJrj I2kPU3EM6KVIVD7PNsW1dUxcDyH20fbZ3uIw7TTrsWqChB8RUDjO4dl/+CB/64Gm0rTU qTZ9lRsm/+N+4vqBy/tq4R2rgKJMbMCwXTMG+dkOLfqHXqzkHpexoLLrMmnPhmdUTs1i blPgw/UJ8zMIMWiW1exksvBLLMXNjbounT9EEvoUO/MqKw/vAMG3n8ag5yXTvSIHHyoU mGJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=433DAiaZft4vlhTc1oiH6YDGbcpso3eFwKHSSpdil94=; b=apjy3MyyjBYETGQs+yty615625uJ4e9n/zDS6uURQzO5FEGUCe9zo6/nCZtgKN4BV9 WU2NamVIQ+fehKIC0/5wRDf7sVEc8oLXbHBrHCtVaTNt2R+jyURNTOep3vg9cul3KoW1 N+RCQO2/IJFUtHUK0pOjY7/Q0o33zRP1nki0Ufrp7miZC4o5tQp6A0WttAOJbSH7+NBz cukWmw77CZQm3yVIRJA+609SFFOm2ZWAPugKI9hErGvq2PjH9lW/tNBUrguq5KSJ5PZc iSCkC8qKtQXPwm5VtJTaNpMOMOKjl8X8PRXiDBhn7bOCWF7g9FpMNLrP14zYASdKeP6z 9I3Q== X-Gm-Message-State: AA6/9Rk/0ghzlHa2dtdhfZU+xORiUvuCnzrSaYHmk/MFCvJGCP9MGeM3aUNgRH204n3f6w== X-Received: by 10.66.192.134 with SMTP id hg6mr3222279pac.64.1476158260494; Mon, 10 Oct 2016 20:57:40 -0700 (PDT) Received: from Zany.domain.actdsltmp ([47.136.133.132]) by smtp.gmail.com with ESMTPSA id a88sm1225528pfe.21.2016.10.10.20.57.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Oct 2016 20:57:40 -0700 (PDT) From: Thomas Turner X-Google-Original-From: Thomas Turner To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2016 20:56:53 -0700 Message-Id: <1476158213-7542-3-git-send-email-thomastdt@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476158213-7542-1-git-send-email-thomastdt@gmail.com> References: <1476158213-7542-1-git-send-email-thomastdt@gmail.com> X-Mailman-Approved-At: Wed, 12 Oct 2016 09:22:32 +0300 Subject: [FFmpeg-devel] [PATCH 3/3] Selftest coverage for libavutil/fifo.c X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Thomas Turner MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixed trailing whitespace in fifo2.c selftest and fifo2 reference file that prevented the patch from being applied cleanly to git master --- libavutil/tests/fifo2.c | 17 +++++++++-------- tests/ref/fate/fifo2 | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libavutil/tests/fifo2.c b/libavutil/tests/fifo2.c index e40b8cd..11050c6 100644 --- a/libavutil/tests/fifo2.c +++ b/libavutil/tests/fifo2.c @@ -30,12 +30,13 @@ int main(void) int32_t elem[] = {0, 2, 4, 6, 8, 10, 12}; AVFifoBuffer* fifo; - data_size = sizeof(elem[0]); - fifo = av_fifo_alloc(sizeof(elem)); - /*fill fifo buffer*/ - if (av_fifo_generic_write(fifo, (void*)elem, av_fifo_space(fifo), NULL) != + data_size = sizeof(elem[0]); + fifo = av_fifo_alloc(sizeof(elem)); + space_size = av_fifo_space(fifo); + + if (av_fifo_generic_write(fifo, (void*)elem, space_size, NULL) != sizeof(elem)) { fprintf(stderr, "written incorrect number of bytes\n"); @@ -50,13 +51,13 @@ int main(void) (void) av_fifo_generic_peek(fifo, data_arr, fifo_size, NULL); - printf("fifo->buffer: "); + printf("fifo->buffer\t\t\t:"); for(offset = 0; offset < fifo_size/data_size; ++offset){ - printf("%" PRId32 ", ", data_arr[offset]); + printf(" %" PRId32 ",", data_arr[offset]); } space_size = av_fifo_space(fifo); - printf("\nspace before av_fifo_grow\t:%" PRId16 "\n", space_size); + printf("\nspace before av_fifo_grow\t: %" PRId16 "\n", space_size); /* grow AVFifoBuffer */ @@ -66,7 +67,7 @@ int main(void) space_size = av_fifo_space(fifo); - printf("space after av_fifo_grow\t:%" PRId16 "\n", space_size); + printf("space after av_fifo_grow\t: %" PRId16 "\n", space_size); /* free AVFifoBuffer and data_arr */ diff --git a/tests/ref/fate/fifo2 b/tests/ref/fate/fifo2 index 8df9243..b697c03 100644 --- a/tests/ref/fate/fifo2 +++ b/tests/ref/fate/fifo2 @@ -1,3 +1,3 @@ -fifo->buffer: 0, 2, 4, 6, 8, 10, 12, -space before av_fifo_grow :0 -space after av_fifo_grow :28 +fifo->buffer : 0, 2, 4, 6, 8, 10, 12, +space before av_fifo_grow : 0 +space after av_fifo_grow : 28