lkml.org 
[lkml]   [2013]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/8] perf tests: Add automated tests for formula object
On Fri, May 03, 2013 at 09:18:05AM -0600, David Ahern wrote:
> On 5/1/13 9:15 AM, Jiri Olsa wrote:
> >+static int __test_basics(char *file)
> >+{
> >+ struct perf_formula fml;
> >+ struct perf_formula_set *set;
> >+ struct perf_formula_counter *counter;
> >+ struct perf_evlist *evlist;
> >+ struct perf_evsel *evsel;
> >+ struct perf_counts *counts;
> >+ struct perf_formula_expr expr;
> >+ int ret;
> >+
> >+ pr_debug("file %s\n", file);
> >+
> >+ perf_formula__init(&fml);
> >+
> >+ ret = perf_formula__load(&fml, file);
> >+ TEST_ASSERT_VAL("failed to load formula", !ret);
>
> With all the asserts when something goes wrong you should delete the
> file right after perf_formula__load. so maybe
>
> file = file_get(data, sizeof(data));
> ret = perf_formula__load(&fml, file);
> file_put(file);

hum, the TEST_ASSERT_VAL call 'return' from __test_basics on error and
that goes back to test_basics where file_put is called..

thanks,
jirka


\
 
 \ /
  Last update: 2013-05-06 20:41    [W:0.043 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site