Update of /cvsroot/sblim/sfcc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4694
Modified Files:
test.c
Log Message:
added test for invokemethod
Index: test.c
===================================================================
RCS file: /cvsroot/sblim/sfcc/test.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- test.c 20 Jun 2005 03:40:05 -0000 1.7
+++ test.c 20 Jun 2005 05:07:44 -0000 1.8
@@ -386,5 +386,28 @@
if (objectpath) CMRelease(objectpath);
}
+ if (1) {
+ /* Test invokeMethod() */
+ printf("\n----------------------------------------------------------\n");
+ printf("Testing invokeMethod() ...\n");
+ objectpath = newCMPIObjectPath("root/cimv2", "CWS_Authorization", NULL);
+ CMAddKey(objectpath, "Username", "bestorga", CMPI_chars);
+ CMAddKey(objectpath, "Classname", "CIM_OperatingSystem", CMPI_chars);
+ CMPIArgs * argsin = newCMPIArgs(NULL);
+ CMPIValue value;
+ value.string = newCMPIString("Query", NULL);
+ argsin->ft->addArg(argsin, "operation", &value, CMPI_string);
+ CMPIData data = cc->ft->invokeMethod(cc, objectpath, "IsAuthorized", argsin, NULL, &status);
+
+ /* Print the results */
+ printf("getProperty() rc=%d, msg=%s\n", status.rc, (status.msg)? (char *)status.msg->hdl : NULL);
+ if (!status.rc) {
+ printf("result(s):\n");
+ printf("PrimaryOwnerName=%s\n", (char*)(data.value.string)->hdl);
+ }
+ if (enumeration) CMRelease(enumeration);
+ if (objectpath) CMRelease(objectpath);
+ }
+
return 0;
}
|