Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Made the output of plain logger more readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkauppila committed Jul 5, 2011
1 parent 42c7976 commit 9e6d37f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions test/test-automation/plain_logger.c
Expand Up @@ -6,9 +6,11 @@

#include <SDL/SDL.h>

#include "logger_helpers.h"
#include "plain_logger.h"



static int indentLevel;

/*!
Expand Down Expand Up @@ -38,13 +40,15 @@ void
PlainRunStarted(int parameterCount, char *runnerParameters[], time_t eventTime,
void *data)
{
/*
Output("Test run started with following parameters\n");
Output(indentLevel, "Test run started at %s", TimestampToString(eventTime));
Output(indentLevel, "");
/*
Output(indentLevel, "Runner: ");
int counter = 0;
for(counter = 0; counter < parameterCount; counter++) {
char *parameter = runnerParameters[counter];
Output("\t%s", parameter);
Output(indentLevel, "\t%s", parameter);
}
*/
}
Expand All @@ -53,7 +57,7 @@ void
PlainRunEnded(int testCount, int suiteCount, int testPassCount, int testFailCount,
time_t endTime, double totalRuntime)
{
Output(indentLevel, "\nRan %d tests in %0.5f seconds from %d suites.",
Output(indentLevel, "Ran %d tests in %0.5f seconds from %d suites.",
testCount, totalRuntime, suiteCount);

Output(indentLevel, "%d tests passed", testPassCount);
Expand All @@ -78,7 +82,7 @@ PlainSuiteEnded(int testsPassed, int testsFailed, int testsSkipped,
void
PlainTestStarted(const char *testName, const char *suiteName, const char *testDescription, time_t startTime)
{
Output(indentLevel++, "%s (in %s) started", testName, suiteName);
Output(indentLevel++, "Executing test: %s (in %s)", testName, suiteName);
}

void
Expand Down Expand Up @@ -106,10 +110,11 @@ PlainAssert(const char *assertName, int assertResult, const char *assertMessage,

void
PlainAssertWithValues(const char *assertName, int assertResult, const char *assertMessage,
int actualValue, int excpected, time_t eventTime)
int actualValue, int expected, time_t eventTime)
{
const char *result = (assertResult) ? "passed" : "failed";
Output(indentLevel, "%s %d: %s", assertName, assertResult, assertMessage);
Output(indentLevel, "%s %d (expected %d, actualValue &d): %s",
assertName, assertResult, expected, actualValue, assertMessage);
}

void
Expand Down

0 comments on commit 9e6d37f

Please sign in to comment.