drogonframework / drogonframework/drogon
unittest HttpFile failed in windows
- Dominant language
- C++
- Stars
- 14.3k
- Forks
- 1.4k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
**Describe the bug**
**To Reproduce**
Steps to reproduce the behavior:
1. Open Developer PowerShell for Visual Studio.
2. Go to build directory.
3. conan install .. -s compiler="Visual Studio" -s compiler.version=16 -s build_type=Debug --settings arch=x86_64 -g cmake_paths
4. cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DBUILD_DROGON_SHARED=OFF -DBUILD_CTL=ON -DBUILD_EXAMPLES=ON -DCMAKE_TOOLCHAIN_FILE="conan_paths.cmake"
5. cmake --build . --target RUN_TESTS
**Screenshots**
```
filesystem::path fsSaveToPath(filesystem::weakly_canonical(
fsUploadDir / utils::toNativePath(fileName_)));
LOG_INFO << "fsSaveToPath:" << fsSaveToPath;
LOG_INFO << "fsUploadDir:" << fsUploadDir;
if (!std::equal(fsUploadDir.begin(),
fsUploadDir.end(),
fsSaveToPath.begin()))
{
LOG_ERROR
<< "Attempt writing outside of upload directory detected. Path: "
<< fileName_;
return -1;
}
```
```
20220304 17:19:10.995000 UTC 6692 INFO fsSaveToPath:D:\drogon\build\lib\tests\test_uploads_dir\test_file_name - D:\drogon\lib\src\HttpFileImpl.cc:62
20220304 17:19:10.995000 UTC 6692 INFO fsUploadDir:test_uploads_dir - D:\drogon\lib\src\HttpFileImpl.cc:63
```
Contributor guide
Assessment
This issue has not been assessed yet.