[Dev-C++] How to test methods with system calls
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Hiroyuki Y. <yam...@gm...> - 2008-10-22 12:35:26
|
I'm testing some c++ programs having some methods with system calls, which are like write(2) and read(2). (I use googletest for the test.) Those write(2) and read(2) can fail for some reason, but it's not predicable, so I'm wondering how I can test error handling codes for errors by those system calls. Is there any way I can simulate those system call' errors without modification in source code ? How do you usually test those ? Thanks in advance, Hiroyuki |