November 8 2006
来源:互联网 发布:异地一半照片软件 编辑:程序博客网 时间:2024/05/23 17:47
Yesterday I added debug print information into two C source files. I thought it is a easy
thing to do. However, there are still troublesome during the procedures. When the "eclipse",
a development tools by IBM, importing the sources of a project, in fact, it copied those source
into a project directory made by "eclipse" itself. So, I made a mistake that I uploaded the
source file is not in the project directory. Oh, I was strange why not the new program producted
print the debug information.
Today the task is not finished. We must read those source to understand the merchanism of
those programs. In addition, more debug work must be done, for example exception debug,
pressure testing, and so forth.
Firstly, I testing the saturation on file IO error, data error. I renamed the CSV file. Then
the "tmstmsnd" which I am debugging can not find the correct file in according to the specified
path, so it did not create any sub-threads and reported "fopen() error." and exit.
That is right. I changed the CSV file's content. I set the "retry=0, timeout=0". According to
the business logic, "tmstmsnd" will create its child threads. It do it. These threads will retry
to send time message towards a remote host if it failed to send and the retried time is less than
the specified times.
Secondly, I changed some codes so as to ensure the program traverse all branchs include the normal
or the abnormals. It is unreality to simulate those occurring exceptions in reality. For instance,
the program must report a error on "Fail to create a batebase" if it real failed. Although we can
shut down the database server that is bad idea. There are seven persons concurring testing this
system. Once the databse server is shut down by one the others must wait its restarting.
The means we adopted is to make error cases in codes. As follow:
//orginial codes
if( FALSE == createDBQuery( queryBuffer, DB_MODE_SELECT, "CMN", DIRECTOR_INFO_TBL_NAME, whereBuffer, fieldsBuffer ) ) {
SGCMNsyslogErr("getCLtimeMaster.c@getCLtimeMaster():createDBQuery Error");
return FALSE;
}
// modified
if( FALSE == createDBQuery( queryBuffer, DB_MODE_SELECT, "ABC", DIRECTOR_INFO_TBL_NAME, whereBuffer, fieldsBuffer ) ) {
SGCMNsyslogErr("getCLtimeMaster.c@getCLtimeMaster():createDBQuery Error");
return FALSE;
}
The "ABC" or "CMN" is the name of a database, but "ABC" database does not exist. So, we
can find a log message in the log file -- "getCLtimeMaster.c@getCLtimeMaster():createDBQuery Error".
thing to do. However, there are still troublesome during the procedures. When the "eclipse",
a development tools by IBM, importing the sources of a project, in fact, it copied those source
into a project directory made by "eclipse" itself. So, I made a mistake that I uploaded the
source file is not in the project directory. Oh, I was strange why not the new program producted
print the debug information.
Today the task is not finished. We must read those source to understand the merchanism of
those programs. In addition, more debug work must be done, for example exception debug,
pressure testing, and so forth.
Firstly, I testing the saturation on file IO error, data error. I renamed the CSV file. Then
the "tmstmsnd" which I am debugging can not find the correct file in according to the specified
path, so it did not create any sub-threads and reported "fopen() error." and exit.
That is right. I changed the CSV file's content. I set the "retry=0, timeout=0". According to
the business logic, "tmstmsnd" will create its child threads. It do it. These threads will retry
to send time message towards a remote host if it failed to send and the retried time is less than
the specified times.
Secondly, I changed some codes so as to ensure the program traverse all branchs include the normal
or the abnormals. It is unreality to simulate those occurring exceptions in reality. For instance,
the program must report a error on "Fail to create a batebase" if it real failed. Although we can
shut down the database server that is bad idea. There are seven persons concurring testing this
system. Once the databse server is shut down by one the others must wait its restarting.
The means we adopted is to make error cases in codes. As follow:
//orginial codes
if( FALSE == createDBQuery( queryBuffer, DB_MODE_SELECT, "CMN", DIRECTOR_INFO_TBL_NAME, whereBuffer, fieldsBuffer ) ) {
SGCMNsyslogErr("getCLtimeMaster.c@getCLtimeMaster():createDBQuery Error");
return FALSE;
}
// modified
if( FALSE == createDBQuery( queryBuffer, DB_MODE_SELECT, "ABC", DIRECTOR_INFO_TBL_NAME, whereBuffer, fieldsBuffer ) ) {
SGCMNsyslogErr("getCLtimeMaster.c@getCLtimeMaster():createDBQuery Error");
return FALSE;
}
The "ABC" or "CMN" is the name of a database, but "ABC" database does not exist. So, we
can find a log message in the log file -- "getCLtimeMaster.c@getCLtimeMaster():createDBQuery Error".
- November 8 2006
- November 2006
- November 6 2006
- November 7 2006
- November 9 2006
- November 10 2006
- November 13 2006
- November 14 2006
- November 15 2006
- November 16 2006
- November 17 2006
- November 27 2006
- November 30 2006
- november
- squid纯内存缓存 November 20, 2006
- POJ3253[USACO 2006 November Gold]--Fence Repair
- [USACO 2006 November Gold] 玉米地Corn Fields
- November Rain
- November 6 2006
- 本blog暂停,转移到http://jeffen2006.javaeye.com
- ASP.NET程序中常用的三十三种代码
- applet 的沙箱模型
- November 7 2006
- November 8 2006
- 形式化方法的学习真累人啊
- 天津一日“游”
- November 9 2006
- 互联网络实名制最多只能满足权力管理幻觉
- November 10 2006
- November 13 2006
- November 14 2006
- November 15 2006