From patchwork Sun Jan 1 04:42:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Turner X-Patchwork-Id: 2003 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp3479541vsb; Sat, 31 Dec 2016 20:50:55 -0800 (PST) X-Received: by 10.194.82.8 with SMTP id e8mr44568243wjy.97.1483246255840; Sat, 31 Dec 2016 20:50:55 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ik5si42437708wjb.84.2016.12.31.20.50.54; Sat, 31 Dec 2016 20:50:55 -0800 (PST) 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=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8EFA5689B14; Sun, 1 Jan 2017 06:50:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 91B36680D1B for ; Sun, 1 Jan 2017 06:50:41 +0200 (EET) Received: by mail-oi0-f65.google.com with SMTP id 3so34116224oih.1 for ; Sat, 31 Dec 2016 20:50:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:subject:date:message-id; bh=yWUGD0+0OIGCpkQUOTwo298XMmo1kw9/Zt8+hglIecQ=; b=JEEDwA5/hl6Ew+wjfATQVZBu1y4F1MFUbo8Ybdf21b0rUS91HfG2a/l/z366w1MpVU /dYuvs7cVCGc+z+oR2vdNmoqxpBnxbMi0dudHhE/GclKwWUE8OXzpAzw2U/LcsUqbFWi 8/mVvZtXok0SBZsk5lDk4nidGDo1E++WI3wH8xgyb4FL2vCFJ2xavFjXgnbyZFK1TM4P u2K0nHbyjadGXO8XRLTM7fpcsQEWN6nUXvRhZU8WBujPcj73h4nIYaWRmaIN1b3hglbB CQfDT5/+ZrRGJa8aFv1qH4bhBoCvYhsj0oxKOAfWbcWqbo10xFwADrfHBj5vhP+eAh9v YwSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=yWUGD0+0OIGCpkQUOTwo298XMmo1kw9/Zt8+hglIecQ=; b=LAb98++p8As9Jq1wgOZj1AAdqcOnD5jyXpRYUCIdRNF+j2yul1dpE7VImWlK0THecM Qt36rMe4qu4fTeSVt6HjihJNJ4yyF8QPV30lVpooalKNOW5rrwyoNqFqfL9Eqs5tZZg7 gq6nHXlKP7nnjgEi30ybLq3vChxEbFpMHMFNEeKcJEK/cfiSG56PO0LeuLnfGMfc8MdG wflYdyzmwXQ0LE5Q6i6d/9UIZUCi5N+cfrPz6i3uWvPVzh+lBQxeKNb6qWUMcR6GNqS7 eNkwq0CWWYA3uIIHSz+uuTB70CexcoGNXJp2o30xMvI6h/b+SNUPBbowFhbmHLn7z8wy Auhg== X-Gm-Message-State: AIkVDXJDPzVdk/TzbyFrIvd708AxDyCyImTd55HWGyWNHCGBxx+y+W/ItC2vH17lNcEOuw== X-Received: by 10.202.51.8 with SMTP id z8mr24360988oiz.79.1483245769824; Sat, 31 Dec 2016 20:42:49 -0800 (PST) Received: from Zany.attlocal.net (76-225-50-170.lightspeed.bkfdca.sbcglobal.net. [76.225.50.170]) by smtp.gmail.com with ESMTPSA id 22sm24400458oti.37.2016.12.31.20.42.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 31 Dec 2016 20:42:49 -0800 (PST) From: Thomas Turner To: ffmpeg-devel@ffmpeg.org Date: Sat, 31 Dec 2016 20:42:40 -0800 Message-Id: <1483245760-12302-1-git-send-email-thomastdt@googlemail.com> X-Mailer: git-send-email 1.9.1 Subject: [FFmpeg-devel] [PATCH] avutil/tests: improved code coverage for atomic 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Thomas Turner --- libavutil/tests/atomic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavutil/tests/atomic.c b/libavutil/tests/atomic.c index c92f220..e41bf5a 100644 --- a/libavutil/tests/atomic.c +++ b/libavutil/tests/atomic.c @@ -21,7 +21,9 @@ int main(void) { - volatile int val = 1; + volatile int val = 1; + void *tmp1 = (int *)&val; + void * volatile *tmp2 = &tmp1; int res; res = avpriv_atomic_int_add_and_fetch(&val, 1); @@ -29,6 +31,8 @@ int main(void) avpriv_atomic_int_set(&val, 3); res = avpriv_atomic_int_get(&val); av_assert0(res == 3); + avpriv_atomic_ptr_cas(tmp2, tmp1, &res); + av_assert0(*tmp2 == &res); return 0; }