-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add C++ test for deprecated Slice metadata #3038
Conversation
@@ -71,21 +71,21 @@ namespace | |||
} | |||
} | |||
|
|||
string getDeprecatedSymbol(const ContainedPtr& p1) | |||
string getDeprecatedAttribute(const ContainedPtr& p1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to match the C++ terminology.
} | ||
else | ||
{ | ||
deprecatedSymbol = "[[deprecated]] "; | ||
deprecatedAttribute = "[[deprecated]] "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually never reach this line. See #3039.
@@ -1338,21 +1338,24 @@ Slice::Gen::ForwardDeclVisitor::visitSequence(const SequencePtr& p) | |||
string seqType = findMetadata(metadata, _useWstring); | |||
writeDocSummary(H, p); | |||
|
|||
string deprecatedAttribute = getDeprecatedAttribute(p); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sequences and dictionaries didn't get [[deprecated]]
prior to this PR.
<< sp; | ||
} | ||
|
||
bool | ||
Slice::Gen::ForwardDeclVisitor::visitStructStart(const StructPtr& p) | ||
{ | ||
H << nl << "struct " << fixKwd(p->name()) << ';' << sp; | ||
H << nl << "struct " << getDeprecatedAttribute(p) << fixKwd(p->name()) << ';' << sp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for consistency. Doesn't matter since the C++ struct definition is always in the same file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
This PR adds a new C++ test (Slice/deprecated) and fixes a few bugs uncovered by this test.