Fix names of enums and their elements
Use the containing class name as prefix, and add the name of the enum itself to the prefix for the scoped enums, instead of doing something strange and semi-random that we did before, with prefixes including the namespace (which should never be the case without "nspace" feature), but not the scoped enum. This also fixes renaming of enum elements, as a side effect, which didn't work before, add run test for enum_rename unit test to prove it.
This commit is contained in:
parent
81d1fec13c
commit
f4ee8e5369
3 changed files with 55 additions and 9 deletions
12
Examples/test-suite/c/enum_rename_runme.c
Normal file
12
Examples/test-suite/c/enum_rename_runme.c
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include "enum_rename/enum_rename_wrap.h"
|
||||
|
||||
int main() {
|
||||
assert(M_Jan == 0);
|
||||
assert(May == 1);
|
||||
assert(M_Dec == 2);
|
||||
|
||||
assert(S_Can == 1);
|
||||
assert(S_Must == 2);
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
int main() {
|
||||
assert(GlobalInstance == globalinstance1);
|
||||
assert(Char == 'a');
|
||||
assert(iFoo_Char == 'a');
|
||||
bar2(1);
|
||||
bar3(1);
|
||||
bar1(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue