From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 39869495B0 for ; Sat, 13 Apr 2024 14:21:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DA11C68D332; Sat, 13 Apr 2024 17:21:44 +0300 (EEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E518668D332 for ; Sat, 13 Apr 2024 17:21:37 +0300 (EEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1e424bd30fbso14303125ad.0 for ; Sat, 13 Apr 2024 07:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713018095; x=1713622895; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=eB5pHeKV7Ri2ifMri7IFfaT3kt79nDEjt60CfK2+1XU=; b=Pq0Y/Glmlh67VqwWJmQkdI3v1dVOtoWS6UsTm+303cWSBH8bIofSiV/U6hx91A4DEB HNQZg4t0JoqWIWilcq5rWblJ/HLDopBQ2XinwgCPQRmztovgPZx5jE1LstAn4VQFlM2c O23setzHBUlb4jo2OFu9UENmyHc3/Vs6JHWVp2LNZ3q1LkA0hosyrCGai3dymmMO38xX ji14dRdvo8TKqsZFWNokMtVxlplAnPIrnWvMFNGUM/UZD5ZG2fgSynA/HCzuJ4jdbNN3 2scMx3VCLHgG8h4E0N6IoZOwF7qYaSLbTowrUZPz2KzVdON6fTbnzUX4HBlxFN+D/TJQ dFEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713018095; x=1713622895; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eB5pHeKV7Ri2ifMri7IFfaT3kt79nDEjt60CfK2+1XU=; b=DbsHwalzd1HrYve+18NVbEeQ1C8Zvd+H2jP3MrtbnwHES2PwPq9LphVn8t7FOVd9Id Z2u+LNrMsg59o30RtWp7NgvAAcjcj/9aZ/FSRG/k3eFGd84bYlI5KTCfskuji7kQolTU 8O1dJMeDUIFO56qalG7pIeCQuDXINDamKIlCkK+CAWnhwL3KghOSS7jaZjRNN4ig1jsU pbXtQwyksjRwyYbMpLk3+ywI3quTnj32/CD25ilMhIXgqRhC8rlccsVUtLinQptM1frg 4VSl7Aa0ONkgAg/OQASO9VDUXFjQNKkATgvl0uQ2OFKUpfQbRfmUzuvEgmhrLt3nAZws ouBg== X-Gm-Message-State: AOJu0YwmWniliqLPhYiJpwPyPmsvJ4fRTKjttMFd1JIhpiz8oZ344aLJ +W9ZMq6jgpZiPufPAu0pmFIJUvEhRID0WbwS3xsHVUKnck1PhrmSw5bXCA== X-Google-Smtp-Source: AGHT+IGQemkrwbV0G0T4Ga7i/8+WZ1SGM+WKnmfapH4Dpii9I+Q+j3lUSKGm6Oa2gPqzQUlPJeUwYQ== X-Received: by 2002:a17:902:d4ce:b0:1e5:5cab:92ee with SMTP id o14-20020a170902d4ce00b001e55cab92eemr6489909plg.33.1713018095119; Sat, 13 Apr 2024 07:21:35 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d7-20020a170902654700b001e20afa1038sm4777715pln.8.2024.04.13.07.21.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 07:21:34 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 13 Apr 2024 11:21:28 -0300 Message-ID: <20240413142128.2889-1-jamrial@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240412231658.4625-1-jamrial@gmail.com> References: <20240412231658.4625-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avutil/tests/opt: test av_opt_find2() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: James Almer --- libavutil/tests/opt.c | 29 +++++++++++++++++++++++++++++ tests/ref/fate/opt | 4 ++++ 2 files changed, 33 insertions(+) diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c index bac0e80bd5..dc968567eb 100644 --- a/libavutil/tests/opt.c +++ b/libavutil/tests/opt.c @@ -452,5 +452,34 @@ int main(void) av_opt_free(&test_ctx); } + printf("\nTesting av_opt_find2()\n"); + { + TestContext test_ctx = { 0 }; + ChildContext child_ctx = { 0 }; + void *target; + const AVOption *opt; + + test_ctx.class = &test_class; + test_ctx.child = &child_ctx; + child_ctx.class = &child_class; + av_opt_set_defaults(&test_ctx); + av_opt_set_defaults(&child_ctx); + + av_log_set_level(AV_LOG_QUIET); + + opt = av_opt_find2(&test_ctx, "num", NULL, 0, 0, &target); + if (opt && target == &test_ctx) + printf("OK '%s'\n", opt->name); + else + printf("Error '%s'\n", "num"); + + opt = av_opt_find2(&test_ctx, "child_num", NULL, 0, AV_OPT_SEARCH_CHILDREN, &target); + if (opt && target == &child_ctx) + printf("OK '%s'\n", opt->name); + else + printf("Error '%s'\n", "child_num"); + av_opt_free(&test_ctx); + } + return 0; } diff --git a/tests/ref/fate/opt b/tests/ref/fate/opt index 05d57066a1..39659b2248 100644 --- a/tests/ref/fate/opt +++ b/tests/ref/fate/opt @@ -449,3 +449,7 @@ Setting options string 'a_very_long_option_name_that_will_need_to_be_ellipsized_ Setting 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here' to value '42' Option 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here' not found Error 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42' + +Testing av_opt_find2() +OK 'num' +OK 'child_num' -- 2.44.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".