// Copyright 2014 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "src/base/atomicops.h" #include "testing/gtest/include/gtest/gtest.h" namespace v8 { namespace base { #define CHECK_EQU(v1, v2) … #define NUM_BITS(T) … template <class AtomicType> static void TestAtomicIncrement() { … } template <class AtomicType> static void TestCompareAndSwap() { … } template <class AtomicType> static void TestAtomicExchange() { … } template <class AtomicType> static void TestAtomicIncrementBounds() { … } // Return an AtomicType with the value 0xA5A5A5.. template <class AtomicType> static AtomicType TestFillValue() { … } // This is a simple sanity check to ensure that values are correct. // Not testing atomicity. template <class AtomicType> static void TestStore() { … } // Merge this test with TestStore as soon as we have Atomic8 acquire // and release stores. static void TestStoreAtomic8() { … } // This is a simple sanity check to ensure that values are correct. // Not testing atomicity. template <class AtomicType> static void TestLoad() { … } // Merge this test with TestLoad as soon as we have Atomic8 acquire // and release loads. static void TestLoadAtomic8() { … } TEST(Atomicops, AtomicIncrement) { … } TEST(Atomicops, CompareAndSwap) { … } TEST(Atomicops, AtomicExchange) { … } TEST(Atomicops, AtomicIncrementBounds) { … } TEST(Atomicops, Store) { … } TEST(Atomicops, Load) { … } TEST(Atomicops, Relaxed_Memmove) { … } TEST(Atomicops, Relaxed_Memcmp) { … } } // namespace base } // namespace v8