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

« back to all changes in this revision

Viewing changes to source/libs/sgeobj/test_sge_attr.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
/*___INFO__MARK_BEGIN__*/
 
2
/*************************************************************************
 
3
 *
 
4
 *  The Contents of this file are made available subject to the terms of
 
5
 *  the Sun Industry Standards Source License Version 1.2
 
6
 *
 
7
 *  Sun Microsystems Inc., March, 2001
 
8
 *
 
9
 *
 
10
 *  Sun Industry Standards Source License Version 1.2
 
11
 *  =================================================
 
12
 *  The contents of this file are subject to the Sun Industry Standards
 
13
 *  Source License Version 1.2 (the "License"); You may not use this file
 
14
 *  except in compliance with the License. You may obtain a copy of the
 
15
 *  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
16
 *
 
17
 *  Software provided under this License is provided on an "AS IS" basis,
 
18
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
19
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
20
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
21
 *  See the License for the specific provisions governing your rights and
 
22
 *  obligations concerning the Software.
 
23
 *
 
24
 *   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
25
 *
 
26
 *   Copyright: 2001 by Sun Microsystems, Inc.
 
27
 *
 
28
 *   All Rights Reserved.
 
29
 *
 
30
 ************************************************************************/
 
31
/*___INFO__MARK_END__*/                                   
 
32
 
 
33
#include <stdio.h>
 
34
#include <stdlib.h>
 
35
 
 
36
#include "sgermon.h"
 
37
#include "cull.h"
 
38
#include "sge_all_listsL.h"
 
39
#include "sge_href.h"
 
40
#include "sge_hgroup.h"
 
41
#include "sge_attr.h"
 
42
 
 
43
bool check_attr_str_list_find_value(void) 
 
44
{
 
45
   bool ret = false;
 
46
   lList *attr_list = NULL;
 
47
   lList *answer_list = NULL;
 
48
   lList *ambiguous_hostref_list = NULL;
 
49
   lListElem *attr = NULL;
 
50
 
 
51
   {
 
52
      lList *hostref_list1 = NULL;
 
53
      lList *hostref_list2 = NULL;
 
54
      lList *hostref_list3 = NULL;
 
55
      lListElem *hgroup1;
 
56
      lListElem *hgroup2;
 
57
      lListElem *hgroup3;
 
58
 
 
59
      hostref_list_add(&hostref_list1, NULL, "a");
 
60
      hostref_list_add(&hostref_list1, NULL, "b");
 
61
      hostref_list_add(&hostref_list1, NULL, "c");
 
62
      hostref_list_add(&hostref_list1, NULL, "d");
 
63
      hostref_list_add(&hostref_list1, NULL, "e");
 
64
 
 
65
      hostref_list_add(&hostref_list2, NULL, "f");
 
66
      hostref_list_add(&hostref_list2, NULL, "a");
 
67
      hostref_list_add(&hostref_list2, NULL, "b");
 
68
      hostref_list_add(&hostref_list2, NULL, "g");
 
69
      hostref_list_add(&hostref_list2, NULL, "c");
 
70
 
 
71
      hostref_list_add(&hostref_list3, NULL, "f");
 
72
      hostref_list_add(&hostref_list3, NULL, "g");
 
73
      hostref_list_add(&hostref_list3, NULL, "h");
 
74
      hostref_list_add(&hostref_list3, NULL, "i");
 
75
      hostref_list_add(&hostref_list3, NULL, "j");
 
76
   
 
77
      hgroup1 = hgroup_create(NULL, "@A", hostref_list1);
 
78
      hgroup2 = hgroup_create(NULL, "@B", hostref_list2);
 
79
      hgroup3 = hgroup_create(NULL, "@C", hostref_list3);
 
80
      *(hgroup_list_get_master_list()) = lCreateList("", HGRP_Type);
 
81
      lAppendElem(*(hgroup_list_get_master_list()), hgroup1);
 
82
      lAppendElem(*(hgroup_list_get_master_list()), hgroup2);
 
83
      lAppendElem(*(hgroup_list_get_master_list()), hgroup3);
 
84
   }
 
85
   return ret;
 
86
}
 
87
 
 
88
int main(int argc, char *argv[])
 
89
{
 
90
   bool failed = false;
 
91
 
 
92
   DENTER_MAIN(TOP_LAYER, "execd");
 
93
 
 
94
   lInit(nmv);
 
95
 
 
96
   if (!failed) {
 
97
      failed = check_attr_str_list_find_value();
 
98
   }
 
99
 
 
100
   return failed ? 1 : 0;
 
101
}
 
102