mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
refactor, test: Always initialize pointer
This change fixes MSVC warning C4703. See: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4703 All `DisableSpecificWarnings` dropped from `test_bitcoin.vcxproj` as all remained are inherited from `common.init.vcxproj`.
This commit is contained in:
parent
81174d8a9b
commit
bd2de7ac59
2 changed files with 4 additions and 8 deletions
|
@ -59,11 +59,6 @@
|
||||||
<Project>{18430fef-6b61-4c53-b396-718e02850f1b}</Project>
|
<Project>{18430fef-6b61-4c53-b396-718e02850f1b}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemDefinitionGroup>
|
|
||||||
<ClCompile>
|
|
||||||
<DisableSpecificWarnings>4018;4244;4267;4703;4715;4805</DisableSpecificWarnings>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<Target Name="RawBenchHeaderGen" BeforeTargets="PrepareForBuild">
|
<Target Name="RawBenchHeaderGen" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>There was an error executing the JSON test header generation task.</ErrorText>
|
<ErrorText>There was an error executing the JSON test header generation task.</ErrorText>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <test/util/random.h>
|
#include <test/util/random.h>
|
||||||
#include <test/util/setup_common.h>
|
#include <test/util/setup_common.h>
|
||||||
#include <uint256.h>
|
#include <uint256.h>
|
||||||
|
#include <util/check.h>
|
||||||
#include <validation.h>
|
#include <validation.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -102,14 +103,14 @@ BOOST_FIXTURE_TEST_CASE(chainstate_update_tip, TestChain100Setup)
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(chainman.GetAll().size(), 2);
|
BOOST_CHECK_EQUAL(chainman.GetAll().size(), 2);
|
||||||
|
|
||||||
Chainstate& background_cs{*[&] {
|
Chainstate& background_cs{*Assert([&]() -> Chainstate* {
|
||||||
for (Chainstate* cs : chainman.GetAll()) {
|
for (Chainstate* cs : chainman.GetAll()) {
|
||||||
if (cs != &chainman.ActiveChainstate()) {
|
if (cs != &chainman.ActiveChainstate()) {
|
||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(false);
|
return nullptr;
|
||||||
}()};
|
}())};
|
||||||
|
|
||||||
// Append the first block to the background chain.
|
// Append the first block to the background chain.
|
||||||
BlockValidationState state;
|
BlockValidationState state;
|
||||||
|
|
Loading…
Add table
Reference in a new issue