[ovs-dev] [PATCH 2/2] test-atomic: Re-enable atomic read-write-modify tests.

Ben Pfaff blp at nicira.com
Wed Jul 31 15:56:11 UTC 2013


Thanks, I applied both of these to master.

On Tue, Jul 30, 2013 at 07:33:52PM -0700, Ethan Jackson wrote:
> Acked-by: Ethan Jackson <ethan at nicira.com>
> 
> 
> On Thu, Jul 18, 2013 at 2:26 PM, Ben Pfaff <blp at nicira.com> wrote:
> > This reverts commit 05d299e0ccca80736cd4438c3224540c5448a7d4 (test-atomic:
> > Drop atomic read-modify-write tests for the moment.) because the
> > test for detecting whether GCC support atomic operation built-ins has
> > been fixed.
> >
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > ---
> >  tests/test-atomic.c |   27 ++++++++++++++++++++++++++-
> >  1 files changed, 26 insertions(+), 1 deletions(-)
> >
> > diff --git a/tests/test-atomic.c b/tests/test-atomic.c
> > index 21d8c9e..27bf552 100644
> > --- a/tests/test-atomic.c
> > +++ b/tests/test-atomic.c
> > @@ -22,7 +22,7 @@
> >  #define TEST_ATOMIC_TYPE(ATOMIC_TYPE, BASE_TYPE)        \
> >      {                                                   \
> >          ATOMIC_TYPE x = ATOMIC_VAR_INIT(1);             \
> > -        BASE_TYPE value;                                \
> > +        BASE_TYPE value, orig;                          \
> >                                                          \
> >          atomic_read(&x, &value);                        \
> >          ovs_assert(value == 1);                         \
> > @@ -34,6 +34,31 @@
> >          atomic_init(&x, 3);                             \
> >          atomic_read(&x, &value);                        \
> >          ovs_assert(value == 3);                         \
> > +                                                        \
> > +        atomic_add(&x, 1, &orig);                       \
> > +        ovs_assert(orig == 3);                          \
> > +        atomic_read(&x, &value);                        \
> > +        ovs_assert(value == 4);                         \
> > +                                                        \
> > +        atomic_sub(&x, 2, &orig);                       \
> > +        ovs_assert(orig == 4);                          \
> > +        atomic_read(&x, &value);                        \
> > +        ovs_assert(value == 2);                         \
> > +                                                        \
> > +        atomic_or(&x, 6, &orig);                        \
> > +        ovs_assert(orig == 2);                          \
> > +        atomic_read(&x, &value);                        \
> > +        ovs_assert(value == 6);                         \
> > +                                                        \
> > +        atomic_and(&x, 10, &orig);                      \
> > +        ovs_assert(orig == 6);                          \
> > +        atomic_read(&x, &value);                        \
> > +        ovs_assert(value == 2);                         \
> > +                                                        \
> > +        atomic_xor(&x, 10, &orig);                      \
> > +        ovs_assert(orig == 2);                          \
> > +        atomic_read(&x, &value);                        \
> > +        ovs_assert(value == 8);                         \
> >      }
> >
> >  int
> > --
> > 1.7.2.5
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list