From: Gareth S B. <bes...@us...> - 2005-06-20 06:05:00
|
Update of /cvsroot/sblim/sfcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31923 Modified Files: test.c Log Message: added execquery test Index: test.c =================================================================== RCS file: /cvsroot/sblim/sfcc/test.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- test.c 20 Jun 2005 05:07:44 -0000 1.8 +++ test.c 20 Jun 2005 06:04:52 -0000 1.9 @@ -386,7 +386,7 @@ if (objectpath) CMRelease(objectpath); } - if (1) { + if (0) { /* Test invokeMethod() */ printf("\n----------------------------------------------------------\n"); printf("Testing invokeMethod() ...\n"); @@ -409,5 +409,26 @@ if (objectpath) CMRelease(objectpath); } + if (1) { + /* Test execQuery() */ + printf("\n----------------------------------------------------------\n"); + printf("Testing execQuery() ...\n"); + objectpath = newCMPIObjectPath("root/cimv2", "Linux_ComputerSystem", NULL); + char * query = "select * from Linux_ComputerSystem where PrimaryOwnerName=\"root\""; + enumeration = cc->ft->execQuery(cc, objectpath, query, "WQL", &status); + + /* Print the results */ + printf("enumInstanceNames() rc=%d, msg=%s\n", status.rc, (status.msg)? (char *)status.msg->hdl : NULL); + if (!status.rc) { + printf("result(s):\n"); + while (enumeration->ft->hasNext(enumeration, NULL)) { + CMPIData data = enumeration->ft->getNext(enumeration, NULL); + showObjectPath(data.value.ref); + } + } + if (enumeration) CMRelease(enumeration); + if (objectpath) CMRelease(objectpath); + } + return 0; } |