Skip to content

Guard COM teardown and de-duplicate native test helpers#15

Merged
Yuri05 merged 1 commit into
add_C++-tests_from_old_C++_CLI-testsfrom
copilot/verify-fix-valid-issues
Jun 30, 2026
Merged

Guard COM teardown and de-duplicate native test helpers#15
Yuri05 merged 1 commit into
add_C++-tests_from_old_C++_CLI-testsfrom
copilot/verify-fix-valid-issues

Conversation

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown

Verifies three review findings in the SimModelNative Google Test suite and applies minimal, test-only fixes. All three were still valid.

COM apartment teardown (TestEnvironment.cpp)

  • ComEnvironment called CoUninitialize() unconditionally, tearing down the apartment even when CoInitialize failed (e.g. RPC_E_CHANGED_MODE).
  • SetUp() now records success; TearDown() only uninitializes when initialization actually succeeded.
void SetUp() override { _comInitialized = SUCCEEDED(CoInitialize(NULL)); }
void TearDown() override
{
   if (_comInitialized) { CoUninitialize(); _comInitialized = false; }
}

Duplicated test data (RcmSpecs.cpp)

  • should_return_valid_permutation_for_ten_node_example rebuilt the 10×10 adjacency matrix inline; it now reuses the existing createTenNodeMatrix() helper.

Duplicated extender class (TableFormula*Specs.cpp)

  • The identical ValuePoints() / CallCacheValues() wrapper was redefined in three spec files (TableFormulaExtender, TableFormulaForOffsetExtender, TableFormulaForXArgumentExtender).
  • Extracted into a shared src/TableFormulaTestExtender.h (TableFormulaTestExtender), now included by all three specs and registered in the .vcxproj. The CMake build resolves it via relative include.

Notes

  • A full build was not run: git submodules and native NuGet packages are unavailable in this environment.

@Yuri05
Yuri05 changed the base branch from add_C++-tests_from_old_C++_CLI-tests to master June 30, 2026 19:38
@Yuri05
Yuri05 marked this pull request as ready for review June 30, 2026 19:38
@Yuri05 Yuri05 closed this Jun 30, 2026
@Yuri05 Yuri05 reopened this Jun 30, 2026
@Yuri05
Yuri05 changed the base branch from master to add_C++-tests_from_old_C++_CLI-tests June 30, 2026 20:02
@Yuri05
Yuri05 merged commit b92af10 into add_C++-tests_from_old_C++_CLI-tests Jun 30, 2026
3 checks passed
@Yuri05
Yuri05 deleted the copilot/verify-fix-valid-issues branch June 30, 2026 20:03
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.

2 participants