/mordor/tests/atomic.cpp

http://github.com/mozy/mordor · C++ · 14 lines · 10 code · 3 blank · 1 comment · 0 complexity · da76ec4651b28cd414c567c86da784ac MD5 · raw file

  1. // Copyright (c) 2010 - Mozy, Inc.
  2. #include "mordor/atomic.h"
  3. #include "mordor/test/test.h"
  4. using namespace Mordor;
  5. MORDOR_UNITTEST(Atomic, compareAndSwapNoSignExtension)
  6. {
  7. intptr_t storage = 0xb2d015c0;
  8. MORDOR_TEST_ASSERT_EQUAL(
  9. atomicCompareAndSwap(storage, (intptr_t)0xb2d015c1, (intptr_t)0xb2d015c0),
  10. (intptr_t)0xb2d015c0);
  11. }