stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Farid Zaripov <>
Subject testsuite process helpers (was: RE: string methods thread safety)
Date Wed, 26 Jul 2006 16:31:00 GMT
 > -----Original Message-----
 > From: Martin Sebor []
 > Sent: Friday, July 21, 2006 3:34 AM
 > To:
 > Subject: Re: string methods thread safety
 > I would move these two functions to a different header/source
 > file, say rw_process.h and process.cpp. We can also move
 > rw_system() to the same files and get rid of system.h and system.cpp.

 > > // returns pid of the created process
 > > // returns -1 if failed
 > > // note: argv[0] should be equal to path _TEST_EXPORT rw_pid_t
 > > rw_process_create (const char* path, char* const argv []);
 > I'm not sure about the second argument. Is it the most
 > convenient interface? Wouldn't something closer to
 > rw_system() be easier to use? (If so, you might want to move
 > rw_process_create to the .cpp file and make it static and
 > call it from the new vararg function).
   For a while I implemented the two overloads: the argv overload
(used by string mt test), and the vararg overload. Should we keep
the both overloads? The advantages of the argv overload for string mt 
test I have described in the previous letter (Sent: Wednesday, July 26, 
2006 7:09 PM; Subject: RE: string methods thread safety).

 > > // returns pid of the specified process // returns -1 if failed //
 > > result is a pointer to a buffer where the result code // of the
 > > specified process will be stored, or NULL _TEST_EXPORT rw_pid_t
 > > rw_process_join (rw_pid_t pid, int* result);
 > Okay, this is close to waitpid() that I would suggest to
 > rename it to simply rw_waitpid() :)

   The test exercising the rw_process_create() overloads and rw_waitpid()
implemented also (0.process.cpp). This test executes the self with some 
parameters, then the executed copy compares the parameters with expected 
and returns the result. The one problem is confusing rw_error() output 
when I test the expected errno value in cases when rw_process_create() 
and rw_waitpid() should fail. Maybe that cases are not necessary?

   The files are attached.


View raw message