Skip to content

Commit

Permalink
Initialize bool type member variables (#329)
Browse files Browse the repository at this point in the history
* Fix prefast 26495 warning

* Fix indentation for m_requiresAny

* Add unit test for default values

* Fix indentation for assert method
  • Loading branch information
jlee671 authored Jan 10, 2025
1 parent 82d379d commit 0bacee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vswhere.lib/CommandArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ class CommandArgs
CommandArgs() noexcept :
m_all(false),
m_productsAll(false),
m_requiresAny(false),
m_latest(false),
m_legacy(false),
m_sort(false),
m_prerelease(false),
m_includePackages(false),
m_nocolor(false),
Expand Down
2 changes: 2 additions & 0 deletions test/vswhere.test/CommandArgsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ TEST_CLASS(CommandArgsTests)
Assert::IsFalse(args.get_UTF8());
Assert::IsTrue(args.get_Logo());
Assert::IsTrue(args.get_Color());
Assert::IsFalse(args.get_Sort());
Assert::IsFalse(args.get_RequiresAny());

auto& products = args.get_Products();
Assert::AreEqual<size_t>(3, products.size());
Expand Down

0 comments on commit 0bacee5

Please sign in to comment.