-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
While I compile the project, the test case DirectoryTreeTest.CreateDirectoryIfNotExistedTest in aws-cpp-sdk-core-tests fail with assertion errors when building aws-sdk-cpp using MinGW (gcc 11.4.0) on Windows 11. The failures output errors such as assertion failures.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
All test cases should pass and the compilation procedure should complete successfully.
Current Behavior
D:/Pyronix/Code/aws-sdk-cpp/tests/aws-cpp-sdk-core-tests/utils/FileSystemUtilsTest.cpp:288: Failure
Value of: FileSystem::CreateDirectoryIfNotExists(FileSystem::Join(FileSystem::Join(dir2, "dir3"), longDirName).c_str(), true )
Actual: false
Expected: true
[ FAILED ] DirectoryTreeTest.CreateDirectoryIfNotExistedTest (6 ms)
Reproduction Steps
- Build the project with:
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DAWS_SDK_WARNINGS_ARE_ERRORS=off ninja - Run the test suite.
Possible Solution
The root cause is the first if condition i != 0 in for loop of function CreateDirectoryIfNotExists; While parameter createParentDirs set to true, it will create intermediate directories one by one through the delimiter \, but the first directoryName trimmed by \ is C: in Windows System which is not able to create obviously, so the if condition should be changed to i > 2 to skip trimming the single drive letter C:.
The PR #3551 I have been created can fix this.
Additional Information/Context
No response
AWS CPP SDK version used
1.11.643
Compiler and Version used
gcc.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 11.4.0
Operating System and version
Windows 11