Updated documentation.
Added C++isms to fake library header files.
#ifndef WORKLOAD_LOGGING_CLIENT_CONSUMER_FAKE_H
#define WORKLOAD_LOGGING_CLIENT_CONSUMER_FAKE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "glite/lb/context-int.h"
typedef int (edg_wll_QueryEvents_cb_f)(edg_wll_Context context, edg_wll_Event **events);
void edg_wll_UnregisterTestQueryEvents();
void edg_wll_UnregisterTestQueryListener();
+#ifdef __cplusplus
+}
+#endif
+
#endif /* WORKLOAD_LOGGING_CLIENT_CONSUMER_FAKE_H */
#ifndef WORKLOAD_LOGGING_CLIENT_PRODUCER_FAKE_H
#define WORKLOAD_LOGGING_CLIENT_PRODUCER_FAKE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef int (edg_wll_Logging_cb_f)(edg_wll_Context context);
int edg_wll_RegisterTestLogging(edg_wll_Logging_cb_f *cb);
void edg_wll_UnregisterTestLogging();
void edg_wll_UnregisterTestLoggingProxy();
+#ifdef __cplusplus
+}
+#endif
+
#endif /* WORKLOAD_LOGGING_CLIENT_PRODUCER_FAKE_H */
THRPLUSLIB:=libglite_lb_clientpp_${thrflavour}.la
TOOLS:=dump load purge
-EXAMPLES:=log_usertag_proxy job_reg feed_shark notify query_ext query_seq_code
-FAKE_EXAMPLES:=job_log_fake job_reg_fake logevent_fake
-FAKE_EXAMPLES_SOURCES:=job_log.c job_reg.c
+EXAMPLES:=log_usertag_proxy job_log job_reg feed_shark notify query_ext query_seq_code
+FAKE_EXAMPLES:=job_log_fake
version_info=-version-info `echo ${version} | cut -d. -f1,2 | tr . :`
logevent: logevent.o args.o
${LINK} -o $@ logevent.o args.o ${LIB} ${EXT_LIB} ${GLOBUS_LIBS}
-logevent_fake: logevent_fake.o args.o
- ${LINK} -o $@ logevent_fake.o args.o ${FAKELIB} ${EXT_LIB} ${GLOBUS_LIBS}
-
${TOOLS} ${EXAMPLES}: %: %.o
${LINK} -o $@ $< ${LIB} ${EXT_LIB} ${GLOBUS_LIBS}
-${FAKE_EXAMPLES_SOURCES:.c=_fake}: %: %.o ${FAKELIB}
- ${LINK} -o $@ $< ${FAKELIB} ${EXT_LIB} ${GLOBUS_LIBS}
+${FAKE_EXAMPLES}: %: %.o ${FAKELIB}
+ ${LINK} -o $@ $< ${FAKELIB} ${TEST_LIBS} ${EXT_LIB} ${GLOBUS_LIBS}
${TOOLS}: ${LIB}
-${FAKE_EXAMPLES_SOURCES:.c=_fake.o}: %_fake.o: %.c
- ${COMPILE} ${GLOBUSINC} -DUSE_CALLBACKS -c $< -o $@
+${FAKE_EXAMPLES:=.o}: %.o: %.cpp
+ ${COMPILE} ${GLOBUSINC} ${TEST_INC} -c $< -o $@
${PLUSOBJS}: %.o: %.cpp
${CXXCOMPILE} ${GLOBUSINC} -c $<
make fake
-* TODO (MATOUCI): v examples/ musi byt jednak priklady, ktere se linkuji s normalni
-* knihovnou a funguji plnohodnotne dle ocekavani, a navic neco jako
-* fake_job_log, ktery bude prikladem unittestu (opravdu s pouzitim cppUnitu
-* atd.) nejake funkce z jinak opravdoveho job_log (asi bude treba ji
-* pro tyto ucely vytahnout z main()u).
-
-In the example examples/job_log.c is showed how to use callbacks and their
-registration. Examples examples/job_reg.c and src/logevent.c are original L&B
-examples which are just linked with the fake library too.
+An example of unit test using the fake library is the file
+examples/job_log_fake.cpp. There is showed how to use callbacks and their
+registration.
edg_wll_ResetError(context);
- // get asked event type or use _EVENT_CHKPT
+ // determine type of the returned events, ignore _QUERY_OP_*:
+ // - asked event type for _QUERY_ATTR_EVENT_TYPE
+ // - _EVENT_CHKPT for other
i = 0;
- while (event_conditions[i].attr != EDG_WLL_QUERY_ATTR_UNDEF && (event_conditions[i].attr != EDG_WLL_QUERY_ATTR_EVENT_TYPE || event_conditions[i].op != EDG_WLL_QUERY_OP_EQUAL)) i++;
+ while (event_conditions[i].attr != EDG_WLL_QUERY_ATTR_UNDEF && (event_conditions[i].attr != EDG_WLL_QUERY_ATTR_EVENT_TYPE)) i++;
if (event_conditions[i].attr == EDG_WLL_QUERY_ATTR_UNDEF)
event_code = EDG_WLL_EVENT_CHKPT;
else
if (job_conditions[i].attr == EDG_WLL_QUERY_ATTR_JOBID && job_conditions[i].op == EDG_WLL_QUERY_OP_EQUAL) {
jobid = job_conditions[i].value.j;
for (j = 0; j < NUM_EVENTS; j++) {
- if ((err = edg_wlc_JobIdDup(jobid, &(*events)[i].any.jobId)) != 0) goto error;
+ if ((err = edg_wlc_JobIdDup(jobid, &(*events)[i].any.jobId)) != 0) goto error;
}
break;
}