Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
1d6c2ba6
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1d6c2ba6
编写于
7月 29, 2020
作者:
N
Nikita Mikhaylov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rewrite other test + remove useless includes
上级
2909d965
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
215 addition
and
155 deletion
+215
-155
src/Compression/tests/compressed_buffer.cpp
src/Compression/tests/compressed_buffer.cpp
+0
-2
src/Compression/tests/gtest_compressionCodec.cpp
src/Compression/tests/gtest_compressionCodec.cpp
+0
-2
src/Core/tests/field.cpp
src/Core/tests/field.cpp
+0
-2
src/Dictionaries/tests/gtest_dictionary_configuration.cpp
src/Dictionaries/tests/gtest_dictionary_configuration.cpp
+0
-8
src/Formats/tests/tab_separated_streams.cpp
src/Formats/tests/tab_separated_streams.cpp
+0
-1
src/Functions/tests/CMakeLists.txt
src/Functions/tests/CMakeLists.txt
+0
-4
src/Functions/tests/gtest_abtesting.cpp
src/Functions/tests/gtest_abtesting.cpp
+14
-35
src/Functions/tests/gtest_number_traits.cpp
src/Functions/tests/gtest_number_traits.cpp
+201
-0
src/Functions/tests/number_traits.cpp
src/Functions/tests/number_traits.cpp
+0
-69
src/IO/tests/gtest_bit_io.cpp
src/IO/tests/gtest_bit_io.cpp
+0
-1
src/IO/tests/gtest_cascade_and_memory_write_buffer.cpp
src/IO/tests/gtest_cascade_and_memory_write_buffer.cpp
+0
-1
src/IO/tests/parse_int_perf.cpp
src/IO/tests/parse_int_perf.cpp
+0
-3
src/IO/tests/read_buffer.cpp
src/IO/tests/read_buffer.cpp
+0
-1
src/IO/tests/read_buffer_perf.cpp
src/IO/tests/read_buffer_perf.cpp
+0
-1
src/IO/tests/read_escaped_string.cpp
src/IO/tests/read_escaped_string.cpp
+0
-1
src/IO/tests/read_write_int.cpp
src/IO/tests/read_write_int.cpp
+0
-1
src/IO/tests/valid_utf8.cpp
src/IO/tests/valid_utf8.cpp
+0
-3
src/IO/tests/valid_utf8_perf.cpp
src/IO/tests/valid_utf8_perf.cpp
+0
-2
src/IO/tests/write_buffer.cpp
src/IO/tests/write_buffer.cpp
+0
-1
src/IO/tests/zlib_buffers.cpp
src/IO/tests/zlib_buffers.cpp
+0
-1
src/Parsers/tests/gtest_dictionary_parser.cpp
src/Parsers/tests/gtest_dictionary_parser.cpp
+0
-4
src/Parsers/tests/lexer.cpp
src/Parsers/tests/lexer.cpp
+0
-1
src/Parsers/tests/lexer_fuzzer.cpp
src/Parsers/tests/lexer_fuzzer.cpp
+0
-1
src/Storages/tests/get_abandonable_lock_in_all_partitions.cpp
...Storages/tests/get_abandonable_lock_in_all_partitions.cpp
+0
-3
src/Storages/tests/get_current_inserts_in_replicated.cpp
src/Storages/tests/get_current_inserts_in_replicated.cpp
+0
-2
src/Storages/tests/gtest_SplitTokenExtractor.cpp
src/Storages/tests/gtest_SplitTokenExtractor.cpp
+0
-1
src/Storages/tests/gtest_storage_log.cpp
src/Storages/tests/gtest_storage_log.cpp
+0
-1
src/Storages/tests/merge_selector.cpp
src/Storages/tests/merge_selector.cpp
+0
-1
src/Storages/tests/transform_part_zk_nodes.cpp
src/Storages/tests/transform_part_zk_nodes.cpp
+0
-2
未找到文件。
src/Compression/tests/compressed_buffer.cpp
浏览文件 @
1d6c2ba6
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <Core/Types.h>
#include <Common/Stopwatch.h>
#include <IO/WriteBufferFromFile.h>
#include <IO/ReadBufferFromFile.h>
...
...
src/Compression/tests/gtest_compressionCodec.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -11,8 +11,6 @@
#include <Parsers/IParser.h>
#include <Parsers/TokenIterator.h>
#include <fmt/format.h>
#include <random>
#include <bitset>
#include <cmath>
...
...
src/Core/tests/field.cpp
浏览文件 @
1d6c2ba6
#include <iostream>
#include <iomanip>
#include <sstream>
#include <Core/Field.h>
#include <Common/FieldVisitors.h>
#include <Common/Stopwatch.h>
#include <IO/WriteBufferFromFileDescriptor.h>
#include <IO/ReadHelpers.h>
#include <DataTypes/DataTypeString.h>
...
...
src/Dictionaries/tests/gtest_dictionary_configuration.cpp
浏览文件 @
1d6c2ba6
#include <iostream>
#include <sstream>
#include <Core/Types.h>
#include <Poco/Util/XMLConfiguration.h>
#include <Parsers/ASTCreateQuery.h>
#include <Parsers/ASTDropQuery.h>
#include <Parsers/DumpASTNode.h>
#include <Parsers/ParserCreateQuery.h>
#include <Parsers/ParserDictionary.h>
#include <Parsers/ParserDropQuery.h>
#include <Parsers/ParserTablePropertiesQuery.h>
#include <Parsers/TablePropertiesQueriesASTs.h>
#include <Parsers/formatAST.h>
#include <Parsers/parseQuery.h>
#include <Dictionaries/getDictionaryConfigurationFromAST.h>
...
...
src/Formats/tests/tab_separated_streams.cpp
浏览文件 @
1d6c2ba6
#include <string>
#include <iostream>
#include <fstream>
#include <IO/ReadBufferFromFile.h>
#include <IO/WriteBufferFromFile.h>
...
...
src/Functions/tests/CMakeLists.txt
浏览文件 @
1d6c2ba6
add_executable
(
number_traits number_traits.cpp
)
#add_executable (abtesting abtesting.cpp)
target_link_libraries
(
number_traits PRIVATE dbms
)
#target_link_libraries (abtesting PRIVATE clickhouse_functions)
src/Functions/tests/gtest_abtesting.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -62,59 +62,38 @@ Variants test_bayesab(std::string dist, PODArray<Float64> xs, PODArray<Float64>
return
variants
;
}
TEST
(
BayesAB
,
test_1
)
TEST
(
BayesAB
,
beta
)
{
size_t
max
=
0
,
min
=
0
;
auto
variants
=
test_bayesab
(
"beta"
,
{
10000
,
1000
,
900
},
{
600
,
110
,
90
},
max
,
min
);
auto
variants
=
test_bayesab
(
"beta"
,
{
10000
,
1000
,
900
},
{
600
,
110
,
90
},
max
,
min
);
ASSERT_EQ
(
1
,
max
);
}
TEST
(
BayesAB
,
test_2
)
{
size_t
max
=
0
,
min
=
0
;
auto
variants
=
test_bayesab
(
"beta"
,
{
3000
,
3000
,
3000
},
{
600
,
100
,
90
},
max
,
min
);
variants
=
test_bayesab
(
"beta"
,
{
3000
,
3000
,
3000
},
{
600
,
100
,
90
},
max
,
min
);
ASSERT_EQ
(
0
,
max
);
}
TEST
(
BayesAB
,
test_3
)
{
size_t
max
=
0
,
min
=
0
;
auto
variants
=
test_bayesab
(
"beta"
,
{
3000
,
3000
,
3000
},
{
100
,
90
,
110
},
max
,
min
);
variants
=
test_bayesab
(
"beta"
,
{
3000
,
3000
,
3000
},
{
100
,
90
,
110
},
max
,
min
);
ASSERT_EQ
(
2
,
max
);
}
TEST
(
BayesAB
,
test_4
)
{
size_t
max
=
0
,
min
=
0
;
auto
variants
=
test_bayesab
(
"beta"
,
{
3000
,
3000
,
3000
},
{
110
,
90
,
100
},
max
,
min
);
variants
=
test_bayesab
(
"beta"
,
{
3000
,
3000
,
3000
},
{
110
,
90
,
100
},
max
,
min
);
ASSERT_EQ
(
0
,
max
);
}
TEST
(
BayesAB
,
test_5
)
TEST
(
BayesAB
,
gamma
)
{
size_t
max
=
0
,
min
=
0
;
auto
variants
=
test_bayesab
(
"gamma"
,
{
10000
,
1000
,
900
},
{
600
,
110
,
90
},
max
,
min
);
ASSERT_EQ
(
1
,
max
);
}
TEST
(
BayesAB
,
test_6
)
{
size_t
max
=
0
,
min
=
0
;
auto
variants
=
test_bayesab
(
"gamma"
,
{
3000
,
3000
,
3000
},
{
600
,
100
,
90
},
max
,
min
);
variants
=
test_bayesab
(
"gamma"
,
{
3000
,
3000
,
3000
},
{
600
,
100
,
90
},
max
,
min
);
ASSERT_EQ
(
0
,
max
);
}
TEST
(
BayesAB
,
test_7
)
{
size_t
max
=
0
,
min
=
0
;
auto
variants
=
test_bayesab
(
"gamma"
,
{
3000
,
3000
,
3000
},
{
100
,
90
,
110
},
max
,
min
);
variants
=
test_bayesab
(
"gamma"
,
{
3000
,
3000
,
3000
},
{
100
,
90
,
110
},
max
,
min
);
ASSERT_EQ
(
2
,
max
);
}
TEST
(
BayesAB
,
test_8
)
{
size_t
max
=
0
,
min
=
0
;
auto
variants
=
test_bayesab
(
"gamma"
,
{
3000
,
3000
,
3000
},
{
110
,
90
,
100
},
max
,
min
);
variants
=
test_bayesab
(
"gamma"
,
{
3000
,
3000
,
3000
},
{
110
,
90
,
100
},
max
,
min
);
ASSERT_EQ
(
0
,
max
);
}
src/Functions/tests/gtest_number_traits.cpp
0 → 100644
浏览文件 @
1d6c2ba6
#include <gtest/gtest.h>
#include <iostream>
#include <map>
#include <DataTypes/NumberTraits.h>
static
const
std
::
map
<
std
::
pair
<
std
::
string
,
std
::
string
>
,
std
::
string
>
answer
=
{
{{
"UInt8"
,
"UInt8"
},
"UInt8"
},
{{
"UInt8"
,
"UInt16"
},
"UInt16"
},
{{
"UInt8"
,
"UInt32"
},
"UInt32"
},
{{
"UInt8"
,
"UInt64"
},
"UInt64"
},
{{
"UInt8"
,
"Int8"
},
"Int16"
},
{{
"UInt8"
,
"Int16"
},
"Int16"
},
{{
"UInt8"
,
"Int32"
},
"Int32"
},
{{
"UInt8"
,
"Int64"
},
"Int64"
},
{{
"UInt8"
,
"Float32"
},
"Float32"
},
{{
"UInt8"
,
"Float64"
},
"Float64"
},
{{
"UInt16"
,
"UInt8"
},
"UInt16"
},
{{
"UInt16"
,
"UInt16"
},
"UInt16"
},
{{
"UInt16"
,
"UInt32"
},
"UInt32"
},
{{
"UInt16"
,
"UInt64"
},
"UInt64"
},
{{
"UInt16"
,
"Int8"
},
"Int32"
},
{{
"UInt16"
,
"Int16"
},
"Int32"
},
{{
"UInt16"
,
"Int32"
},
"Int32"
},
{{
"UInt16"
,
"Int64"
},
"Int64"
},
{{
"UInt16"
,
"Float32"
},
"Float32"
},
{{
"UInt16"
,
"Float64"
},
"Float64"
},
{{
"UInt32"
,
"UInt8"
},
"UInt32"
},
{{
"UInt32"
,
"UInt16"
},
"UInt32"
},
{{
"UInt32"
,
"UInt32"
},
"UInt32"
},
{{
"UInt32"
,
"UInt64"
},
"UInt64"
},
{{
"UInt32"
,
"Int8"
},
"Int64"
},
{{
"UInt32"
,
"Int16"
},
"Int64"
},
{{
"UInt32"
,
"Int32"
},
"Int64"
},
{{
"UInt32"
,
"Int64"
},
"Int64"
},
{{
"UInt32"
,
"Float32"
},
"Float64"
},
{{
"UInt32"
,
"Float64"
},
"Float64"
},
{{
"UInt64"
,
"UInt8"
},
"UInt64"
},
{{
"UInt64"
,
"UInt16"
},
"UInt64"
},
{{
"UInt64"
,
"UInt32"
},
"UInt64"
},
{{
"UInt64"
,
"UInt64"
},
"UInt64"
},
{{
"UInt64"
,
"Int8"
},
"Error"
},
{{
"UInt64"
,
"Int16"
},
"Error"
},
{{
"UInt64"
,
"Int32"
},
"Error"
},
{{
"UInt64"
,
"Int64"
},
"Error"
},
{{
"UInt64"
,
"Float32"
},
"Error"
},
{{
"UInt64"
,
"Float64"
},
"Error"
},
{{
"Int8"
,
"UInt8"
},
"Int16"
},
{{
"Int8"
,
"UInt16"
},
"Int32"
},
{{
"Int8"
,
"UInt32"
},
"Int64"
},
{{
"Int8"
,
"UInt64"
},
"Error"
},
{{
"Int8"
,
"Int8"
},
"Int8"
},
{{
"Int8"
,
"Int16"
},
"Int16"
},
{{
"Int8"
,
"Int32"
},
"Int32"
},
{{
"Int8"
,
"Int64"
},
"Int64"
},
{{
"Int8"
,
"Float32"
},
"Float32"
},
{{
"Int8"
,
"Float64"
},
"Float64"
},
{{
"Int16"
,
"UInt8"
},
"Int16"
},
{{
"Int16"
,
"UInt16"
},
"Int32"
},
{{
"Int16"
,
"UInt32"
},
"Int64"
},
{{
"Int16"
,
"UInt64"
},
"Error"
},
{{
"Int16"
,
"Int8"
},
"Int16"
},
{{
"Int16"
,
"Int16"
},
"Int16"
},
{{
"Int16"
,
"Int32"
},
"Int32"
},
{{
"Int16"
,
"Int64"
},
"Int64"
},
{{
"Int16"
,
"Float32"
},
"Float32"
},
{{
"Int16"
,
"Float64"
},
"Float64"
},
{{
"Int32"
,
"UInt8"
},
"Int32"
},
{{
"Int32"
,
"UInt16"
},
"Int32"
},
{{
"Int32"
,
"UInt32"
},
"Int64"
},
{{
"Int32"
,
"UInt64"
},
"Error"
},
{{
"Int32"
,
"Int8"
},
"Int32"
},
{{
"Int32"
,
"Int16"
},
"Int32"
},
{{
"Int32"
,
"Int32"
},
"Int32"
},
{{
"Int32"
,
"Int64"
},
"Int64"
},
{{
"Int32"
,
"Float32"
},
"Float64"
},
{{
"Int32"
,
"Float64"
},
"Float64"
},
{{
"Int64"
,
"UInt8"
},
"Int64"
},
{{
"Int64"
,
"UInt16"
},
"Int64"
},
{{
"Int64"
,
"UInt32"
},
"Int64"
},
{{
"Int64"
,
"UInt64"
},
"Error"
},
{{
"Int64"
,
"Int8"
},
"Int64"
},
{{
"Int64"
,
"Int16"
},
"Int64"
},
{{
"Int64"
,
"Int32"
},
"Int64"
},
{{
"Int64"
,
"Int64"
},
"Int64"
},
{{
"Int64"
,
"Float32"
},
"Error"
},
{{
"Int64"
,
"Float64"
},
"Error"
},
{{
"Float32"
,
"UInt8"
},
"Float32"
},
{{
"Float32"
,
"UInt16"
},
"Float32"
},
{{
"Float32"
,
"UInt32"
},
"Float64"
},
{{
"Float32"
,
"UInt64"
},
"Error"
},
{{
"Float32"
,
"Int8"
},
"Float32"
},
{{
"Float32"
,
"Int16"
},
"Float32"
},
{{
"Float32"
,
"Int32"
},
"Float64"
},
{{
"Float32"
,
"Int64"
},
"Error"
},
{{
"Float32"
,
"Float32"
},
"Float32"
},
{{
"Float32"
,
"Float64"
},
"Float64"
},
{{
"Float64"
,
"UInt8"
},
"Float64"
},
{{
"Float64"
,
"UInt16"
},
"Float64"
},
{{
"Float64"
,
"UInt32"
},
"Float64"
},
{{
"Float64"
,
"UInt64"
},
"Error"
},
{{
"Float64"
,
"Int8"
},
"Float64"
},
{{
"Float64"
,
"Int16"
},
"Float64"
},
{{
"Float64"
,
"Int32"
},
"Float64"
},
{{
"Float64"
,
"Int64"
},
"Error"
},
{{
"Float64"
,
"Float32"
},
"Float64"
},
{{
"Float64"
,
"Float64"
},
"Float64"
}
};
static
std
::
string
getTypeString
(
DB
::
UInt8
)
{
return
"UInt8"
;
}
static
std
::
string
getTypeString
(
DB
::
UInt16
)
{
return
"UInt16"
;
}
static
std
::
string
getTypeString
(
DB
::
UInt32
)
{
return
"UInt32"
;
}
static
std
::
string
getTypeString
(
DB
::
UInt64
)
{
return
"UInt64"
;
}
static
std
::
string
getTypeString
(
DB
::
Int8
)
{
return
"Int8"
;
}
static
std
::
string
getTypeString
(
DB
::
Int16
)
{
return
"Int16"
;
}
static
std
::
string
getTypeString
(
DB
::
Int32
)
{
return
"Int32"
;
}
static
std
::
string
getTypeString
(
DB
::
Int64
)
{
return
"Int64"
;
}
static
std
::
string
getTypeString
(
DB
::
Float32
)
{
return
"Float32"
;
}
static
std
::
string
getTypeString
(
DB
::
Float64
)
{
return
"Float64"
;
}
static
std
::
string
getTypeString
(
DB
::
NumberTraits
::
Error
)
{
return
"Error"
;
}
template
<
typename
T0
,
typename
T1
>
[[
maybe_unused
]]
void
printTypes
()
{
std
::
cout
<<
"{{
\"
"
;
std
::
cout
<<
getTypeString
(
T0
());
std
::
cout
<<
"
\"
,
\"
"
;
std
::
cout
<<
getTypeString
(
T1
());
std
::
cout
<<
"
\"
},
\"
"
;
std
::
cout
<<
getTypeString
(
typename
DB
::
NumberTraits
::
ResultOfIf
<
T0
,
T1
>::
Type
());
std
::
cout
<<
"
\"
},"
<<
std
::
endl
;
}
template
<
typename
T0
,
typename
T1
>
void
ifRightType
()
{
auto
desired
=
getTypeString
(
typename
DB
::
NumberTraits
::
ResultOfIf
<
T0
,
T1
>::
Type
());
auto
left
=
getTypeString
(
T0
());
auto
right
=
getTypeString
(
T1
());
auto
expected
=
answer
.
find
({
left
,
right
});
ASSERT_TRUE
(
expected
!=
answer
.
end
());
ASSERT_EQ
(
expected
->
second
,
desired
);
}
template
<
typename
T0
>
void
ifLeftType
()
{
ifRightType
<
T0
,
DB
::
UInt8
>
();
ifRightType
<
T0
,
DB
::
UInt16
>
();
ifRightType
<
T0
,
DB
::
UInt32
>
();
ifRightType
<
T0
,
DB
::
UInt64
>
();
ifRightType
<
T0
,
DB
::
Int8
>
();
ifRightType
<
T0
,
DB
::
Int16
>
();
ifRightType
<
T0
,
DB
::
Int32
>
();
ifRightType
<
T0
,
DB
::
Int64
>
();
ifRightType
<
T0
,
DB
::
Float32
>
();
ifRightType
<
T0
,
DB
::
Float64
>
();
}
TEST
(
NumberTraits
,
ResultOfAdditionMultiplication
)
{
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfAdditionMultiplication
<
DB
::
UInt8
,
DB
::
UInt8
>::
Type
()),
"UInt16"
);
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfAdditionMultiplication
<
DB
::
UInt8
,
DB
::
Int32
>::
Type
()),
"Int64"
);
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfAdditionMultiplication
<
DB
::
UInt8
,
DB
::
Float32
>::
Type
()),
"Float64"
);
}
TEST
(
NumberTraits
,
ResultOfSubtraction
)
{
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfSubtraction
<
DB
::
UInt8
,
DB
::
UInt8
>::
Type
()),
"Int16"
);
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfSubtraction
<
DB
::
UInt16
,
DB
::
UInt8
>::
Type
()),
"Int32"
);
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfSubtraction
<
DB
::
UInt16
,
DB
::
Int8
>::
Type
()),
"Int32"
);
}
TEST
(
NumberTraits
,
Others
)
{
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfFloatingPointDivision
<
DB
::
UInt16
,
DB
::
Int16
>::
Type
()),
"Float64"
);
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfFloatingPointDivision
<
DB
::
UInt32
,
DB
::
Int16
>::
Type
()),
"Float64"
);
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfIntegerDivision
<
DB
::
UInt8
,
DB
::
Int16
>::
Type
()),
"Int8"
);
ASSERT_EQ
(
getTypeString
(
DB
::
NumberTraits
::
ResultOfModulo
<
DB
::
UInt32
,
DB
::
Int8
>::
Type
()),
"Int8"
);
}
TEST
(
NumberTraits
,
FunctionIf
)
{
ifLeftType
<
DB
::
UInt8
>
();
ifLeftType
<
DB
::
UInt16
>
();
ifLeftType
<
DB
::
UInt32
>
();
ifLeftType
<
DB
::
UInt64
>
();
ifLeftType
<
DB
::
Int8
>
();
ifLeftType
<
DB
::
Int16
>
();
ifLeftType
<
DB
::
Int32
>
();
ifLeftType
<
DB
::
Int64
>
();
ifLeftType
<
DB
::
Float32
>
();
ifLeftType
<
DB
::
Float64
>
();
}
src/Functions/tests/number_traits.cpp
已删除
100644 → 0
浏览文件 @
2909d965
#include <iostream>
#include <DataTypes/NumberTraits.h>
static
void
printType
(
DB
::
UInt8
)
{
std
::
cout
<<
"UInt8"
;
}
static
void
printType
(
DB
::
UInt16
)
{
std
::
cout
<<
"UInt16"
;
}
static
void
printType
(
DB
::
UInt32
)
{
std
::
cout
<<
"UInt32"
;
}
static
void
printType
(
DB
::
UInt64
)
{
std
::
cout
<<
"UInt64"
;
}
static
void
printType
(
DB
::
Int8
)
{
std
::
cout
<<
"Int8"
;
}
static
void
printType
(
DB
::
Int16
)
{
std
::
cout
<<
"Int16"
;
}
static
void
printType
(
DB
::
Int32
)
{
std
::
cout
<<
"Int32"
;
}
static
void
printType
(
DB
::
Int64
)
{
std
::
cout
<<
"Int64"
;
}
static
void
printType
(
DB
::
Float32
)
{
std
::
cout
<<
"Float32"
;
}
static
void
printType
(
DB
::
Float64
)
{
std
::
cout
<<
"Float64"
;
}
static
void
printType
(
DB
::
NumberTraits
::
Error
)
{
std
::
cout
<<
"Error"
;
}
template
<
typename
T0
,
typename
T1
>
void
ifRightType
()
{
printType
(
T0
());
std
::
cout
<<
", "
;
printType
(
T1
());
std
::
cout
<<
" -> "
;
printType
(
typename
DB
::
NumberTraits
::
ResultOfIf
<
T0
,
T1
>::
Type
());
std
::
cout
<<
std
::
endl
;
}
template
<
typename
T0
>
void
ifLeftType
()
{
ifRightType
<
T0
,
DB
::
UInt8
>
();
ifRightType
<
T0
,
DB
::
UInt16
>
();
ifRightType
<
T0
,
DB
::
UInt32
>
();
ifRightType
<
T0
,
DB
::
UInt64
>
();
ifRightType
<
T0
,
DB
::
Int8
>
();
ifRightType
<
T0
,
DB
::
Int16
>
();
ifRightType
<
T0
,
DB
::
Int32
>
();
ifRightType
<
T0
,
DB
::
Int64
>
();
ifRightType
<
T0
,
DB
::
Float32
>
();
ifRightType
<
T0
,
DB
::
Float64
>
();
}
int
main
(
int
,
char
**
)
{
printType
(
DB
::
NumberTraits
::
ResultOfAdditionMultiplication
<
DB
::
UInt8
,
DB
::
UInt8
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfAdditionMultiplication
<
DB
::
UInt8
,
DB
::
Int32
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfAdditionMultiplication
<
DB
::
UInt8
,
DB
::
Float32
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfSubtraction
<
DB
::
UInt8
,
DB
::
UInt8
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfSubtraction
<
DB
::
UInt16
,
DB
::
UInt8
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfSubtraction
<
DB
::
UInt16
,
DB
::
Int8
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfFloatingPointDivision
<
DB
::
UInt16
,
DB
::
Int16
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfFloatingPointDivision
<
DB
::
UInt32
,
DB
::
Int16
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfIntegerDivision
<
DB
::
UInt8
,
DB
::
Int16
>::
Type
());
std
::
cout
<<
std
::
endl
;
printType
(
DB
::
NumberTraits
::
ResultOfModulo
<
DB
::
UInt32
,
DB
::
Int8
>::
Type
());
std
::
cout
<<
std
::
endl
;
ifLeftType
<
DB
::
UInt8
>
();
ifLeftType
<
DB
::
UInt16
>
();
ifLeftType
<
DB
::
UInt32
>
();
ifLeftType
<
DB
::
UInt64
>
();
ifLeftType
<
DB
::
Int8
>
();
ifLeftType
<
DB
::
Int16
>
();
ifLeftType
<
DB
::
Int32
>
();
ifLeftType
<
DB
::
Int64
>
();
ifLeftType
<
DB
::
Float32
>
();
ifLeftType
<
DB
::
Float64
>
();
return
0
;
}
src/IO/tests/gtest_bit_io.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -8,7 +8,6 @@
#include <Common/PODArray.h>
#include <cmath>
#include <iomanip>
#include <memory>
#include <bitset>
#include <string>
...
...
src/IO/tests/gtest_cascade_and_memory_write_buffer.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -5,7 +5,6 @@
#include <IO/CascadeWriteBuffer.h>
#include <IO/MemoryReadWriteBuffer.h>
#include <IO/WriteBufferFromTemporaryFile.h>
#include <IO/ReadBufferFromString.h>
#include <IO/WriteBufferFromString.h>
#include <IO/ConcatReadBuffer.h>
#include <IO/copyData.h>
...
...
src/IO/tests/parse_int_perf.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -7,9 +7,6 @@
#include <IO/WriteHelpers.h>
#include <IO/WriteIntText.h>
#include <IO/WriteBufferFromVector.h>
#include <IO/WriteBufferFromString.h>
#include <IO/AsynchronousWriteBuffer.h>
#include <Compression/CompressedWriteBuffer.h>
#include <Compression/CompressedReadBuffer.h>
#include <Common/Stopwatch.h>
...
...
src/IO/tests/read_buffer.cpp
浏览文件 @
1d6c2ba6
#include <string>
#include <iostream>
#include <sstream>
#include <Core/Types.h>
#include <IO/ReadHelpers.h>
...
...
src/IO/tests/read_buffer_perf.cpp
浏览文件 @
1d6c2ba6
#include <string>
#include <iostream>
#include <fstream>
#include <Core/Types.h>
#include <IO/ReadHelpers.h>
...
...
src/IO/tests/read_escaped_string.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -2,7 +2,6 @@
#include <iostream>
#include <Core/Types.h>
#include <IO/ReadHelpers.h>
#include <IO/ReadBufferFromMemory.h>
#include <IO/ConcatReadBuffer.h>
...
...
src/IO/tests/read_write_int.cpp
浏览文件 @
1d6c2ba6
#include <string>
#include <iostream>
#include <sstream>
#include <Core/Types.h>
#include <IO/ReadBufferFromString.h>
...
...
src/IO/tests/valid_utf8.cpp
浏览文件 @
1d6c2ba6
#include <IO/WriteBufferValidUTF8.h>
#include <IO/WriteBufferFromString.h>
#include <IO/ReadHelpers.h>
#include <IO/WriteHelpers.h>
#include <string>
#include <streambuf>
#include <iostream>
#include <cstdio>
int
main
(
int
,
char
**
)
{
...
...
src/IO/tests/valid_utf8_perf.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -2,9 +2,7 @@
#include <IO/WriteBufferFromString.h>
#include <Common/Stopwatch.h>
#include <string>
#include <streambuf>
#include <iostream>
#include <cstdio>
int
main
(
int
argc
,
char
**
argv
)
{
...
...
src/IO/tests/write_buffer.cpp
浏览文件 @
1d6c2ba6
#include <string>
#include <iostream>
#include <sstream>
#include <Core/Types.h>
#include <IO/WriteHelpers.h>
...
...
src/IO/tests/zlib_buffers.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -3,7 +3,6 @@
#include <iostream>
#include <iomanip>
#include <Core/Types.h>
#include <Common/Stopwatch.h>
#include <IO/WriteBufferFromFile.h>
#include <IO/ReadBufferFromFile.h>
...
...
src/Parsers/tests/gtest_dictionary_parser.cpp
浏览文件 @
1d6c2ba6
#include <iostream>
#include <Core/Types.h>
#include <Parsers/ASTCreateQuery.h>
#include <Parsers/ASTDropQuery.h>
#include <Parsers/ParserDictionary.h>
#include <Parsers/ParserCreateQuery.h>
#include <Parsers/ParserDropQuery.h>
#include <Parsers/formatAST.h>
...
...
@@ -11,7 +8,6 @@
#include <Parsers/DumpASTNode.h>
#include <Parsers/TablePropertiesQueriesASTs.h>
#include <Parsers/ParserTablePropertiesQuery.h>
#include <sstream>
#include <gtest/gtest.h>
...
...
src/Parsers/tests/lexer.cpp
浏览文件 @
1d6c2ba6
#include <map>
#include <Parsers/Lexer.h>
#include <Parsers/TokenIterator.h>
#include <Core/Types.h>
#include <IO/ReadBufferFromFileDescriptor.h>
#include <IO/WriteBufferFromFileDescriptor.h>
...
...
src/Parsers/tests/lexer_fuzzer.cpp
浏览文件 @
1d6c2ba6
#include <map>
#include <Parsers/Lexer.h>
#include <Parsers/TokenIterator.h>
#include <Core/Types.h>
#include <IO/ReadBufferFromMemory.h>
...
...
src/Storages/tests/get_abandonable_lock_in_all_partitions.cpp
浏览文件 @
1d6c2ba6
#include <IO/ReadHelpers.h>
#include <IO/WriteHelpers.h>
#include <Common/Config/ConfigProcessor.h>
#include <Common/ZooKeeper/ZooKeeper.h>
#include <Common/Exception.h>
...
...
@@ -7,7 +5,6 @@
#include <Storages/MergeTree/EphemeralLockInZooKeeper.h>
#include <ext/scope_guard.h>
#include <pcg_random.hpp>
#include <iostream>
...
...
src/Storages/tests/get_current_inserts_in_replicated.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -4,10 +4,8 @@
#include <Common/ZooKeeper/ZooKeeper.h>
#include <Common/Exception.h>
#include <Common/Stopwatch.h>
#include <Storages/MergeTree/EphemeralLockInZooKeeper.h>
#include <ext/scope_guard.h>
#include <pcg_random.hpp>
#include <iostream>
...
...
src/Storages/tests/gtest_SplitTokenExtractor.cpp
浏览文件 @
1d6c2ba6
#include <Storages/MergeTree/MergeTreeIndexFullText.h>
#include <Common/PODArray_fwd.h>
#include <Common/PODArray.h>
#include <gtest/gtest.h>
...
...
src/Storages/tests/gtest_storage_log.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -2,7 +2,6 @@
#include <Columns/ColumnsNumber.h>
#include <DataStreams/IBlockOutputStream.h>
#include <DataStreams/LimitBlockInputStream.h>
#include <DataStreams/copyData.h>
#include <DataTypes/DataTypesNumber.h>
#include <Disks/tests/gtest_disk.h>
...
...
src/Storages/tests/merge_selector.cpp
浏览文件 @
1d6c2ba6
...
...
@@ -2,7 +2,6 @@
#include <IO/ReadBufferFromFileDescriptor.h>
#include <IO/ReadHelpers.h>
#include <Storages/MergeTree/SimpleMergeSelector.h>
#include <Storages/MergeTree/LevelMergeSelector.h>
/** This program tests merge-selecting algorithm.
...
...
src/Storages/tests/transform_part_zk_nodes.cpp
浏览文件 @
1d6c2ba6
#include <Storages/MergeTree/ReplicatedMergeTreePartHeader.h>
#include <IO/WriteBufferFromString.h>
#include <IO/WriteHelpers.h>
#include <Common/Exception.h>
#include <Common/StringUtils/StringUtils.h>
#include <Common/ZooKeeper/ZooKeeper.h>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录