Repository navigation
Deduplicate the shared_ptr and unique_ptr tests - #241
Merged
Merged
Conversation
utest.cpp and unique_ptr_test.cpp were copies of each other differing only in createInstance() vs createUniqueInstance(). Make the managed instance tests typed tests that run with both, and drop unique_ptr_test.cpp. The unmanaged instance tests move to their own executable: createUnmanagedInstance() disables on-demand unloading for the whole process, and utest.cpp's lazy-unload tests only passed because gtest happened to run them first. Fixes #94 Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
mjcarroll
marked this pull request as ready for review
November 5, 2026 19:26
mjcarroll
force-pushed
the
mjcarroll/dedupe-tests
branch
from
November 5, 2026 19:26
d1aa36d to
e47b7c4
Compare
christophebedard
approved these changes
Nov 5, 2026
Member
Author
|
Pulls: #241 |
uncrustify 0.78.1 (uncrustify_vendor, Ubuntu) and 0.80.1 (EPEL, RHEL) disagree on the spacing of '?' after 'is_same_v<...>', so no spelling of the ternary passes both. Use if constexpr instead. Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
Member
Author
|
Pulls: #241 |
clalancette
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #94.
utest.cppandunique_ptr_test.cppwere near copies, differing only increateInstance()vscreateUniqueInstance().ClassLoaderTest/SharedPtr.basicLoadandClassLoaderTest/UniquePtr.basicLoad. Tests that don't depend on the pointer type are inClassLoaderBasicTest.unique_ptr_test.cppis removed.unmanaged_test.cpp).createUnmanagedInstance()disables on-demand unloading for the whole process, and the lazy-unload tests inutest.cpponly passed because gtest happened to run them first.try/catch+FAIL()wrappers are dropped, since gtest already reports uncaught exceptions as failures.All existing assertions are kept. The test count goes from 36 to 35: one exact duplicate is removed (
basicLoadFailureswas in both files), and theMultiLibraryClassLoadermissing-class test now runs for both pointer types instead of twice forunique_ptr.Draft for now: #239 and #240 add tests to these files, so this will be rebased after they land.