~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/libs/comm/lists/test_cl_util.c

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*___INFO__MARK_BEGIN__*/
 
3
/*************************************************************************
 
4
 * 
 
5
 *  The Contents of this file are made available subject to the terms of
 
6
 *  the Sun Industry Standards Source License Version 1.2
 
7
 * 
 
8
 *  Sun Microsystems Inc., March, 2001
 
9
 * 
 
10
 * 
 
11
 *  Sun Industry Standards Source License Version 1.2
 
12
 *  =================================================
 
13
 *  The contents of this file are subject to the Sun Industry Standards
 
14
 *  Source License Version 1.2 (the "License"); You may not use this file
 
15
 *  except in compliance with the License. You may obtain a copy of the
 
16
 *  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
17
 * 
 
18
 *  Software provided under this License is provided on an "AS IS" basis,
 
19
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
20
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
21
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
22
 *  See the License for the specific provisions governing your rights and
 
23
 *  obligations concerning the Software.
 
24
 * 
 
25
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
26
 * 
 
27
 *   Copyright: 2001 by Sun Microsystems, Inc.
 
28
 * 
 
29
 *   All Rights Reserved.
 
30
 * 
 
31
 ************************************************************************/
 
32
/*___INFO__MARK_END__*/
 
33
 
 
34
#include <stdio.h>
 
35
#include <string.h>
 
36
#include <sys/time.h>
 
37
#include <stdlib.h>
 
38
 
 
39
#include <limits.h>
 
40
#include "cl_util.h"
 
41
 
 
42
#ifdef __CL_FUNCTION__
 
43
#undef __CL_FUNCTION__
 
44
#endif
 
45
#define __CL_FUNCTION__ "main()"
 
46
int main(void) {
 
47
  unsigned long i = 0; 
 
48
  int back = 0;
 
49
  int i2 = 0;
 
50
 
 
51
  printf("\ntest cl_util_get_ulong_number_length()\n");
 
52
 
 
53
  printf("MAX_ULONG: %lu\n", ULONG_MAX);
 
54
/* INT_MAX , ULONG_MAX */
 
55
  back = cl_util_get_ulong_number_length(i);
 
56
  printf("min: %lu last back=%d\n",i,back);
 
57
  i--;
 
58
  back = cl_util_get_ulong_number_length(i);
 
59
  printf("max: %lu last back=%d\n",i,back);
 
60
  i=1000;
 
61
  back = cl_util_get_ulong_number_length(i);
 
62
  printf("max: %lu last back=%d\n",i,back);
 
63
 
 
64
  printf("\ntest cl_util_get_int_number_length()\n");
 
65
 
 
66
  back = cl_util_get_int_number_length(i2);
 
67
  printf("min: %d last back=%d\n",i2,back);
 
68
  i2--;
 
69
  back = cl_util_get_int_number_length(i2);
 
70
  printf("max: %d last back=%d\n",i2,back);
 
71
  i2=1000;
 
72
  back = cl_util_get_int_number_length(i2);
 
73
  printf("max: %d last back=%d\n",i2,back);
 
74
 
 
75
  printf("\ntest cl_util_get_ulong_value()\n");
 
76
  i = cl_util_get_ulong_value("4294967295");
 
77
  printf("value: %lu for string \"%s\"\n",i,"4294967295");
 
78
 
 
79
  i = cl_util_get_ulong_value("1000");
 
80
  printf("value: %lu for string \"%s\"\n",i,"1000");
 
81
 
 
82
  i = cl_util_get_ulong_value("-1");
 
83
  printf("value: %lu for string \"%s\"\n",i,"-1");
 
84
 
 
85
 
 
86
  printf("main done\n");
 
87
  return 0;
 
88
}
 
89
 
 
90