Page MenuHomePhabricator

Fix walletdb_tests on windows
ClosedPublic

Authored by deadalnix on Dec 11 2017, 19:12.

Details

Summary

Windows is a bit more restrictive when it comes to files not properly closed and alike. This caused an error in the cleanup after running hte test (the DB files were kept open and couldn't be deleted).

This ensure that the DB is closed properly after use. The use of MockDB ensure that files shared accross DB instance such as db.log do get mamaged in memory instead of on disk.

Test Plan

Cross compile windows binaries, then

wine src/test/test_bitcoin.exe -t walletdb_tests

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

schancel added inline comments.
src/wallet/test/walletdb_tests.cpp
12 ↗(On Diff #2046)

Other tests are putting these kinds of things in the anonymous namespace. Should we do that here?

28 ↗(On Diff #2046)

Nit: Missing space at end of string. Will produce for testfdsfhads

This revision is now accepted and ready to land.Dec 11 2017, 19:42
src/wallet/test/walletdb_tests.cpp
12 ↗(On Diff #2046)

We should.

Add anonymous namespace and a space

This revision was automatically updated to reflect the committed changes.