Skip to content

Commit

Permalink
opt: rm some windows TODO mark
Browse files Browse the repository at this point in the history
  • Loading branch information
bilosikia committed Feb 25, 2025
1 parent 794911f commit b63ae4e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
6 changes: 3 additions & 3 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ elseif (MSVC)
add_definitions(-DWIN32_LEAN_AND_MEAN)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT /MP /Zi")
# /DEBUG will generate many pdb not found warning.
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd /MP")
add_compile_options("/std:c++17")
# for cross-platform, soure file all are utf8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ static int32_t parseLogType(char* buffer, int32_t idx, int32_t size, DockerLogTy
return idx;
}

// TODO: windows
// windows can't instantiation with char32_t, unsigend maybe not ok.
// windows can't instantiation with char32_t.
#if defined(_MSC_VER)
std::wstring_convert<std::codecvt_utf8<unsigned long>, unsigned long> convert;
#else
Expand Down
2 changes: 0 additions & 2 deletions core/unittest/checkpoint/AdhocCheckpointManagerUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ AdhocFileKey* AdhocCheckpointManagerUnittest::GetAdhocFileKey(const std::string&
long AdhocCheckpointManagerUnittest::GetFileUpdateTime(const std::string& filePath) {
struct stat statbuf;
stat(filePath.c_str(), &statbuf);
// TODO: windows
// it's ok?
#if defined(__linux__)
return statbuf.st_mtim.tv_nsec;
#else
Expand Down
1 change: 0 additions & 1 deletion core/unittest/models/LogEventUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ void LogEventUnittest::TestMeta() {
}

void LogEventUnittest::TestSize() {
// TODO: windows
size_t basicSize = sizeof(time_t) + sizeof(uint64_t) + sizeof(vector<pair<LogContent, bool>>);
// add content, and key not existed
mLogEvent->SetContent(string("key1"), string("a"));
Expand Down
4 changes: 0 additions & 4 deletions core/unittest/models/MetricEventUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ void MetricEventUnittest::TestTag() {
}

void MetricEventUnittest::TestUntypedSingleValueSize() {
// TODO: windows
size_t basicSize
= sizeof(time_t) + sizeof(uint64_t) + sizeof(UntypedSingleValue) + sizeof(map<StringView, StringView>);
mMetricEvent->SetName("test");
Expand All @@ -174,7 +173,6 @@ void MetricEventUnittest::TestUntypedSingleValueSize() {
void MetricEventUnittest::TestUntypedMultiDoubleValuesSize() {
mMetricEvent->SetName("test");
mMetricEvent->SetValue(map<StringView, UntypedMultiDoubleValue>{});
// TODO: windows
size_t basicSize
= sizeof(time_t) + sizeof(uint64_t) + sizeof(UntypedMultiDoubleValues) + sizeof(map<StringView, StringView>);
basicSize += 4;
Expand Down Expand Up @@ -245,7 +243,6 @@ void MetricEventUnittest::TestUntypedSingleValueToJson() {
string errorMsg;
ParseJsonTable(eventStr, eventJson, errorMsg);

// TODO: windows
APSARA_TEST_TRUE(eventJson.toStyledString() == res.toStyledString());
}

Expand Down Expand Up @@ -284,7 +281,6 @@ void MetricEventUnittest::TestUntypedMultiDoubleValuesToJson() {
string errorMsg;
ParseJsonTable(eventStr, eventJson, errorMsg);

// TODO: windows
APSARA_TEST_TRUE(eventJson.toStyledString() == res.toStyledString());
}

Expand Down
2 changes: 2 additions & 0 deletions core/unittest/reader/LogFileReaderUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ void LogFileReaderUnittest::TestReadGBK() {
APSARA_TEST_FALSE_FATAL(moreData);
expectedPart = expectedContent.get();
expectedPart = expectedPart.substr(expectedPart.rfind("iLogtail"));
LOG_ERROR(sLogger, ("xxxxxxxxxxx", expectedPart.size()));
LOG_ERROR(sLogger, ("xxxxxxxxxxx", logBuffer.rawBuffer.size()));
APSARA_TEST_STREQ_FATAL(expectedPart.c_str(), logBuffer.rawBuffer.data());
APSARA_TEST_EQUAL_FATAL(0UL, reader.mCache.size());
}
Expand Down

0 comments on commit b63ae4e

Please sign in to comment.