-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for root-project/root#13574
- Loading branch information
Showing
12 changed files
with
236 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#ifndef ns_privacy_hh | ||
#define ns_privacy_hh | ||
#include <iostream> | ||
#include <filesystem> | ||
#include <tuple> | ||
|
||
namespace fs = std::filesystem; | ||
|
||
namespace privacy | ||
{ | ||
|
||
class test | ||
{ | ||
public: | ||
test() = default; | ||
~test() = default;; | ||
|
||
private: | ||
fs::path path; ///<! | ||
fs::path persistent_path; | ||
}; | ||
|
||
class test1 { | ||
private: | ||
struct Inner { struct Most {}; }; | ||
std::unique_ptr<Inner> unique_data; | ||
Inner *ptr_data; | ||
}; | ||
|
||
class test2 { | ||
private: | ||
test1 transient_data; ///<! | ||
test1 persistent_data; | ||
}; | ||
|
||
class test3 { | ||
private: | ||
struct Inner {}; | ||
std::tuple<int, Inner> persistent_data; | ||
std::tuple<int, int, Inner> transient_data; ///<! | ||
}; | ||
|
||
class test4 { | ||
private: | ||
test3 transient_data; ///<! | ||
}; | ||
|
||
} // namespace privacy | ||
|
||
#endif // ns_privacy_hh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef privacy_hh | ||
#define privacy_hh | ||
#include <iostream> | ||
#include <filesystem> | ||
#include <tuple> | ||
|
||
namespace fs = std::filesystem; | ||
|
||
class test | ||
{ | ||
public: | ||
test() = default; | ||
~test() = default;; | ||
|
||
private: | ||
fs::path path; ///<! | ||
fs::path persistent_path; | ||
}; | ||
|
||
class test1 { | ||
private: | ||
struct Inner { struct Most {}; }; | ||
std::unique_ptr<Inner> unique_data; | ||
Inner *ptr_data; | ||
}; | ||
|
||
class test2 { | ||
private: | ||
test1 transient_data; ///<! | ||
test1 persistent_data; | ||
}; | ||
|
||
class test3 { | ||
private: | ||
struct Inner {}; | ||
std::tuple<int, Inner> persistent_data; | ||
std::tuple<int, int, Inner> transient_data; ///<! | ||
}; | ||
|
||
class test4 { | ||
private: | ||
test3 transient_data; ///<! | ||
}; | ||
|
||
#endif |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "ns_privacy.hh" | ||
|
||
int privacyInterp() { | ||
|
||
const char *names[] = { | ||
"privacy::test", | ||
"privacy::test1", | ||
"privacy::test2", | ||
"privacy::test3", | ||
"privacy::test4" | ||
}; | ||
|
||
for(auto name : names) { | ||
auto cl = TClass::GetClass(name); | ||
if (!cl) { | ||
std::cout << "Could not find class " << name << "\n"; | ||
return 1; | ||
} | ||
cl->GetStreamerInfo()->ls(); | ||
} | ||
|
||
return 0; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Warning in <TStreamerInfo::Build>: privacy::test: filesystem::path has no streamer or dictionary, data member "persistent_path" will not be saved | ||
Error in <Load>: Could not declare alternate type for tuple<privacy::test1::Inner*,default_delete<privacy::test1::Inner> > since privacy::test1::Inner* (or one of its context) is private or protected | ||
Warning in <TClass::Init>: no dictionary for class tuple<privacy::test1::Inner*,default_delete<privacy::test1::Inner> > is available | ||
Error in <TStreamerInfo::Build>: privacy::test1: privacy::test1::Inner has no streamer or dictionary, data member unique_data will not be saved | ||
Error in <TStreamerInfo::Build>: privacy::test1: privacy::test1::Inner* has no streamer or dictionary, data member ptr_data will not be saved | ||
Warning in <TStreamerInfo::Build>: privacy::test2: privacy::test1 has no streamer or dictionary, data member "persistent_data" will not be saved | ||
Error in <Load>: Could not declare alternate type for tuple<int,privacy::test3::Inner> since privacy::test3::Inner (or one of its context) is private or protected | ||
Warning in <TClass::Init>: no dictionary for class tuple<int,privacy::test3::Inner> is available | ||
Warning in <TStreamerInfo::Build>: privacy::test3: tuple<int,privacy::test3::Inner> has no streamer or dictionary, data member "persistent_data" will not be saved |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
Processing /home/pcanal/root_working/code/root/roottest/root/io/uniquePointer/privacyInterp.C... | ||
|
||
StreamerInfo for class: privacy::test, checksum=0xe856e707 | ||
filesystem::path persistent_path offset= 40 type=62 | ||
i= 0, persistent_path type= 62, offset= 40, len=1, method=0 | ||
|
||
StreamerInfo for class: privacy::test1, checksum=0x1ff89af2 | ||
privacy::test1::Inner* unique_data offset= 0 type=69 | ||
privacy::test1::Inner* ptr_data offset= 8 type=69 | ||
i= 0, unique_data type= 69, offset= 0, len=1, method=0 | ||
i= 1, ptr_data type= 69, offset= 8, len=1, method=0 | ||
|
||
StreamerInfo for class: privacy::test2, checksum=0x99ae9c61 | ||
privacy::test1 persistent_data offset= 16 type=62 | ||
i= 0, persistent_data type= 62, offset= 16, len=1, method=0 | ||
|
||
StreamerInfo for class: privacy::test3, checksum=0x929c0633 | ||
tuple<int,privacy::test3::Inner> persistent_data offset= 0 type=62 | ||
i= 0, persistent_data type= 62, offset= 0, len=1, method=0 | ||
|
||
StreamerInfo for class: privacy::test4, checksum=0xff367a2 | ||
(int) 0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma link C++ class test+; | ||
|
||
// We can generate the dictionary for this class even-though it has | ||
// data members whose types is private. There will be a clear error | ||
// message if the user request the StreamerInfo for this class. | ||
#pragma link C++ class test1+; | ||
|
||
// Dictionary of private classes is not supported, uncommented this leads | ||
// to the expected warning message explaining this. | ||
// #pragma link C++ class test1::Inner+; | ||
|
||
#pragma link C++ class test2+; | ||
#pragma link C++ class test3+; | ||
#pragma link C++ class test4+; | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
int privacyLoad() { | ||
gSystem->Load("privacy"); | ||
|
||
const char *names[] = { | ||
"test", | ||
"test1", | ||
"test2", | ||
"test3", | ||
"test4" | ||
}; | ||
|
||
for(auto name : names) { | ||
auto cl = TClass::GetClass(name); | ||
if (!cl) { | ||
std::cout << "Could not find class " << name << "\n"; | ||
return 1; | ||
} | ||
cl->GetStreamerInfo()->ls(); | ||
} | ||
|
||
return 0; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Warning in <TStreamerInfo::Build>: test: filesystem::path has no streamer or dictionary, data member "persistent_path" will not be saved | ||
Error in <TStreamerInfo::Build>: test1: test1::Inner has no streamer or dictionary, data member unique_data will not be saved | ||
Error in <TStreamerInfo::Build>: test1: test1::Inner* has no streamer or dictionary, data member ptr_data will not be saved | ||
Error in <Load>: Could not declare alternate type for tuple<int,test3::Inner> since test3::Inner (or one of its context) is private or protected | ||
Warning in <TClass::Init>: no dictionary for class tuple<int,test3::Inner> is available | ||
Warning in <TStreamerInfo::Build>: test3: tuple<int,test3::Inner> has no streamer or dictionary, data member "persistent_data" will not be saved |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
Processing /home/pcanal/root_working/code/root/roottest/root/io/uniquePointer/privacyLoad.C... | ||
|
||
StreamerInfo for class: test, checksum=0x621ea8bb | ||
filesystem::path persistent_path offset= 40 type=62 | ||
i= 0, persistent_path type= 62, offset= 40, len=1, method=0 | ||
|
||
StreamerInfo for class: test1, checksum=0xde5f26fc | ||
test1::Inner* unique_data offset= 0 type=69 | ||
test1::Inner* ptr_data offset= 8 type=69 | ||
i= 0, unique_data type= 69, offset= 0, len=1, method=0 | ||
i= 1, ptr_data type= 69, offset= 8, len=1, method=0 | ||
|
||
StreamerInfo for class: test2, checksum=0xb61be35d | ||
test1 persistent_data offset= 16 type=62 | ||
i= 0, persistent_data type= 62, offset= 16, len=1, method=0 | ||
|
||
StreamerInfo for class: test3, checksum=0xdcf7ad57 | ||
tuple<int,test3::Inner> persistent_data offset= 0 type=62 | ||
i= 0, persistent_data type= 62, offset= 0, len=1, method=0 | ||
|
||
StreamerInfo for class: test4, checksum=0x34f6 | ||
(int) 0 |