class TestCase::Operator::ConditionEvaluation {
use TestCase::Minimal;
use Point;
static method basic : int () {
# True
{
{
unless ((int)(byte)1) {
return 0;
}
}
{
unless ((int)(short)1) {
return 0;
}
}
{
unless (1) {
return 0;
}
}
{
unless (1L) {
return 0;
}
}
{
unless (1.0f) {
return 0;
}
}
{
unless (1.0) {
return 0;
}
}
{
unless (TestCase::Minimal->new) {
return 0;
}
}
{
my $value = 1;
my $vaelu_ref = \$value;
unless ($vaelu_ref) {
return 0;
}
}
{
if (0.0) {
return 0;
}
}
{
if (-0.0) {
return 0;
}
}
{
my $nan = (float)0.0 / (float)0.0;
# NaN is true becuase only 0.0 and -0.0 are false.
unless ($nan) {
return 0;
}
}
{
my $nan = (double)0.0 / (double)0.0;
# NaN is true becuase only 0.0 and -0.0 are false.
unless ($nan) {
return 0;
}
}
}
# False
{
{
if ((int)(byte)0) {
return 0;
}
}
{
if ((int)(short)0) {
return 0;
}
}
{
if (0) {
return 0;
}
}
{
if (0L) {
return 0;
}
}
{
if (0.0f) {
return 0;
}
}
{
if (0.0) {
return 0;
}
}
{
if (-0.0) {
return 0;
}
}
{
my $object : Point;
if ($object) {
return 0;
}
}
}
return 1;
}
static method else : int () {
if (0) {
return 0;
}
else {
return 1;
}
return 0;
}
static method elsif : int () {
if (0) {
return 0;
}
elsif(1) {
return 1;
}
else {
return 0;
}
return 0;
}
static method elsif2 : int () {
if (0) {
return 0;
}
elsif(0) {
return 0;
}
elsif(1) {
return 1;
}
else {
return 0;
}
return 0;
}
static method duplicate : int () {
if (1) {
if (0) {
return 0;
}
elsif (1) {
return 1;
}
else {
return 0;
}
}
else {
return 0;
}
}
}