~ubuntu-branches/ubuntu/jaunty/cmake/jaunty-security

« back to all changes in this revision

Viewing changes to Tests/StringFileTest/InputFile.h.in

  • Committer: Bazaar Package Importer
  • Author(s): A. Maitland Bottoms
  • Date: 2005-03-02 09:22:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050302092244-y6o9j8wr27vqcqvx
Tags: 2.0.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "includefile"
 
2
 
 
3
/* This should be configured to a define.  */
 
4
#cmakedefine TEST_DEFINED @TEST_DEFINED@
 
5
/* This should be configured to a commented undef with the curlies in place */
 
6
#cmakedefine TEST_NOT_DEFINED ${TEST_NOT_DEFINED} 
 
7
 
 
8
int CheckMethod(const char* var, const char* val )
 
9
{
 
10
  if ( !var )
 
11
    {
 
12
    printf("Var not specified\n");
 
13
    return 1;
 
14
    }
 
15
  if ( !val )
 
16
    {
 
17
    printf("Val not specified\n");
 
18
    return 1;
 
19
    }
 
20
  if ( strcmp(var, val) != 0)
 
21
    {
 
22
    printf("Var (%s) and Val (%s) are not the same...\n", var, val);
 
23
    return 1;
 
24
    }
 
25
#if !defined(TEST_DEFINED) || TEST_DEFINED != 123
 
26
  printf("TEST_DEFINED is not defined to 123\n");
 
27
  return 1;
 
28
#elif defined(TEST_NOT_DEFINED)
 
29
  printf("TEST_NOT_DEFINED is defined\n");
 
30
  return 1;
 
31
#else
 
32
  return 0;
 
33
#endif  
 
34
}