xref: /aosp_15_r20/external/libwebm/webm_parser/tests/bit_utils_test.cc (revision 103e46e4cd4b6efcf6001f23fa8665fb110abf8d)
1 // Copyright (c) 2016 The WebM project authors. All Rights Reserved.
2 //
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the LICENSE file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS.  All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 #include "src/bit_utils.h"
9 
10 #include "gtest/gtest.h"
11 
12 using webm::CountLeadingZeros;
13 
14 namespace {
15 
16 class BitUtilsTest : public testing::Test {};
17 
TEST_F(BitUtilsTest,CountLeadingZeros)18 TEST_F(BitUtilsTest, CountLeadingZeros) {
19   EXPECT_EQ(8, CountLeadingZeros(0x00));
20   EXPECT_EQ(4, CountLeadingZeros(0x0f));
21   EXPECT_EQ(0, CountLeadingZeros(0xf0));
22 }
23 
24 }  // namespace
25