May 7th Thursday (五月 七日 木曜日)
2009-05-29 10:43
323 查看
The program DATmnt is finished modifing. This day I am going to make unit testing for some import functions in them.
The PopDmdTbl() is so important, and FilterDmdTbl() is too. But I have no way to test them.
//getgrpinfo.c
#include <grp.h>
#include <sys/types.h>
#include <stdio.h>
main()
{
struct group *data;
FILE *stream;
int i;
stream = fopen("/etc/group", "r");
while ((data = fgetgrent(stream)) != 0)
{
i = 0;
printf("%s :%s:%d :", data->gr_name, data->gr_passwd, data->gr_gid);
while (data->gr_mem) printf("%s,", data->gr_mem[i++]);
printf("/n");
}
fclose(stream);
}
The PopDmdTbl() is so important, and FilterDmdTbl() is too. But I have no way to test them.
//getgrpinfo.c
#include <grp.h>
#include <sys/types.h>
#include <stdio.h>
main()
{
struct group *data;
FILE *stream;
int i;
stream = fopen("/etc/group", "r");
while ((data = fgetgrent(stream)) != 0)
{
i = 0;
printf("%s :%s:%d :", data->gr_name, data->gr_passwd, data->gr_gid);
while (data->gr_mem) printf("%s,", data->gr_mem[i++]);
printf("/n");
}
fclose(stream);
}
相关文章推荐
- May 24th Thursday (五月 二十四日 木曜日)
- 2008 May 7th Wednesday (五月 七日 水曜日)
- June 7th Thursday (六月 七日 木曜日)
- 2008 May 8th Thursday (五月 八日 木曜日)
- May 7th Monday (五月 七日 月曜日)
- May 17th Thursday (五月 十七日 木曜日)
- 2008 May 22th Thursday (五月 二十二日 木曜日)
- 2008 August 7th Thursday (八月 七日 木曜日)
- May 31th Thursday (五月 三十一日 木曜日)
- May 14th Thursday (五月 十四日 木曜日)
- May 10th Thursday (五月 十日 木曜日)
- 2008 May 15th Thursday (五月 十五日 木曜日)
- May 11th Friday (五月 十一日 木曜日)
- 2008 May 29 Thrusday (五月 二十九日 木曜日)
- May 21th Thursday (五月 二十一日 木曜日)
- May 28th Tuesday (五月 二十八日 木曜日)
- Aprial 26th Thursday (四月 二十六日 木曜日)
- May 23th Wednesday (五月 二十三日 水曜日)
- July 19th Thursday (七月 十九日 木曜日)
- 2008 March 6th Thursday (三月 六日 木曜日