error code changes in exp file
[csql.git] / src / faulttest / FaultInjection.cxx
blob023d9fc557d1840fefc1e5ad7c3aca5dafe547e6
1 /***************************************************************************
2 * Copyright (C) 2007 by Prabakaran Thirumalai *
3 * praba_tuty@yahoo.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #include<CSql.h>
21 #include<HelperFunc.cxx>
22 #include<FaultFunc.cxx>
23 void callFunction(char *tname, void *obj);
24 void injectFault(char *testname, void *object)
26 char *enabledTest = os::getenv("CSQL_INJECT");
27 if (enabledTest == NULL) return;
28 if (strcmp(testname, enabledTest) == 0)
30 callFunction(testname, object);
32 return;
35 void callFunction(char *testname, void *object)
37 if (strcmp(testname, "test1") == 0) set_rv_timeout(object);
38 else if (strcmp(testname, "test2") ==0) kill_myself(object);
39 else printf("Fault Injection Test Name is wrong\n");