diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-25 19:08:05 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-10-25 19:08:05 (GMT) |
commit | 5eda3799074f858f7790975b7a294374720177f7 (patch) | |
tree | e39a1cf883d7098956fbf0e49041ba04f79c7816 /Tests/LoadCommandOneConfig/LoadedCommand.cxx | |
parent | ef07a8565ee0bf80918d4178058cd2ded8722db8 (diff) | |
download | CMake-5eda3799074f858f7790975b7a294374720177f7.zip CMake-5eda3799074f858f7790975b7a294374720177f7.tar.gz CMake-5eda3799074f858f7790975b7a294374720177f7.tar.bz2 |
ENH: clean up loaded command test so you can tell what really failed
Diffstat (limited to 'Tests/LoadCommandOneConfig/LoadedCommand.cxx')
-rw-r--r-- | Tests/LoadCommandOneConfig/LoadedCommand.cxx | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/Tests/LoadCommandOneConfig/LoadedCommand.cxx b/Tests/LoadCommandOneConfig/LoadedCommand.cxx index 04daff0..c58bcf1 100644 --- a/Tests/LoadCommandOneConfig/LoadedCommand.cxx +++ b/Tests/LoadCommandOneConfig/LoadedCommand.cxx @@ -1,30 +1,41 @@ #include "LoadedCommand.h" #include <stdio.h> +int testSizeOf(int s1, int s2) +{ + return s1 - s2; +} + int main () { + int ret = 0; #ifdef HAVE_VSBLABLA printf("Should not be able to find vsblabla\n"); - return 1; + ret = 1; #endif #if !defined( HAVE_PRINTF ) printf("Should be able to find printf\n"); - return 1; + ret= 1; #endif #if !defined( ADDED_DEFINITION ) printf("Should have ADDED_DEFINITION defined\n"); - return 1; + ret= 1; +#endif +#if !defined(CMAKE_IS_FUN) + printf("Loaded Command was not built with CMAKE_IS_FUN: failed.\n"); + ret = 1; #endif - if(SIZEOF_CHAR != 1) + if(testSizeOf(SIZEOF_CHAR, sizeof(char))) { - printf("Size of char is not one, something is broken\n"); + printf("Size of char is broken.\n"); + ret = 1; } - -#ifdef CMAKE_IS_FUN - return SIZEOF_CHAR-1; -#else - return SIZEOF_SHORT; -#endif + if(testSizeOf(SIZEOF_SHORT, sizeof(short))) + { + printf("Size of short is broken.\n"); + ret = 1; + } + return ret; } |