On 05/21/2013 06:22 PM, Jan Stancek wrote: > > > > > ----- Original Message ----- >> From: "DAN LI" <li....@cn.fujitsu.com> >> To: "LTP list" <ltp-list@lists.sourceforge.net> >> Sent: Tuesday, 21 May, 2013 10:51:53 AM >> Subject: [LTP] [PATCH] semctl01.c: Pass the correct parameter >> >> >> For SEM_STAT, the semid argument is not a semaphore identifier, but instead >> an >> index into the kernel’s internal array that maintains information about all >> semaphore sets on the system. >> >> Pass a correct index of the kernel' internal array intead of a semaphores id >> when >> testing feature SEM_STAT. >> >> Signed-off-by: DAN LI <li....@cn.fujitsu.com> >> --- > > Hi, > > that backup/restore of global variable in setup/cleanup funcs > between testcases looks a bit odd to me. > > How about adding new field to test_case_t? > > +static int sem_index = 0; > static struct test_case_t { > + int *semid; > ... > - TEST(semctl(sem_id_1, TC[i].semnum, TC[i].cmd, > + TEST(semctl(*(TC[i].semid), TC[i].semnum, TC[i].cmd, > > These you could initialise in TC[] definition to either &sem_id_1 or > &sem_index > and avoid all that backup/restore of sem_id_1. > > What do you think?
Sounds better.;) Thank you for reviewing. Regards, DAN LI > > Regards, > Jan > ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list