1/*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include "TestOutput.h"
8
9#include <stdio.h>
10
11#include <util/AutoLock.h>
12
13
14// #pragma mark - TestOutput
15
16
17TestOutput::TestOutput()
18{
19}
20
21
22TestOutput::~TestOutput()
23{
24}
25
26
27// #pragma mark - DebugTestOutput
28
29
30DebugTestOutput::DebugTestOutput()
31{
32	B_INITIALIZE_SPINLOCK(&fLock);
33}
34
35
36DebugTestOutput::~DebugTestOutput()
37{
38}
39
40
41int
42DebugTestOutput::PrintArgs(const char* format, va_list args)
43{
44	InterruptsSpinLocker locker(fLock);
45
46	int bytes = vsnprintf(fBuffer, sizeof(fBuffer), format, args);
47	dprintf("%s", fBuffer);
48
49	return bytes;
50}
51