Diff for /libaitcfg/example/test_pwd.c between versions 1.1.2.3 and 1.1.2.4

version 1.1.2.3, 2012/09/19 11:53:52 version 1.1.2.4, 2012/09/19 12:04:44
Line 8 Line 8
 int main()  int main()
 {  {
         pwd_root_t ddd, db;          pwd_root_t ddd, db;
           struct tagUser *u;
         char str[256];          char str[256];
         int ret = 0;          int ret = 0;
   
Line 16  int main() Line 17  int main()
                 return 1;                  return 1;
         }          }
   
 #if 0  
         /* unit test find */          /* unit test find */
         // count elements          // count elements
        printf("attr=%d Count of array %d w/ NULL \n", ALL, pwd_FindAttribute(db, ALL, NULL));        u = (const struct tagUser *) cfg_findPasswdBy(&db, PWD_CRIT_UID, 0);
        printf("attr=%d Count of array %d w/o NULL \n", ALL, pwd_FindAttribute(db, ALL, ""));        printf("cfg_findPasswdBy %p UID 0 User=%s %u:%u\n", u, AIT_GET_STR(&u->usr_name), 
        printf("attr=%d Count of array %d\n", ALL, pwd_FindAttribute(db, ALL, "user_l"));                        AIT_GET_U32(&u->usr_uid), AIT_GET_U32(&u->usr_gid));
         u = (const struct tagUser *) cfg_findPasswdBy(&db, PWD_CRIT_UID, 444);
         printf("cfg_findPasswdBy %p UID 444 User=%s %u:%u\n", u, AIT_GET_STR(&u->usr_name), 
                         AIT_GET_U32(&u->usr_uid), AIT_GET_U32(&u->usr_gid));
         /*
         // find by attributes          // find by attributes
        printf("attr=%d Count of array %d w/ NULL \n", Username, pwd_FindAttribute(db, Username, NULL));        printf("Count of array %d w/ NULL \n", Username, pwd_FindAttribute(db, Username, NULL));
        printf("attr=%d Count of array %d w/o NULL \n", Username, pwd_FindAttribute(db, Username, ""));        printf("Count of array %d w/o NULL \n", Username, pwd_FindAttribute(db, Username, ""));
        printf("attr=%d Count of array %d 'user_l' \n", Username, pwd_FindAttribute(db, Username, "user_l"));        printf("Count of array %d 'user_l' \n", Username, pwd_FindAttribute(db, Username, "user_l"));
        printf("attr=%d Count of array %d 'a' \n", Username, pwd_FindAttribute(db, Username, "a"));        printf("Count of array %d 'a' \n", Username, pwd_FindAttribute(db, Username, "a"));
        printf("attr=%d Count of array %d 'class4e' \n", Class, pwd_FindAttribute(db, Class, "class4e"));        printf("Count of array %d 'class4e' \n", Class, pwd_FindAttribute(db, Class, "class4e"));
        printf("attr=%d Count of array %d 'clas' \n", Class, pwd_FindAttribute(db, Class, "clas"));        printf("Count of array %d 'clas' \n", Class, pwd_FindAttribute(db, Class, "clas"));
        printf("attr=%d Count of array %d 'ii' \n", Home, pwd_FindAttribute(db, Home, "ii"));        printf("Count of array %d 'ii' \n", Home, pwd_FindAttribute(db, Home, "ii"));
        printf("attr=%d Count of array %d 'i' \n", Home, pwd_FindAttribute(db, Home, "i"));        printf("Count of array %d 'i' \n", Home, pwd_FindAttribute(db, Home, "i"));
        printf("attr=%d Count of array %d '' \n", Home, pwd_FindAttribute(db, Home, ""));        printf("Count of array %d '' \n", Home, pwd_FindAttribute(db, Home, ""));
        printf("attr=%d Count of array %d NULL \n", Home, pwd_FindAttribute(db, Home, NULL));        printf("Count of array %d NULL \n", Home, pwd_FindAttribute(db, Home, NULL));
         /* unit end find */          /* unit end find */
   
   #if 0
         /* unit test set */          /* unit test set */
         printf("attr=%d set %d NULL\n", ALL, pwd_SetAttribute(&db, ALL, NULL));          printf("attr=%d set %d NULL\n", ALL, pwd_SetAttribute(&db, ALL, NULL));
         printf("attr=%d set %d w/ empty\n", ALL, pwd_SetAttribute(&db, ALL, ddd));          printf("attr=%d set %d w/ empty\n", ALL, pwd_SetAttribute(&db, ALL, ddd));
Line 96  int main() Line 101  int main()
         }          }
 #endif  #endif
   
        UnloadPasswd(&db);        cfgUnloadPasswd(&db);
         return 0;          return 0;
 }  }

Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>