root-mirror/root — pull request #2 by CristinaCristescu (2013-07-16 08:19:44+00:00)
Title: Develop and test enum

So here are the changes that I needed to make from the comments of the last pull request and some other changes:
1) I've added the name for a enum constant because I realised when declaring kMyConstant = 42 that I didn't save the name.
2) I've added some checks in the TCling to see if the TEnum and TEnumConstants are actually created, because when I run the test:
// MyEnumComment
enum EMyEnum {
kMyEnumConstant = 42 // enumConstantComment
};

int assertTEnum()
{

if (!(TEnum*)gROOT->GetListOfEnums()->FindObject("EMyEnum")) {
Error ("TEnum", "Constructor of TEnum failure.");
return -1;
}
It does return and Error. I tried that on the root[0] promp as well and the address of GetListOfEnum is not NULL(because the HashTable is created), but the address of FindObject is 0x0.
Now I don't get the Errors of TEnum and TEnumConstant are not created..I wanted to check whether they are added to the fEnums and fGlobals, but Add() for TCollection is a void function. My best guess is that they are not added to the lists, maybe you can see why...