File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 55#include " adm/write.hpp"
66#include " helper/file_comparator.hpp"
77#include " adm/elements/tag_list.hpp"
8+ #include " adm/utilities/object_creation.hpp"
89
910#include < iostream>
1011
@@ -28,7 +29,6 @@ TEST_CASE("TagGroup parameters") {
2829
2930TEST_CASE (" TagList parameters" ) {
3031 TTag tag{TTagClass (" class" ), TTagValue (" value" )};
31-
3232 TagGroup tagGroup;
3333 tagGroup.add (tag);
3434 TagList tagList;
@@ -52,3 +52,22 @@ TEST_CASE("adm xml/taglist") {
5252 writeXml (xml, doc);
5353 CHECK_THAT (xml.str (), EqualsXmlFile (" tag_list" ));
5454}
55+
56+ TEST_CASE (" document copy updates tagList references" ) {
57+ auto doc = Document::create ();
58+ auto holder = addSimpleObjectTo (doc, " Test" );
59+ TTag tag{TTagClass (" class" ), TTagValue (" value" )};
60+ TagGroup tagGroup;
61+ tagGroup.add (tag);
62+ tagGroup.addReference (holder.audioObject );
63+ auto tagList = std::make_shared<TagList>();
64+ tagList->add (tagGroup);
65+ doc->add (tagList);
66+
67+ auto doc_copy = doc->deepCopy ();
68+ auto copied_object = doc_copy->getElements <AudioObject>().front ();
69+ auto copied_tag_group = doc->getElement <TagList>()->get <TagGroups>().front ();
70+ auto tagged_object_ref =
71+ copied_tag_group.getReferences <AudioObject>().front ();
72+ REQUIRE (copied_object == tagged_object_ref);
73+ }
You can’t perform that action at this time.
0 commit comments