0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #include <stdio.h>
0035 #include <stdlib.h>
0036 #include <ndebug.h>
0037 #include <atmi.h>
0038 #include <ndrstandard.h>
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 void TESTSV1 (TPSVCINFO *p_svc)
0052 {
0053 tpforward("TESTSV2", NULL, 0, 0);
0054 }
0055
0056
0057
0058
0059 void TESTSVE1 (TPSVCINFO *p_svc)
0060 {
0061 char *odata=NULL;
0062 long olen;
0063
0064
0065 tpcall("TESTSVE2", NULL, 0, &odata, &olen, 0);
0066
0067
0068 tpforward("TESTSV2", NULL, 0, 0);
0069 }
0070
0071
0072
0073
0074 void TESTSVE1_RET (TPSVCINFO *p_svc)
0075 {
0076 char *odata=NULL;
0077 long olen;
0078
0079
0080 tpcall("TESTSVE2", NULL, 0, &odata, &olen, 0);
0081
0082 tpreturn(TPSUCCESS, 0, NULL, 0, 0);
0083 }
0084
0085
0086
0087
0088
0089 void TEST1_PART (TPSVCINFO *p_svc)
0090 {
0091 int ret = EXSUCCEED;
0092
0093 if (EXSUCCEED==tpabort(0))
0094 {
0095 NDRX_LOG(log_error, "TESTERROR: Must not abort!");
0096 EXFAIL_OUT(ret);
0097 }
0098
0099 if (TPEPROTO!=tperrno)
0100 {
0101 NDRX_LOG(log_error, "TESTERROR: Must be TPEPROTO, got %d!", tperrno);
0102 EXFAIL_OUT(ret);
0103 }
0104
0105 if (!tpgetlev())
0106 {
0107 NDRX_LOG(log_error, "TESTERROR: Process shall stay in transaction, but is not");
0108 EXFAIL_OUT(ret);
0109 }
0110
0111 if (EXSUCCEED==tpcommit(0))
0112 {
0113 NDRX_LOG(log_error, "TESTERROR: Must not commit!");
0114 EXFAIL_OUT(ret);
0115 }
0116
0117 if (TPEPROTO!=tperrno)
0118 {
0119 NDRX_LOG(log_error, "TESTERROR: Must be TPEPROTO, got %d!", tperrno);
0120 EXFAIL_OUT(ret);
0121 }
0122
0123 if (!tpgetlev())
0124 {
0125 NDRX_LOG(log_error, "TESTERROR: Process shall stay in transaction, but is not");
0126 EXFAIL_OUT(ret);
0127 }
0128
0129
0130 out:
0131
0132 if (EXSUCCEED==ret)
0133 {
0134 tpreturn(TPSUCCESS, 0, NULL, 0, 0);
0135 }
0136 else
0137 {
0138 tpreturn(TPFAIL, 0, NULL, 0, 0);
0139 }
0140 }
0141
0142
0143
0144
0145
0146 void TESTSVE1_TRANRET (TPSVCINFO *p_svc)
0147 {
0148 int ret = EXSUCCEED;
0149
0150 if (EXSUCCEED!=tpbegin(40, 0))
0151 {
0152 NDRX_LOG(log_error, "TESTERROR: Failed to begin transaction: %s",
0153 tpstrerror(tperrno));
0154 userlog("TESTERROR: Failed to begin transaction: %s",
0155 tpstrerror(tperrno));
0156 EXFAIL_OUT(ret);
0157 }
0158 out:
0159 if (EXSUCCEED==ret)
0160 {
0161 tpreturn(TPSUCCESS, 0, NULL, 0, 0);
0162 }
0163 else
0164 {
0165 tpreturn(TPFAIL, 0, NULL, 0, 0);
0166 }
0167 }
0168
0169
0170
0171
0172 void TESTSVE1_TRANFWD (TPSVCINFO *p_svc)
0173 {
0174 if (EXSUCCEED!=tpbegin(40, 0))
0175 {
0176 NDRX_LOG(log_error, "TESTERROR: Failed to begin transaction: %s",
0177 tpstrerror(tperrno));
0178 userlog("TESTERROR: Failed to begin transaction: %s",
0179 tpstrerror(tperrno));
0180 }
0181
0182 tpforward("TESTSV2", NULL, 0, 0);
0183 }
0184
0185
0186
0187
0188 void TESTSVE1_NORET (TPSVCINFO *p_svc)
0189 {
0190 char *odata=NULL;
0191 long olen;
0192 }
0193
0194
0195 int tpsvrinit (int argc, char **argv)
0196 {
0197 return tpopen();
0198 }
0199
0200 void tpsvrdone(void)
0201 {
0202 tpclose();
0203 }
0204
0205
0206