Skip to content

Commit d2f5ae2

Browse files
authored
Issue #178 Fix src/library/diff tests (#262)
1 parent 446ec01 commit d2f5ae2

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

src/library/diff/diff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct TCollectionImpl {
1212
inline bool Consume(const T* b, const T* e, const T*) {
1313
if (b < e) {
1414
Words.push_back(std::span<const T>(b, e));
15-
Keys.push_back(FnvHash<ui64>((const char*)b, (e - b) * sizeof(T)));
15+
Keys.push_back(FnvHash<ui64>(static_cast<const void*>(b), (e - b) * sizeof(T)));
1616
}
1717
return true;
1818
}

src/library/diff/diff.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#pragma once
22

3+
#include <ydb-cpp-sdk/util/generic/algorithm.h>
4+
#include <ydb-cpp-sdk/util/stream/output.h>
5+
36
#include <src/library/lcs/lcs_via_lis.h>
47

5-
#include <ydb-cpp-sdk/util/generic/algorithm.h>
8+
#include <src/util/string/split.h>
69

710
#include <string_view>
811
#include <span>
912

10-
#include <ydb-cpp-sdk/util/stream/output.h>
11-
#include <src/util/string/split.h>
12-
1313
namespace NDiff {
1414
template <typename T>
1515
struct TChunk {

src/library/diff/ut/ya.make

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/library/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ add_subdirectory(cgiparam)
44
add_subdirectory(charset)
55
add_subdirectory(containers)
66
add_subdirectory(coroutine)
7+
add_subdirectory(dbg_output)
8+
add_subdirectory(diff)
9+
add_subdirectory(digest)
710
add_subdirectory(json)
811
add_subdirectory(login)
912
add_subdirectory(operation_id)
1013
add_subdirectory(testing)
1114
add_subdirectory(yql)
12-
add_subdirectory(digest)
13-
add_subdirectory(dbg_output)

tests/library/diff/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
add_ydb_test(NAME library-diff-ut
2+
SOURCES
3+
ut.cpp
4+
INCLUDE_DIRS
5+
${YDB_SDK_SOURCE_DIR}/src/library/diff
6+
LINK_LIBRARIES
7+
library-diff
8+
cpp-testing-unittest_main
9+
)

src/library/diff/diff_ut.cpp renamed to tests/library/diff/ut.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using namespace NDiff;
66

77
struct TDiffTester {
8-
std::stringStream Res;
8+
TStringStream Res;
99
std::vector<TChunk<char>> Chunks;
1010

1111
std::string_view Special(const std::string_view& str) const {

0 commit comments

Comments
 (0)