ENH: add a test for EQUAL in if

This commit is contained in:
Bill Hoffman 2004-04-28 10:09:50 -04:00
parent 996ac24181
commit 14ba8b5df9
6 changed files with 78 additions and 0 deletions

View File

@ -425,6 +425,18 @@ int main()
cmPassed("SHOULD_NOT_BE_DEFINED_GREATER is not defined.");
#endif
#ifdef SHOULD_NOT_BE_DEFINED_EQUAL
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EQUAL is defined.");
#else
cmPassed("SHOULD_NOT_BE_DEFINED_EQUAL is not defined.");
#endif
#ifndef SHOULD_BE_DEFINED_EQUAL
cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EQUAL is not defined.\n");
#else
cmPassed("SHOULD_BE_DEFINED_EQUAL is defined.");
#endif
#ifndef SHOULD_BE_DEFINED_GREATER
cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER is not defined.\n");
#else

View File

@ -97,6 +97,8 @@ ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
SET (SNUM1_VAR "1")
SET (SNUM2_VAR "2")
SET (SNUM3_VAR "1")
IF (SNUM1_VAR LESS SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS)
@ -116,6 +118,18 @@ ELSE (SNUM2_VAR GREATER SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER)
ENDIF (SNUM2_VAR GREATER SNUM1_VAR)
IF (SNUM2_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
ELSE (SNUM2_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
ENDIF (SNUM2_VAR EQUAL SNUM1_VAR)
IF (SNUM3_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
ELSE (SNUM3_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
ENDIF (SNUM3_VAR EQUAL SNUM1_VAR)
IF (SNUM1_VAR GREATER SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2)
ELSE (SNUM1_VAR GREATER SNUM2_VAR)

View File

@ -425,6 +425,18 @@ int main()
cmPassed("SHOULD_NOT_BE_DEFINED_GREATER is not defined.");
#endif
#ifdef SHOULD_NOT_BE_DEFINED_EQUAL
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EQUAL is defined.");
#else
cmPassed("SHOULD_NOT_BE_DEFINED_EQUAL is not defined.");
#endif
#ifndef SHOULD_BE_DEFINED_EQUAL
cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EQUAL is not defined.\n");
#else
cmPassed("SHOULD_BE_DEFINED_EQUAL is defined.");
#endif
#ifndef SHOULD_BE_DEFINED_GREATER
cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER is not defined.\n");
#else

View File

@ -97,6 +97,8 @@ ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
SET (SNUM1_VAR "1")
SET (SNUM2_VAR "2")
SET (SNUM3_VAR "1")
IF (SNUM1_VAR LESS SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS)
@ -116,6 +118,18 @@ ELSE (SNUM2_VAR GREATER SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER)
ENDIF (SNUM2_VAR GREATER SNUM1_VAR)
IF (SNUM2_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
ELSE (SNUM2_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
ENDIF (SNUM2_VAR EQUAL SNUM1_VAR)
IF (SNUM3_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
ELSE (SNUM3_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
ENDIF (SNUM3_VAR EQUAL SNUM1_VAR)
IF (SNUM1_VAR GREATER SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2)
ELSE (SNUM1_VAR GREATER SNUM2_VAR)

View File

@ -425,6 +425,18 @@ int main()
cmPassed("SHOULD_NOT_BE_DEFINED_GREATER is not defined.");
#endif
#ifdef SHOULD_NOT_BE_DEFINED_EQUAL
cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EQUAL is defined.");
#else
cmPassed("SHOULD_NOT_BE_DEFINED_EQUAL is not defined.");
#endif
#ifndef SHOULD_BE_DEFINED_EQUAL
cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EQUAL is not defined.\n");
#else
cmPassed("SHOULD_BE_DEFINED_EQUAL is defined.");
#endif
#ifndef SHOULD_BE_DEFINED_GREATER
cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER is not defined.\n");
#else

View File

@ -97,6 +97,8 @@ ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt)
SET (SNUM1_VAR "1")
SET (SNUM2_VAR "2")
SET (SNUM3_VAR "1")
IF (SNUM1_VAR LESS SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS)
@ -116,6 +118,18 @@ ELSE (SNUM2_VAR GREATER SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER)
ENDIF (SNUM2_VAR GREATER SNUM1_VAR)
IF (SNUM2_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
ELSE (SNUM2_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
ENDIF (SNUM2_VAR EQUAL SNUM1_VAR)
IF (SNUM3_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL)
ELSE (SNUM3_VAR EQUAL SNUM1_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL)
ENDIF (SNUM3_VAR EQUAL SNUM1_VAR)
IF (SNUM1_VAR GREATER SNUM2_VAR)
ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2)
ELSE (SNUM1_VAR GREATER SNUM2_VAR)