You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
625 B
C++
23 lines
625 B
C++
3 years ago
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||
|
|
||
|
#include <exiv2/error.hpp>
|
||
|
|
||
|
#include <gtest/gtest.h>
|
||
|
|
||
|
using namespace Exiv2;
|
||
|
|
||
|
TEST(Error, parameterInsertion)
|
||
|
{
|
||
|
const Error err_with_3_params(ErrorCode::kerGeneralError, "foo", "bar", "baz");
|
||
|
ASSERT_STREQ(err_with_3_params.what(), "Error 1: arg2=bar, arg3=baz, arg1=foo.");
|
||
|
|
||
|
const Error err_with_no_params(ErrorCode::kerSuccess);
|
||
|
ASSERT_STREQ(err_with_no_params.what(), "Success");
|
||
|
}
|
||
|
|
||
|
TEST(Error, tooManyParameters)
|
||
|
{
|
||
|
const Error err_with_no_params(ErrorCode::kerSuccess, "a param", "another param");
|
||
|
ASSERT_STREQ(err_with_no_params.what(), "Success");
|
||
|
}
|