> -----Original Message----- > From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT > Ivan Khoronzhuk > Sent: Monday, November 23, 2015 11:21 PM > To: lng-odp@lists.linaro.org > Subject: [lng-odp] [API-NEXT PATCH v3 1/7] validation: time: don't assign > int directly to odp_time_t > > Under opaque type can be structure that cannot be used with direct > values, So, use conversion functions to get time_t to avoid build > issues. > > Signed-off-by: Ivan Khoronzhuk <ivan.khoronz...@linaro.org> > --- > test/validation/time/time.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/test/validation/time/time.c b/test/validation/time/time.c > index f70c776..3d05a6f 100644 > --- a/test/validation/time/time.c > +++ b/test/validation/time/time.c > @@ -36,8 +36,8 @@ void time_test_odp_negative_diff(void) > { > odp_time_t diff, t1, t2; > > - t1 = 10; > - t2 = 5; > + t1 = odp_time_local_from_ns(10); > + t2 = odp_time_local_from_ns(5); > diff = odp_time_diff(t2, t1); > CU_ASSERT(odp_time_cmp(diff, ODP_TIME_NULL) > 0);
This requires <5ns resolution, which is may not be available all times. Also "negative_diff" hints that it should be diff(5, 10) instead of diff(10, 5), which is positive after the diff API chance. -Petri > } > -- > 1.9.1 > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp