* [LTP] [PATCH][open_posix] Use default number of threads when it's not be specified
@ 2010-09-30 3:23 Bian Naimeng
[not found] ` <4CC63440.8000808@cn.fujitsu.com>
0 siblings, 1 reply; 2+ messages in thread
From: Bian Naimeng @ 2010-09-30 3:23 UTC (permalink / raw)
To: yanegomi; +Cc: ltp-list
Some stress test cases always fail, because run.sh script lose to give
parameter that specifies the number of threads.
So, fix the test program that use default number of threads when it's
not be specified
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
---
.../stress/mqueues/multi_send_rev_1.c | 13 +++++++++----
.../stress/mqueues/multi_send_rev_2.c | 12 ++++++++----
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
index efa93a7..fe0a8d0 100644
--- a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
+++ b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c
@@ -88,11 +88,16 @@ int main(int argc, char *argv[])
printf("_POSIX_MESSAGE_PASSING is not defined \n");
return PTS_UNRESOLVED;
#endif */
- if ( (2 != argc) || (( num = atoi(argv[1])) <= 0)) {
+
+ if ( (2 < argc) || (2 == argc && ( num = atoi(argv[1])) <= 0)) {
fprintf(stderr, "Usage: %s number_of_threads\n", argv[0]);
- return PTS_FAIL;
- }
- if (num > Max_Threads) {
+ return PTS_FAIL;
+ }
+
+ if (2 > argc) {
+ printf("The num of threads does not be specified. Set to %d\n", Max_Threads);
+ num = Max_Threads;
+ } else if (num > Max_Threads) {
printf("The num of threads are too large. Reset to %d\n", Max_Threads);
num = Max_Threads;
}
diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
index 75bc88b..eda4a9e 100644
--- a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
+++ b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c
@@ -79,11 +79,15 @@ int main(int argc, char *argv[])
printf("_POSIX_MESSAGE_PASSING is not defined \n");
return PTS_UNRESOLVED;
#endif */
- if ( (2 != argc) || (( num = atoi(argv[1])) <= 0)) {
+ if ( (2 < argc) || (2 == argc && ( num = atoi(argv[1])) <= 0)) {
fprintf(stderr, "Usage: %s number_of_threads\n", argv[0]);
- return PTS_FAIL;
- }
- if (num > Max_Threads) {
+ return PTS_FAIL;
+ }
+
+ if (2 > argc) {
+ printf("The num of threads does not be specified. Set to %d\n", Max_Threads);
+ num = Max_Threads;
+ } else if (num > Max_Threads) {
printf("The num of threads are too large. Reset to %d\n", Max_Threads);
num = Max_Threads;
}
--
1.7.0.4
--
Regards
Bian Naimeng
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 2+ messages in thread[parent not found: <4CC63440.8000808@cn.fujitsu.com>]
* Re: [LTP] [PATCH][open_posix] Use default number of threads when it's not be specified [not found] ` <4CC63440.8000808@cn.fujitsu.com> @ 2010-10-26 6:21 ` Garrett Cooper 0 siblings, 0 replies; 2+ messages in thread From: Garrett Cooper @ 2010-10-26 6:21 UTC (permalink / raw) To: Bian Naimeng; +Cc: LTP list 2010/10/25 Bian Naimeng <biannm@cn.fujitsu.com>: > Hi Garrett, > > I know you are busy, i'm sorry to trouble you. > what do you think about this. ... > Bian Naimeng 写道: >> Some stress test cases always fail, because run.sh script lose to give >> parameter that specifies the number of threads. >> >> So, fix the test program that use default number of threads when it's >> not be specified >> >> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com> >> >> --- >> .../stress/mqueues/multi_send_rev_1.c | 13 +++++++++---- >> .../stress/mqueues/multi_send_rev_2.c | 12 ++++++++---- >> 2 files changed, 17 insertions(+), 8 deletions(-) >> >> diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c >> index efa93a7..fe0a8d0 100644 >> --- a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c >> +++ b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_1.c >> @@ -88,11 +88,16 @@ int main(int argc, char *argv[]) >> printf("_POSIX_MESSAGE_PASSING is not defined \n"); >> return PTS_UNRESOLVED; >> #endif */ >> - if ( (2 != argc) || (( num = atoi(argv[1])) <= 0)) { >> + >> + if ( (2 < argc) || (2 == argc && ( num = atoi(argv[1])) <= 0)) { >> fprintf(stderr, "Usage: %s number_of_threads\n", argv[0]); >> - return PTS_FAIL; >> - } >> - if (num > Max_Threads) { >> + return PTS_FAIL; >> + } >> + >> + if (2 > argc) { >> + printf("The num of threads does not be specified. Set to %d\n", Max_Threads); >> + num = Max_Threads; >> + } else if (num > Max_Threads) { >> printf("The num of threads are too large. Reset to %d\n", Max_Threads); >> num = Max_Threads; >> } >> diff --git a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c >> index 75bc88b..eda4a9e 100644 >> --- a/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c >> +++ b/testcases/open_posix_testsuite/stress/mqueues/multi_send_rev_2.c >> @@ -79,11 +79,15 @@ int main(int argc, char *argv[]) >> printf("_POSIX_MESSAGE_PASSING is not defined \n"); >> return PTS_UNRESOLVED; >> #endif */ >> - if ( (2 != argc) || (( num = atoi(argv[1])) <= 0)) { >> + if ( (2 < argc) || (2 == argc && ( num = atoi(argv[1])) <= 0)) { >> fprintf(stderr, "Usage: %s number_of_threads\n", argv[0]); >> - return PTS_FAIL; >> - } >> - if (num > Max_Threads) { >> + return PTS_FAIL; >> + } >> + >> + if (2 > argc) { >> + printf("The num of threads does not be specified. Set to %d\n", Max_Threads); >> + num = Max_Threads; >> + } else if (num > Max_Threads) { >> printf("The num of threads are too large. Reset to %d\n", Max_Threads); >> num = Max_Threads; >> } Thanks for the reminder. I just resolved the issue with another method (added functionality to a .args file with the same basename minus the extension, i.e. multi_send_rev_2.args). It's currently set to 1, but we can tune it later. Thanks, -Garrett ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-26 6:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-30 3:23 [LTP] [PATCH][open_posix] Use default number of threads when it's not be specified Bian Naimeng
[not found] ` <4CC63440.8000808@cn.fujitsu.com>
2010-10-26 6:21 ` Garrett Cooper
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox