Repository navigation
Test tracking across shared libraries - #388
Merged
Merged
Conversation
Whether a type is tracked is settled per module, so an archive can get the same type from serializers which disagree about it. Up to Boost 1.83, the tracking level stored for the type came from the serializer which saved its first object, while each object id followed the serializer at hand, so the archive could contradict itself (#183). "Use the first instance of bos during serialization (for the case when there are multiple instances)" fixed that and broke the opposite order (#329), which "Record the first-registered serializer's tracking flag on save" fixed in turn. Neither change came with a test. I've added one, which covers both orders and fails if either change is reverted. Closes #183.
A type tracked selectively is tracked by a program which serializes it through a pointer, and not by one which doesn't, so the program reading an archive may disagree with the one which wrote it. Loading takes the tracking level stored in the archive, which settles that, but nothing tested it. I've added a test which writes an archive in one program and reads it in another, which serializes the type through a pointer. Refs #183.
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.
This adds two tests, one per commit.
test_dll_trackingcovers an archive that gets the same type from the serializers of two modules which disagree about tracking it, in both orders: the one of Boost serialization (bug?) issue with MSVC, with vector<shared_ptr> in several libraries #183 (broken up to Boost 1.83) and the opposite one of Serialization of a Derived Class from a Base Class Pointer is Incorrect in Boost 1.85 #329 (broken from 1.84 to 1.92). It fails if either fix tobasic_oarchive.cppis reverted.test_stored_tracking_save/test_stored_tracking_loadwrite an archive in one program and read it in another which, unlike the first, serializes the type through a pointer. Loading must follow the tracking level stored in the archive. This is the scenario Robert raised on Boost serialization (bug?) issue with MSVC, with vector<shared_ptr> in several libraries #183.Closes #183.