Silence errors when assigning random values to test data
[gssweb.git] / json_gssapi / test / GSSUnwrapTest.cpp
index de0d9a1..4fd60ad 100644 (file)
@@ -35,10 +35,8 @@ mock_unwrap(
 {
   /* Error checking */
   /* Variables */
-  std::string buffer;
   
   /* Setup */
-  buffer = MockUnwrap::outputMessageBuffer.toString();
   
   /* Main */
   // Copy our input from the appropriate parameters to MockUnwrap
@@ -50,8 +48,7 @@ mock_unwrap(
   *minor_status = MockUnwrap::minor_status;
   *conf_state = MockUnwrap::conf_state;
   *qop_state = MockUnwrap::qop_state;
-  output_message_buffer->length = buffer.length();
-  output_message_buffer->value  = (void *)buffer.c_str();
+  *output_message_buffer = *MockUnwrap::outputMessageBuffer.toGss();
   
   /* Cleanup */
   /* return */
@@ -87,7 +84,7 @@ void GSSUnwrapTest::testEmptyCall()
   /* Variables */
   GSSUnwrap cmd = GSSUnwrap(&mock_unwrap);
   GSSBuffer input((char *)"Input message");
-  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 */
@@ -143,7 +140,8 @@ void GSSUnwrapTest::testEmptyCall()
 void GSSUnwrapTest::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 = "{ \
          \"context_handle\": \"" + key + "\", \