From ac19e3f75aab0e68c3e40eb72c38eb6f77e752d5 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Tue, 3 Mar 2015 10:50:16 +0400 Subject: [PATCH] Delete redundant test. Check for fork_wait_exit_status.cpp for the exit status tests. --- cpp/test_return_code.cpp | 59 ------------------- ...ork_wait.cpp => fork_wait_exit_status.cpp} | 0 2 files changed, 59 deletions(-) delete mode 100644 cpp/test_return_code.cpp rename linux/{fork_wait.cpp => fork_wait_exit_status.cpp} (100%) diff --git a/cpp/test_return_code.cpp b/cpp/test_return_code.cpp deleted file mode 100644 index 027bfe0..0000000 --- a/cpp/test_return_code.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* Check cf5-opt.vim defs. -VIM: let g:lcppflags="-std=c++11 -O2" -VIM: let g:cppflags=g:boost.g:tbb.g:tbbmalloc.g:tbbmproxy -VIM: let g:ldlibpath=g:boostld.g:tbbld -VIM: let g:cf5output=0 -*/ -#include -#include -#include - - -void run( const char * cmd ) -{ - std::cout << cmd << " => "; - int ws = system( cmd ); - - if ( WIFEXITED(ws) ) - std::cout << "return code " << WEXITSTATUS(ws) << std::endl; - else if ( WIFSIGNALED(ws) ) - { - std::cout << "signal code " << WTERMSIG(ws); - #if 0 - if ( WCOREDUMP(ws) ) - std::cout << " and core dump generated." << std::endl; - else - std::cout << " and core dump is not generated." << std::endl; - #endif - std::cout << std::endl; - } - else if ( WIFSTOPPED(ws) ) - { - std::cout << "stopped with signal " << WSTOPSIG(ws) << std::endl; - } - else - std::cout << "Child is not terminated normally." << std::endl; -} - -int main ( int argc, char ** argv) -{ - - if ( argc != 1 ) - { - std::string arg( argv[1] ); - if ( arg == "throw" ) - { - throw std::runtime_error( "runtime error" ); - } - - int r = atoi( arg.c_str() ); - return (r) ? r : -1; - } - - run("test_return_code.exe 1"); - run("test_return_code.exe 2"); - run("test_return_code.exe throw"); - - return 0; -} - diff --git a/linux/fork_wait.cpp b/linux/fork_wait_exit_status.cpp similarity index 100% rename from linux/fork_wait.cpp rename to linux/fork_wait_exit_status.cpp