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
0035 #include <stdio.h>
0036 #include <stdlib.h>
0037 #include <cgreen/cgreen.h>
0038 #include <ubf.h>
0039 #include <ndrstandard.h>
0040 #include <ndebug.h>
0041 #include <string.h>
0042 #include <ndebug.h>
0043 #include <exbase64.h>
0044 #include "test.fd.h"
0045 #include "ubfunit1.h"
0046 #include "xatmi.h"
0047
0048
0049
0050
0051 Ensure(test_nstd_tplogqinfo)
0052 {
0053 int ret;
0054
0055
0056
0057 assert_equal(tplogconfig(LOG_FACILITY_NDRX | LOG_FACILITY_UBF | LOG_FACILITY_TP,
0058 EXFAIL, "ndrx=5 ubf=4 tp=3 iflags=detailed", NULL, NULL), EXSUCCEED);
0059
0060
0061 ret = tplogqinfo(log_error, TPLOGQI_GET_NDRX);
0062
0063 NDRX_LOG(log_debug, "got ret=%d", ret);
0064
0065
0066
0067
0068
0069 assert_not_equal(ret, 0);
0070 assert_not_equal(ret, EXFAIL);
0071
0072 assert_equal(ret & LOG_FACILITY_MASK, LOG_FACILITY_NDRX);
0073 assert_equal(TPLOGQI_RET_DBGLEVGET(ret), log_debug);
0074 assert_equal(ret & TPLOGQI_RET_HAVDETAILED, 0);
0075
0076
0077
0078 ret = tplogqinfo(log_error, TPLOGQI_GET_TP | TPLOGQI_EVAL_DETAILED);
0079
0080 assert_not_equal(ret, 0);
0081 assert_not_equal(ret, EXFAIL);
0082
0083 assert_equal(ret & LOG_FACILITY_MASK, LOG_FACILITY_TP);
0084 assert_equal(TPLOGQI_RET_DBGLEVGET(ret), log_warn);
0085 assert_not_equal(ret & TPLOGQI_RET_HAVDETAILED, 0);
0086
0087
0088
0089
0090 ret = tplogqinfo(log_debug, TPLOGQI_GET_UBF | TPLOGQI_EVAL_DETAILED);
0091 assert_equal(ret, 0);
0092
0093
0094
0095 ret = tplogqinfo(log_debug, TPLOGQI_GET_UBF | TPLOGQI_EVAL_DETAILED | TPLOGQI_EVAL_RETURN);
0096 assert_not_equal(ret, 0);
0097 assert_not_equal(ret, EXFAIL);
0098
0099 assert_equal(ret & LOG_FACILITY_MASK, LOG_FACILITY_UBF);
0100 assert_equal(TPLOGQI_RET_DBGLEVGET(ret), log_info);
0101 assert_not_equal(ret & TPLOGQI_RET_HAVDETAILED, 0);
0102
0103
0104 ret = tplogqinfo(log_debug, 0);
0105 assert_equal(ret, EXFAIL);
0106 assert_equal(Nerror, NEINVAL);
0107
0108 }
0109
0110
0111
0112
0113
0114 TestSuite *ubf_nstd_debug(void)
0115 {
0116 TestSuite *suite = create_test_suite();
0117
0118 add_test(suite, test_nstd_tplogqinfo);
0119
0120 return suite;
0121 }
0122