2012-08-15 07:16:52 +00:00
|
|
|
/*
|
|
|
|
mkvmerge -- utility for splicing together matroska files
|
|
|
|
from component media subtypes
|
|
|
|
|
|
|
|
Distributed under the GPL
|
|
|
|
see the file COPYING for details
|
|
|
|
or visit http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
|
|
|
helper functions for unit tests
|
|
|
|
|
|
|
|
Written by Moritz Bunkus <moritz@bunkus.org>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common/common_pch.h"
|
|
|
|
|
|
|
|
#include "tests/unit/init.h"
|
|
|
|
|
2012-08-26 19:33:50 +00:00
|
|
|
#include "common/hacks.h"
|
|
|
|
#include "common/unique_numbers.h"
|
2012-08-15 07:16:52 +00:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
void
|
|
|
|
mxmsg_handler(unsigned int level,
|
|
|
|
std::string const &message) {
|
|
|
|
if (MXMSG_WARNING == level)
|
|
|
|
g_warning_issued = true;
|
|
|
|
|
|
|
|
else if (MXMSG_ERROR == level)
|
|
|
|
throw mtxut::mxerror_x{message};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-04-19 20:38:51 +00:00
|
|
|
mtxut::init_suite(char const *argv0) {
|
2012-08-15 07:16:52 +00:00
|
|
|
clear_list_of_unique_numbers(UNIQUE_ALL_IDS);
|
2014-04-19 20:38:51 +00:00
|
|
|
mtx_common_init("UNITTESTS", argv0);
|
2012-08-15 07:16:52 +00:00
|
|
|
|
|
|
|
set_mxmsg_handler(MXMSG_INFO, mxmsg_handler);
|
|
|
|
set_mxmsg_handler(MXMSG_WARNING, mxmsg_handler);
|
|
|
|
set_mxmsg_handler(MXMSG_ERROR, mxmsg_handler);
|
2012-08-26 19:33:50 +00:00
|
|
|
|
|
|
|
engage_hack(ENGAGE_NO_VARIABLE_DATA);
|
2012-08-15 07:16:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
mtxut::init_case() {
|
|
|
|
clear_list_of_unique_numbers(UNIQUE_ALL_IDS);
|
|
|
|
g_warning_issued = false;
|
|
|
|
}
|