Exemplo n.º 1
0
        virtual void OnTestPartResult(const testing::TestPartResult& testPartResult)
        {
            std::stringstream s;
            std::string filename = testPartResult.file_name() ? testPartResult.file_name() : "<unknown file>";
            int line_number = testPartResult.line_number();
            std::string summary = testPartResult.summary() ? testPartResult.summary() : "<no description of error>";
            s << "\tTest ["
                << (is_google_test ? (GoogleTestCase + "::") + GoogleTestName : std::string())
                << "] " << (testPartResult.failed() ? "FAILED" : "PASSED") << ":\n\t"
                << filename
                << "("
                << line_number
                << ")\n\t"
                << boost::replace_all_copy(summary, "\n", "\n\t")
                << std::endl;

            BOOST_CHECK_MESSAGE(false, s.str());
#if defined(UNICODE)
            std::string sstr = s.str();
            std::wstring ws(sstr.size(), L' ');
            ws.resize(mbstowcs(&ws[0], sstr.c_str(), sstr.size()));
            output_debug_string(ws.c_str());
#else
            output_debug_string(s.str().c_str());
#endif
        }
Exemplo n.º 2
0
NTSTATUS NTAPI NtRaiseException( PEXCEPTION_RECORD ExceptionRecord, PCONTEXT Context, BOOL SearchFrames )
{
	exception_stack_frame info;
	NTSTATUS r;

	r = copy_from_user( &info.rec, ExceptionRecord, sizeof info.rec );
	if (r < STATUS_SUCCESS)
		return r;

	r = copy_from_user( &info.ctx, Context, sizeof info.ctx );
	if (r < STATUS_SUCCESS)
		return r;

	// Get this when OutputDebugStringA is used
	if (info.rec.ExceptionCode == DBG_PRINTEXCEPTION_C)
	{
		output_debug_string( info.rec );
		thread_impl_t *thread = dynamic_cast<thread_impl_t*>( current );
		assert( thread );
		thread->set_context( info.ctx );
		return STATUS_SUCCESS;
	}

	// FIXME: perhaps we should blow away everything pushed on after the current frame

	thread_impl_t *thread = dynamic_cast<thread_impl_t*>( current );
	assert( thread );
	return thread->raise_exception( info, SearchFrames );
}
Exemplo n.º 3
0
        virtual void OnTestEnd(const ::testing::TestInfo& testInfo)
        {
            std::stringstream s;
            std::string name = testInfo.name() ? testInfo.name() : "<unknown>";
            s << "***Ending test [" << GoogleTestCase << ":" << GoogleTestName << "]" << std::endl;
            BOOST_TEST_CHECKPOINT(s.str());
#if defined(UNICODE)
            std::string sstr = s.str();
            std::wstring ws(sstr.size(), L' ');
            ws.resize(mbstowcs(&ws[0], sstr.c_str(), sstr.size()));
            output_debug_string(ws.c_str());
#else
            output_debug_string(s.str().c_str());
#endif
            is_google_test = false;
            GoogleTestCase = "";
            GoogleTestName = "";
        }
Exemplo n.º 4
0
void usb_message(char *format, ...)
{
  char tmp[512];
  va_list args;

  if(__usb_debug >= LIBUSB_DEBUG_MSG)
   {  
     va_start(args, format);
     _vsnprintf(tmp, sizeof(tmp) - 1, format, args);
     va_end(args);

     fprintf(stderr, "LIBUSB_DLL: info: %s\n", tmp);
     fflush(stderr);
     output_debug_string("LIBUSB_DLL: info: %s\n", tmp);
   }
}
Exemplo n.º 5
0
void usb_error(char *format, ...)
{
  va_list args;
  
  usb_error_type = USB_ERROR_TYPE_STRING;

  va_start(args, format);
  _vsnprintf(usb_error_str, sizeof(usb_error_str) - 1, format, args);
  va_end(args);

  if(__usb_debug >= LIBUSB_DEBUG_ERR)
    {
      fprintf(stderr, "LIBUSB_DLL: error: %s\n", usb_error_str);
      fflush(stderr);
      output_debug_string("LIBUSB_DLL: error: %s\n", usb_error_str);
    }
}
Exemplo n.º 6
0
static void memtrack_log(const char *fmt, ...)
{
    va_list list;

    va_start(list, fmt);

    switch (g_logging.type)
    {
    case -1:

        if (g_logging.func)
            g_logging.func(g_logging.userdata, fmt, list);

        break;
    case 0:

        if (g_logging.file)
        {
            vfprintf(g_logging.file, fmt, list);
            fflush(g_logging.file);
        }

        break;
#if defined(WIN32) && !defined(_WIN32_WCE)
    case 1:
    {
        char temp[1024];
        _vsnprintf(temp, sizeof(temp) / sizeof(char) - 1, fmt, list);
        output_debug_string(temp);
    }
    break;
#endif
    default:
        break;
    }

    va_end(list);
}
Exemplo n.º 7
0
void basic_debug_output_backend< CharT >::do_consume(record_type const& record, target_string_type const& formatted_message)
{
    output_debug_string(formatted_message.c_str());
}
void basic_debug_output_backend< CharT >::do_consume(values_view_type const& values, target_string_type const& formatted_message)
{
    output_debug_string(formatted_message.c_str());
}
Exemplo n.º 9
0
	int sync() {
		output_debug_string(str().c_str());
		str(std::basic_string<CharT>()); // Clear the string buffer
		return 0;
	}