class TestCase::Enum {
use TestCase::Enum::Data1;
enum {
INT_ZERO,
INT_ONE,
INT_THREE = 3,
INT_FOUR,
INT_SIX = 6,
INT_MINUS_MAX = -2147483648
}
private enum {
PRIVATE_VALUE = 12
}
static method enum_attribute : int () {
unless (TestCase::Enum->PRIVATE_VALUE() == 12) {
return 0;
}
return 1;
}
static method enum_int : int () {
# Enum value
{
unless (TestCase::Enum->INT_ZERO == 0) {
return 0;
}
unless (TestCase::Enum->INT_ONE == 1) {
return 0;
}
unless (TestCase::Enum->INT_THREE == 3) {
return 0;
}
unless (TestCase::Enum->INT_FOUR == 4) {
return 0;
}
unless (TestCase::Enum->INT_SIX == 6) {
return 0;
}
unless (TestCase::Enum->INT_MINUS_MAX == -2147483648) {
return 0;
}
}
# Outer enum test
{
unless (TestCase::Enum::Data1->ONE == 0) {
return 0;
}
unless (TestCase::Enum::Data1->TWO == 1) {
return 0;
}
}
# Function call
{
unless (TestCase::Enum->INT_ONE() == 1) {
return 0;
}
}
return 1;
}
}