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 <string.h>
0035 #include <stdio.h>
0036 #include <stdlib.h>
0037 #include <memory.h>
0038
0039 #include <atmi.h>
0040 #include <ubf.h>
0041 #include <ndebug.h>
0042 #include <test.fd.h>
0043 #include <ndrstandard.h>
0044 #include <Exfields.h>
0045 #include <ubfutil.h>
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 int main(int argc, char** argv) {
0058
0059 UBFH *p_ub;
0060 long rsplen;
0061 int i;
0062 int ret=EXSUCCEED;
0063 long revent;
0064 int sections_got = 0;
0065 int sections_total = 0;
0066 int occ1, occ2;
0067 int cd;
0068 int recv_continue=1;
0069 BFLDID empty[] = {
0070 BBADFLDID
0071 };
0072
0073
0074
0075
0076 if (NULL==(p_ub= (UBFH *)tpalloc("UBF", NULL, 1024)))
0077 {
0078 NDRX_LOG(log_error, "TESTERROR: buffer alloc failed: %s", tpstrerror(tperrno));
0079 EXFAIL_OUT(ret);
0080 }
0081
0082 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "my_app", 0L) ||
0083
0084 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_KEY,"string_setting", 0L) ||
0085 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_FORMAT, "s..6", 0L) ||
0086
0087 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_KEY, "float_setting", 0L) ||
0088 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_FORMAT, "n1..5", 0L) ||
0089
0090 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_KEY, "integer_setting", 0L) ||
0091 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_FORMAT, "i..6", 0L) ||
0092
0093 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_KEY, "true_setting", 0L) ||
0094 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_FORMAT, "t", 0L) ||
0095
0096 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_KEY, "false_setting", 0L) ||
0097 EXSUCCEED!=Badd(p_ub, EX_CC_FORMAT_FORMAT, "t", 0L)
0098 )
0099 {
0100 NDRX_LOG(log_error, "TESTERROR: Failed to setup buffer: %s", Bstrerror(Berror));
0101 EXFAIL_OUT(ret);
0102 }
0103
0104
0105 if (EXFAIL == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0106 {
0107 NDRX_LOG(log_error, "TESTERROR: @CCONF failed: %s", tpstrerror(tperrno));
0108 EXFAIL_OUT(ret);
0109 }
0110
0111
0112
0113
0114
0115 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_CC_KEY, "string_setting", 0, BFLD_STRING)))
0116 {
0117 NDRX_LOG(log_error, "TESTERROR: EX_CC_KEY with value [string_setting] "
0118 "not found: %s", Bstrerror(Berror));
0119 EXFAIL_OUT(ret);
0120 }
0121
0122 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_CC_VALUE, "value1", 0, BFLD_STRING)))
0123 {
0124 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [value1] "
0125 "not found: %s", Bstrerror(Berror));
0126 EXFAIL_OUT(ret);
0127 }
0128
0129 if (occ1!=occ2)
0130 {
0131 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0132 EXFAIL_OUT(ret);
0133 }
0134
0135
0136
0137 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_CC_KEY, "float_setting", 0, BFLD_STRING)))
0138 {
0139 NDRX_LOG(log_error, "TESTERROR: EX_CC_KEY with value [float_setting] "
0140 "not found: %s", Bstrerror(Berror));
0141 EXFAIL_OUT(ret);
0142 }
0143
0144 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_CC_VALUE, "-1.99", 0, BFLD_STRING)))
0145 {
0146 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [-1.99] "
0147 "not found: %s", Bstrerror(Berror));
0148 EXFAIL_OUT(ret);
0149 }
0150
0151 if (occ1!=occ2)
0152 {
0153 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0154 EXFAIL_OUT(ret);
0155 }
0156
0157
0158
0159
0160 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_CC_KEY, "integer_setting", 0, BFLD_STRING)))
0161 {
0162 NDRX_LOG(log_error, "TESTERROR: EX_CC_KEY with value [integer_setting] "
0163 "not found: %s", Bstrerror(Berror));
0164 EXFAIL_OUT(ret);
0165 }
0166
0167 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_CC_VALUE, "100001", 0, BFLD_STRING)))
0168 {
0169 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [100001] "
0170 "not found: %s", Bstrerror(Berror));
0171 EXFAIL_OUT(ret);
0172 }
0173
0174 if (occ1!=occ2)
0175 {
0176 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0177 EXFAIL_OUT(ret);
0178 }
0179
0180
0181
0182
0183 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_CC_KEY, "true_setting", 0, BFLD_STRING)))
0184 {
0185 NDRX_LOG(log_error, "TESTERROR: EX_CC_KEY with value [true_setting] "
0186 "not found: %s", Bstrerror(Berror));
0187 EXFAIL_OUT(ret);
0188 }
0189
0190 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_CC_VALUE, "True", 0, BFLD_STRING)))
0191 {
0192 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [True] "
0193 "not found: %s", Bstrerror(Berror));
0194 EXFAIL_OUT(ret);
0195 }
0196
0197 if (occ1!=occ2)
0198 {
0199 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0200 EXFAIL_OUT(ret);
0201 }
0202
0203
0204
0205 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_CC_KEY, "false_setting", 0, BFLD_STRING)))
0206 {
0207 NDRX_LOG(log_error, "TESTERROR: EX_CC_KEY with value [false_setting] "
0208 "not found: %s", Bstrerror(Berror));
0209 EXFAIL_OUT(ret);
0210 }
0211
0212 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_CC_VALUE, "no", 0, BFLD_STRING)))
0213 {
0214 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [no] "
0215 "not found: %s", Bstrerror(Berror));
0216 EXFAIL_OUT(ret);
0217 }
0218
0219 if (occ1!=occ2)
0220 {
0221 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0222 EXFAIL_OUT(ret);
0223 }
0224
0225 tpfree((char *)p_ub);
0226
0227
0228
0229
0230
0231 if (NULL==(p_ub= (UBFH *)tpalloc("UBF", NULL, 1024)))
0232 {
0233 NDRX_LOG(log_error, "TESTERROR: buffer alloc failed: %s", tpstrerror(tperrno));
0234 EXFAIL_OUT(ret);
0235 }
0236
0237 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "xapp", 0L) ||
0238
0239 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_KEY,0, "xstring_setting", 0L) ||
0240 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_FORMAT, 0, "s..6", 0L))
0241 {
0242 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0243 Bstrerror(Berror));
0244 EXFAIL_OUT(ret);
0245 }
0246
0247 if (EXSUCCEED == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0248 {
0249 NDRX_LOG(log_error, "TESTERROR: @CCONF must FAIL!");
0250 EXFAIL_OUT(ret);
0251 }
0252 else
0253 {
0254
0255
0256
0257
0258
0259
0260 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_NERROR_CODE, "7", 0, BFLD_STRING)))
0261 {
0262 NDRX_LOG(log_error, "TESTERROR: EX_NERROR_CODE with value [7] "
0263 "not found: %s", Bstrerror(Berror));
0264 EXFAIL_OUT(ret);
0265 }
0266
0267 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_NERROR_MSG, "xstring_setting", 0, BFLD_STRING)))
0268 {
0269 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [xstring_setting] "
0270 "not found: %s", Bstrerror(Berror));
0271 EXFAIL_OUT(ret);
0272 }
0273
0274 if (occ1!=occ2)
0275 {
0276 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0277 EXFAIL_OUT(ret);
0278 }
0279 }
0280
0281 Bdelall(p_ub, EX_NERROR_CODE);
0282 Bdelall(p_ub, EX_NERROR_MSG);
0283
0284 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "xapp", 0L) ||
0285
0286 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_KEY,0, "xfloat_setting", 0L) ||
0287 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_FORMAT, 0, "n1..1", 0L))
0288 {
0289 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0290 Bstrerror(Berror));
0291 EXFAIL_OUT(ret);
0292 }
0293
0294 if (EXSUCCEED == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0295 {
0296 NDRX_LOG(log_error, "TESTERROR: @CCONF must FAIL!");
0297 EXFAIL_OUT(ret);
0298 }
0299 else
0300 {
0301
0302
0303
0304
0305
0306
0307 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_NERROR_CODE, "7", 0, BFLD_STRING)))
0308 {
0309 NDRX_LOG(log_error, "TESTERROR: EX_NERROR_CODE with value [7] "
0310 "not found: %s", Bstrerror(Berror));
0311 EXFAIL_OUT(ret);
0312 }
0313
0314 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_NERROR_MSG, "xfloat_setting", 0, BFLD_STRING)))
0315 {
0316 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [xfloat_setting] "
0317 "not found: %s", Bstrerror(Berror));
0318 EXFAIL_OUT(ret);
0319 }
0320
0321 if (occ1!=occ2)
0322 {
0323 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0324 EXFAIL_OUT(ret);
0325 }
0326 }
0327
0328
0329 Bdelall(p_ub, EX_NERROR_CODE);
0330 Bdelall(p_ub, EX_NERROR_MSG);
0331
0332 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "xapp", 0L) ||
0333
0334 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_KEY,0, "xinteger_setting", 0L) ||
0335 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_FORMAT, 0, "i..10", 0L))
0336 {
0337 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0338 Bstrerror(Berror));
0339 EXFAIL_OUT(ret);
0340 }
0341
0342 if (EXSUCCEED == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0343 {
0344 NDRX_LOG(log_error, "TESTERROR: @CCONF must FAIL!");
0345 EXFAIL_OUT(ret);
0346 }
0347 else
0348 {
0349
0350
0351
0352
0353
0354
0355 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_NERROR_CODE, "7", 0, BFLD_STRING)))
0356 {
0357 NDRX_LOG(log_error, "TESTERROR: EX_NERROR_CODE with value [7] "
0358 "not found: %s", Bstrerror(Berror));
0359 EXFAIL_OUT(ret);
0360 }
0361
0362 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_NERROR_MSG, "xinteger_setting", 0, BFLD_STRING)))
0363 {
0364 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [xinteger_setting] "
0365 "not found: %s", Bstrerror(Berror));
0366 EXFAIL_OUT(ret);
0367 }
0368
0369 if (occ1!=occ2)
0370 {
0371 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0372 EXFAIL_OUT(ret);
0373 }
0374 }
0375
0376
0377 Bdelall(p_ub, EX_NERROR_CODE);
0378 Bdelall(p_ub, EX_NERROR_MSG);
0379
0380 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "xapp", 0L) ||
0381
0382 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_KEY,0, "xtrue_setting", 0L) ||
0383 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_FORMAT, 0, "t", 0L))
0384 {
0385 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0386 Bstrerror(Berror));
0387 EXFAIL_OUT(ret);
0388 }
0389
0390 if (EXSUCCEED == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0391 {
0392 NDRX_LOG(log_error, "TESTERROR: @CCONF must FAIL!");
0393 EXFAIL_OUT(ret);
0394 }
0395 else
0396 {
0397
0398
0399
0400
0401
0402
0403 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_NERROR_CODE, "7", 0, BFLD_STRING)))
0404 {
0405 NDRX_LOG(log_error, "TESTERROR: EX_NERROR_CODE with value [7] "
0406 "not found: %s", Bstrerror(Berror));
0407 EXFAIL_OUT(ret);
0408 }
0409
0410 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_NERROR_MSG, "xtrue_setting", 0, BFLD_STRING)))
0411 {
0412 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [xtrue_setting] "
0413 "not found: %s", Bstrerror(Berror));
0414 EXFAIL_OUT(ret);
0415 }
0416
0417 if (occ1!=occ2)
0418 {
0419 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0420 EXFAIL_OUT(ret);
0421 }
0422 }
0423
0424
0425 Bdelall(p_ub, EX_NERROR_CODE);
0426 Bdelall(p_ub, EX_NERROR_MSG);
0427
0428 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "xapp", 0L) ||
0429
0430 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_KEY,0, "xfalse_setting", 0L) ||
0431 EXSUCCEED!=Bchg(p_ub, EX_CC_FORMAT_FORMAT, 0, "t", 0L))
0432 {
0433 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0434 Bstrerror(Berror));
0435 EXFAIL_OUT(ret);
0436 }
0437
0438 if (EXSUCCEED == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0439 {
0440 NDRX_LOG(log_error, "TESTERROR: @CCONF must FAIL!");
0441 EXFAIL_OUT(ret);
0442 }
0443 else
0444 {
0445
0446
0447
0448
0449
0450
0451 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_NERROR_CODE, "7", 0, BFLD_STRING)))
0452 {
0453 NDRX_LOG(log_error, "TESTERROR: EX_NERROR_CODE with value [7] "
0454 "not found: %s", Bstrerror(Berror));
0455 EXFAIL_OUT(ret);
0456 }
0457
0458 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_NERROR_MSG, "xfalse_setting", 0, BFLD_STRING)))
0459 {
0460 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [xfalse_setting] "
0461 "not found: %s", Bstrerror(Berror));
0462 EXFAIL_OUT(ret);
0463 }
0464
0465 if (occ1!=occ2)
0466 {
0467 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0468 EXFAIL_OUT(ret);
0469 }
0470 }
0471
0472
0473
0474
0475
0476 Bdelall(p_ub, EX_NERROR_CODE);
0477 Bdelall(p_ub, EX_NERROR_MSG);
0478
0479 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "x2app", 0L) ||
0480
0481 EXSUCCEED!=Bchg(p_ub, EX_CC_MANDATORY,0, "xtrue_setting", 0L))
0482 {
0483 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0484 Bstrerror(Berror));
0485 EXFAIL_OUT(ret);
0486 }
0487
0488 if (EXSUCCEED == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0489 {
0490 NDRX_LOG(log_error, "TESTERROR: @CCONF must FAIL!");
0491 EXFAIL_OUT(ret);
0492 }
0493 else
0494 {
0495
0496
0497
0498
0499
0500
0501 if (EXFAIL==(occ1=CBfindocc (p_ub, EX_NERROR_CODE, "6", 0, BFLD_STRING)))
0502 {
0503 NDRX_LOG(log_error, "TESTERROR: EX_NERROR_CODE with value [6] "
0504 "not found: %s", Bstrerror(Berror));
0505 EXFAIL_OUT(ret);
0506 }
0507
0508 if (EXFAIL==(occ2=CBfindocc (p_ub, EX_NERROR_MSG, "xtrue_setting", 0, BFLD_STRING)))
0509 {
0510 NDRX_LOG(log_error, "TESTERROR: EX_CC_VALUE with value [xtrue_setting] "
0511 "not found: %s", Bstrerror(Berror));
0512 EXFAIL_OUT(ret);
0513 }
0514
0515 if (occ1!=occ2)
0516 {
0517 NDRX_LOG(log_error, "Invalid occurrences: %d vs %d", occ1, occ2);
0518 EXFAIL_OUT(ret);
0519 }
0520 }
0521
0522
0523
0524
0525
0526 Bproj(p_ub, empty);
0527 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "test_section", 0L))
0528 {
0529 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0530 Bstrerror(Berror));
0531 EXFAIL_OUT(ret);
0532 }
0533
0534 if (EXSUCCEED!=Bchg(p_ub, EX_CC_RESOURCE, 0, "test.ini", 0L))
0535 {
0536 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0537 Bstrerror(Berror));
0538 EXFAIL_OUT(ret);
0539 }
0540
0541 if (EXFAIL == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0542 {
0543 NDRX_LOG(log_error, "TESTERROR: @CCONF failed: %s", tpstrerror(tperrno));
0544 ndrx_debug_dump_UBF(log_debug, "CCONF error rsp", p_ub);
0545
0546 EXFAIL_OUT(ret);
0547 }
0548 else
0549 {
0550 if (EXFAIL==CBfindocc (p_ub, EX_CC_VALUE, "motorcycle", 0, BFLD_STRING))
0551 {
0552 NDRX_LOG(log_error, "TESTERROR: cannot find EX_CC_VALUE with value "
0553 "[motorcycle]: %s", Bstrerror(Berror));
0554 EXFAIL_OUT(ret);
0555 }
0556 }
0557
0558 Bproj(p_ub, empty);
0559 if (EXSUCCEED!=Bchg(p_ub, EX_CC_LOOKUPSECTION, 0, "xapp", 0L))
0560 {
0561 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0562 Bstrerror(Berror));
0563 EXFAIL_OUT(ret);
0564 }
0565
0566 if (EXSUCCEED!=Bchg(p_ub, EX_CC_RESOURCE, 0, "test.ini", 0L))
0567 {
0568 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0569 Bstrerror(Berror));
0570 EXFAIL_OUT(ret);
0571 }
0572 if (EXSUCCEED!=Bchg(p_ub, EX_CC_MANDATORY, 0, "xstring_setting", 0L))
0573 {
0574 NDRX_LOG(log_error, "TESTERROR: buffer failed to setup: %s",
0575 Bstrerror(Berror));
0576 EXFAIL_OUT(ret);
0577 }
0578
0579
0580
0581 if (EXSUCCEED == tpcall("@CCONF", (char *)p_ub, 0L, (char **)&p_ub, &rsplen,0))
0582 {
0583 NDRX_LOG(log_error, "TESTERROR: @CCONF must not return [xapp]!", tpstrerror(tperrno));
0584 ndrx_debug_dump_UBF(log_debug, "CCONF error rsp", p_ub);
0585
0586 EXFAIL_OUT(ret);
0587 }
0588
0589
0590
0591
0592
0593 tpfree((char *)p_ub);
0594
0595 if (NULL==(p_ub= (UBFH *)tpalloc("UBF", NULL, 1024)))
0596 {
0597 NDRX_LOG(log_error, "TESTERROR: buffer alloc failed: %s", tpstrerror(tperrno));
0598 EXFAIL_OUT(ret);
0599 }
0600
0601 if (EXSUCCEED!=CBchg(p_ub, EX_CC_CMD, 0, "l", 0L, BFLD_STRING))
0602 {
0603 NDRX_LOG(log_error, "TESTERROR: Failed to set EX_CPMCOMMAND to l!");
0604 EXFAIL_OUT(ret);
0605 }
0606
0607
0608 if (EXSUCCEED!=CBchg(p_ub, EX_CC_SECTIONMASK, 0, "x", 0L, BFLD_STRING))
0609 {
0610 NDRX_LOG(log_error, "TESTERROR: Failed to set EX_CC_SECTIONMASK to l!");
0611 EXFAIL_OUT(ret);
0612 }
0613
0614 if (EXFAIL == (cd = tpconnect("@CCONF",
0615 (char *)p_ub,
0616 0,
0617 TPNOTRAN |
0618 TPRECVONLY)))
0619 {
0620 NDRX_LOG(log_error, "Connect error [%s]", tpstrerror(tperrno) );
0621
0622 ret = EXFAIL;
0623 goto out;
0624 }
0625 NDRX_LOG(log_debug, "Connected OK, cd = %d", cd );
0626
0627 while (recv_continue)
0628 {
0629 int tp_errno;
0630 recv_continue=0;
0631 if (EXFAIL == tprecv(cd,
0632 (char **)&p_ub,
0633 0L,
0634 0L,
0635 &revent))
0636 {
0637 ret = EXFAIL;
0638 tp_errno = tperrno;
0639 if (TPEEVENT == tp_errno)
0640 {
0641 if (TPEV_SVCSUCC == revent)
0642 ret = EXSUCCEED;
0643 else
0644 {
0645 NDRX_LOG(log_error,
0646 "Unexpected conv event %lx", revent );
0647 EXFAIL_OUT(ret);
0648 }
0649 }
0650 }
0651 else
0652 {
0653 recv_continue=1;
0654
0655
0656
0657
0658 if (CBfindocc (p_ub, EX_CC_KEY, "xstring_setting", 0, BFLD_STRING)>=0)
0659 {
0660 sections_got++;
0661 }
0662
0663 if (CBfindocc (p_ub, EX_CC_KEY, "hello", 0, BFLD_STRING)>=0)
0664 {
0665 sections_got++;
0666 }
0667
0668 sections_total++;
0669 }
0670 }
0671
0672 if (sections_got!=sections_total)
0673 {
0674 NDRX_LOG(log_error, "TESTERROR: Got sections does not match total: %d vs %d",
0675 sections_got, sections_total);
0676 EXFAIL_OUT(ret);
0677 }
0678
0679 if (EXSUCCEED!=tpterm())
0680 {
0681 NDRX_LOG(log_error, "tpterm failed with: %s", tpstrerror(tperrno));
0682 ret=EXFAIL;
0683 goto out;
0684 }
0685
0686 out:
0687 return ret;
0688 }
0689
0690