Esempio n. 1
0
//Basic test for create/attach and exit.
int pc_library_mutatee()
{
   int result;
   void *handlea, *handleb;
   syncloc msg;
	//fprintf(stderr, "Entering pc_library_mutatee\n");
   result = initProcControlTest(threadFunc, NULL);
	//fprintf(stderr, "Done with init, pc_library_mutatee\n");
   if (result != 0) {
      output->log(STDERR, "Initialization failed\n");
      return -1;
   }

   //fprintf(stderr, "Opening libtestA pc_library_mutatee\n");
   handlea = openLib(LIBTESTA);
   //fprintf(stderr, "Opening libtestB pc_library_mutatee\n");
   handleb = openLib(LIBTESTB);
   //fprintf(stderr, "Closing libtestB\n");
   closeLib(LIBTESTB, handleb);
   //fprintf(stderr, "Closing libtestB\n");
   closeLib(LIBTESTA, handlea);

   msg.code = SYNCLOC_CODE;
   result = send_message((unsigned char *) &msg, sizeof(syncloc));
   if (result == -1) {
      output->log(STDERR, "Failed to send sync message\n");
      return -1;
   }

   result = recv_message((unsigned char *) &msg, sizeof(syncloc));
   if (result == -1) {
      output->log(STDERR, "Failed to recv sync message\n");
      return -1;
   }
   if (msg.code != SYNCLOC_CODE) {
      output->log(STDERR, "Recieved unexpected sync message\n");
      return -1;
   }

   result = finiProcControlTest(0);
   if (result != 0) {
      output->log(STDERR, "Finalization failed\n");
      return -1;
   }

   test_passes(testname);
   return 0;
}
Esempio n. 2
0
bool
SharedLib::openLib()
{
    return openLib(_filespec);
}