Edit

kc3-lang/angle/src/tests/perf_tests/BitSetIteratorPerf.cpp

Branch :

  • Show log

    Commit

  • Author : Victor Costan
    Date : 2019-02-20 10:45:24
    Hash : ffd39978
    Message : test: Replace _TEST_CASE_ with _TEST_SUITE_. Googletest is (at last) converging with industry-standard terminology [1]. We previously called test suites "test cases", which was rather confusing for folks coming from any other testing framework. Chrome now has a googletest version that supports _TEST_SUITE_ macros instead of _TEST_CASE_, so this CL cleans up some of the outdated usage. [1] https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature Bug: chromium:925652 Change-Id: Ia0deec0bc4216ef1adabc33985a7cbda89682608 Reviewed-on: https://chromium-review.googlesource.com/c/1477418 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org>

  • src/tests/perf_tests/BitSetIteratorPerf.cpp
  • //
    // Copyright 2015 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    // IndexDataManagerPerfTest:
    //   Performance test for index buffer management.
    //
    
    #include "ANGLEPerfTest.h"
    
    #include <gmock/gmock.h>
    
    #include "common/bitset_utils.h"
    
    using namespace testing;
    
    namespace
    {
    
    template <typename T>
    class BitSetIteratorPerfTest : public ANGLEPerfTest
    {
      public:
        BitSetIteratorPerfTest();
    
        void step() override;
    
        T mBits;
    };
    
    template <typename T>
    BitSetIteratorPerfTest<T>::BitSetIteratorPerfTest() : ANGLEPerfTest("BitSetIteratorPerf", "_run", 1)
    {}
    
    template <typename T>
    void BitSetIteratorPerfTest<T>::step()
    {
        mBits.flip();
    
        for (size_t bit : mBits)
        {
            ANGLE_UNUSED_VARIABLE(bit);
        }
    
        mBits.reset();
    }
    
    // These type names unfortunately don't get printed correctly in Gtest.
    #if defined(ANGLE_IS_64_BIT_CPU)
    using TestTypes = Types<angle::IterableBitSet<32>, angle::BitSet32<32>, angle::BitSet64<32>>;
    #else
    using TestTypes = Types<angle::IterableBitSet<32>, angle::BitSet32<32>>;
    #endif  // defined(ANGLE_IS_64_BIT_CPU)
    TYPED_TEST_SUITE(BitSetIteratorPerfTest, TestTypes);
    
    TYPED_TEST(BitSetIteratorPerfTest, Run)
    {
        this->run();
    }
    
    }  // anonymous namespace