Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tests #151

Merged
merged 7 commits into from
Mar 18, 2022
Merged

Improve tests #151

merged 7 commits into from
Mar 18, 2022

Conversation

Flamefire
Copy link
Collaborator

@Flamefire Flamefire commented Mar 16, 2022

  • Add reproducer for fstream reuse on Windows causes a null pointer access violation #150 (reopening an ofstream after close())
  • Skip flaky iostream integration test
  • Avoid compiling and running test_traits 2 times by merging the boost and std filesystem parts into the same binary
  • Enable c++14/17 explicitly on Appveyor cmake-tests to make sure e.g. the traits test are run with those testing the std::filesystem parts
  • Refactoring (use nullptr, remove unused private member function)
  • Fix return value of filebuf::sync() when fflush fails

Closes #150

Combine the with and without Boost.Filesystem cases into 1 test
@codecov
Copy link

codecov bot commented Mar 17, 2022

Codecov Report

Merging #151 (b0f2767) into develop (1e6badc) will increase coverage by 0.00%.
The diff coverage is 97.33%.

@@           Coverage Diff            @@
##           develop     #151   +/-   ##
========================================
  Coverage    99.33%   99.34%           
========================================
  Files           33       33           
  Lines         3021     3051   +30     
========================================
+ Hits          3001     3031   +30     
  Misses          20       20           
Impacted Files Coverage Δ
test/test_traits.cpp 100.00% <ø> (ø)
include/boost/nowide/filebuf.hpp 94.16% <90.47%> (+0.02%) ⬆️
include/boost/nowide/args.hpp 95.83% <100.00%> (ø)
include/boost/nowide/stackstring.hpp 100.00% <100.00%> (ø)
include/boost/nowide/utf/convert.hpp 100.00% <100.00%> (ø)
test/test_fstream_special.cpp 100.00% <100.00%> (ø)
test/test_iostream.cpp 100.00% <100.00%> (ø)
test/test_ofstream.cpp 100.00% <100.00%> (ø)
test/test_stackstring.cpp 100.00% <100.00%> (ø)
test/test_stdio.cpp 100.00% <100.00%> (ø)
... and 2 more

Some modes seem to be incompatible with certain CI environments, e.g. newer Appveyor images making test fail sometimes.
Set a known "good" mode to avoid this.
This enables e.g. the std::filesystem::path traits test
Creating console input events fails sporadically on recent Appveyor images when using CMake/CTest.
Add an option to disable that and use it for the recent Appveyor image
It incorrectly returned 0 instead of -1
@Flamefire Flamefire merged commit 1f6e960 into boostorg:develop Mar 18, 2022
@Flamefire Flamefire deleted the tests branch March 18, 2022 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fstream reuse on Windows causes a null pointer access violation
1 participant