~ubuntu-branches/ubuntu/lucid/cmake/lucid

« back to all changes in this revision

Viewing changes to Tests/TryCompile/expect_arg.c

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-12-16 11:11:54 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091216111154-6accvv6yq86h2hkc
Tags: 2.8.0-5ubuntu1
* Merge from debian testing (LP: #497349). Remaining changes:
  - Keep the Replaces: on cmake-data to cover the Kubuntu version from
    Jaunty in case someone decides to do an (unsupported) Jaunty->Lucid
    upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <string.h>
 
3
int main(int ac, char*av[])
 
4
{
 
5
  int i;
 
6
  printf("ac = [%d]\n", ac);
 
7
  for(i =0; i < ac; i++)
 
8
    {
 
9
    printf("arg[%d] = %s\n", i, av[i]);
 
10
    }
 
11
  if(ac == 3)
 
12
    {
 
13
    if(strcmp(av[1], "arg1") ==0 
 
14
       && strcmp(av[2], "arg2") ==0)
 
15
      {
 
16
      printf("arg1 and arg2 present and accounted for!\n");
 
17
      return 0;
 
18
      }
 
19
    }
 
20
  printf("arg1 and arg2 missing!\n");
 
21
  return -1;
 
22
}