File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ include(CheckCXXCompilerFlag)
3
3
set (UNITTEST_SOURCES
4
4
allocatorstest.cpp
5
5
bigintegertest.cpp
6
+ clzlltest.cpp
6
7
cursorstreamwrappertest.cpp
7
8
documenttest.cpp
8
9
dtoatest.cpp
Original file line number Diff line number Diff line change
1
+ // Tencent is pleased to support the open source community by making RapidJSON available.
2
+ //
3
+ // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4
+ //
5
+ // Licensed under the MIT License (the "License"); you may not use this file except
6
+ // in compliance with the License. You may obtain a copy of the License at
7
+ //
8
+ // http://opensource.org/licenses/MIT
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software distributed
11
+ // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
+ // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
+ // specific language governing permissions and limitations under the License.
14
+
15
+ #include " unittest.h"
16
+ #include " rapidjson/internal/clzll.h"
17
+
18
+ #ifdef __GNUC__
19
+ RAPIDJSON_DIAG_PUSH
20
+ #endif
21
+
22
+ using namespace rapidjson ::internal;
23
+
24
+ TEST (clzll, normal) {
25
+ EXPECT_EQ (clzll (1 ), 0U );
26
+ EXPECT_EQ (clzll (2 ), 1U );
27
+ EXPECT_EQ (clzll (12 ), 3U );
28
+ EXPECT_EQ (clzll (0x0000000080000001UL ), 31U );
29
+ EXPECT_EQ (clzll (0x8000000000000001UL ), 63U );
30
+ }
31
+
32
+ #ifdef __GNUC__
33
+ RAPIDJSON_DIAG_POP
34
+ #endif
You can’t perform that action at this time.
0 commit comments