Pandoc Debug Test

  
#include <cstring>
#include <memory>

#include "CppUTest/CommandLineTestRunner.h"
#include "CppUTest/TestHarness.h"

void test_failure(const char *pLocation, unsigned count, const char *pMsg) {
    const char *pFmtStr = "mock assertion failure! location: '%s',"
                          " iteration: %d, message: %s";
    size_t n = snprintf(NULL, 0, pFmtStr, pLocation, count, pMsg);
    std::unique_ptr<char []> outStrBuf(new char[n+1]);
    snprintf(outStrBuf.get(), n, pFmtStr, pLocation, count, pMsg);
    FAIL_TEST(outStrBuf.get());
}

int main(int argc, char **argv)
{
    return RUN_ALL_TESTS(argc, argv);
}