Silence errors when assigning random values to test data
[gssweb.git] / json_gssapi / test / GSSGetMicTest.cpp
index 1273761..e0754c3 100644 (file)
@@ -31,10 +31,8 @@ mock_get_mic(
 {
   /* Error checking */
   /* Variables */
-  std::string buffer;
   
   /* Setup */
-  buffer = MockGetMic::outputToken.toString();
   
   /* Main */
   // Copy our input from the appropriate parameters to MockGetMic
@@ -45,8 +43,7 @@ mock_get_mic(
   
   // copy our output to the appropriate parameters
   *minor_status = MockGetMic::minor_status;
-  message_token->length = buffer.length();
-  message_token->value  = (void *)buffer.c_str();
+  *message_token = *MockGetMic::outputToken.toGss();
   
   /* Cleanup */
   /* return */
@@ -84,7 +81,7 @@ void GSSGetMicTest::testEmptyCall()
   GSSBuffer input((char *)"Input message");
   std::string out("Output Message");
   gss_qop_t desiredQop = rand();
-  gss_ctx_id_t desiredContext = (gss_ctx_id_t)rand();
+  gss_ctx_id_t desiredContext = (gss_ctx_id_t)( (long)0 | rand() );
   
   /* Error checking */
   /* Setup */
@@ -132,7 +129,8 @@ void GSSGetMicTest::testEmptyCall()
 void GSSGetMicTest::testConstructorWithJSONObject()
 {
   /* Variables */
-  GSSContext context((gss_ctx_id_t)rand(), true);
+  GSSContext context((gss_ctx_id_t)( (long)0 | rand() ),
+                    true);
   std::string key = GSSContextCache::instance()->store(context);
 
   std::string input = "{ \