Specified initial value of operator names enum (EDG_WLL_QUERY_OP__LAST is number...
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 6 Aug 2012 14:55:36 +0000 (14:55 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 6 Aug 2012 14:55:36 +0000 (14:55 +0000)
org.glite.lb.common/Makefile
org.glite.lb.common/interface/query_rec.h
org.glite.lb.common/src/query_rec.c

index 6d29e19..8c9cfca 100644 (file)
@@ -194,7 +194,7 @@ endif
 stage: compile
        $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
 
-check: compile mkreports check.parse check.il
+check: compile mkreports check.parse check.il check.query_rec
 
 mkreports:
        -mkdir -p ${REPORTS}
@@ -211,6 +211,12 @@ check.il: il_test
 il_test: il_test.o il_int_test.o il_string_test.o il_msg_test.o
        ${LINKXX} -o $@ $+ ${default_commonlib} ${CPPUNIT_LIBS} ${EXT_LIBS}
 
+check.query_rec: test_query_rec
+       ./test_query_rec
+
+test_query_rec: test_query_rec.o
+       ${LINK} $< -o $@ ${JOBID_LIB}
+
 test_coverage:
        -mkdir coverage
        cd coverage && $(MAKE) -f ../Makefile top_srcdir=../../ COVERAGE_FLAGS="-fprofile-arcs -ftest-coverage" check
@@ -251,13 +257,16 @@ install:
        ${STAGE_PERFTEST} ;
 
 clean:
-       rm -rvf *.o *.lo .libs lib* *.c *.h *.dox C/ CPP/ test_parse il_test parse.cpp events.tex status.tex
+       rm -rvf *.o *.lo .libs lib* *.c *.h *.dox C/ CPP/ test_parse il_test parse.cpp events.tex status.tex test_query_rec
        rm -rvf ${REPORTS}
        rm -rvf dist ${package}-*.tar.gz
 
 distclean:
        rm -rvf Makefile.inc *.spec debian/
 
+test_query_rec.o: query_rec.c
+       ${COMPILE} ${CFLAGS} -DGLITE_LB_QUERY_REC_TEST -c $< -o $@
+
 %.o: %.c
        ${COMPILE} ${CFLAGS} -c $<
 
index 4bb1144..a7c78f3 100644 (file)
@@ -92,7 +92,7 @@ extern char     *edg_wll_QueryOpNames[];
  * Predefined types for query operands
  */
 typedef enum _edg_wll_QueryOp{
-       EDG_WLL_QUERY_OP_EQUAL,         /**< attribute is equal to the operand value \see _edg_wll_QueryRec */
+       EDG_WLL_QUERY_OP_EQUAL=0,               /**< attribute is equal to the operand value \see _edg_wll_QueryRec */
        EDG_WLL_QUERY_OP_LESS,          /**< attribute is grater than the operand value \see _edg_wll_QueryRec */
        EDG_WLL_QUERY_OP_GREATER,       /**< attribute is less than the operand value \see _edg_wll_QueryRec */
        EDG_WLL_QUERY_OP_WITHIN,        /**< attribute is in given interval \see _edg_wll_QueryRec */
index f2aeb8e..224ebfb 100644 (file)
@@ -21,7 +21,9 @@ limitations under the License.
 #include <stdlib.h>
 #include <errno.h>
 #include <stdio.h>
+#ifdef GLITE_LB_QUERY_REC_TEST
 #include <assert.h>
+#endif
 
 #include "glite/jobid/cjobid.h"
 #include "query_rec.h"
@@ -84,3 +86,12 @@ void edg_wll_QueryRecFree(edg_wll_QueryRec *prec)
        }
 }
 
+
+#ifdef GLITE_LB_QUERY_REC_TEST
+int main() {
+       assert(sizeof(edg_wll_QueryAttrNames) / sizeof(edg_wll_QueryAttrNames[0]) == EDG_WLL_QUERY_ATTR__LAST);
+       assert(sizeof(edg_wll_QueryOpNames) / sizeof(edg_wll_QueryOpNames[0]) == EDG_WLL_QUERY_OP__LAST);
+
+       return 0;
+}
+#endif