2010-11-20 17:36:14 +08:00
|
|
|
#include "fmt.h"
|
|
|
|
|
|
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
|
|
|
|
namespace aria2 {
|
|
|
|
|
2015-12-27 17:39:47 +08:00
|
|
|
class FmtTest : public CppUnit::TestFixture {
|
2010-11-20 17:36:14 +08:00
|
|
|
|
|
|
|
CPPUNIT_TEST_SUITE(FmtTest);
|
|
|
|
CPPUNIT_TEST(testFmt);
|
|
|
|
CPPUNIT_TEST_SUITE_END();
|
2015-12-27 17:39:47 +08:00
|
|
|
|
2010-11-20 17:36:14 +08:00
|
|
|
public:
|
|
|
|
void testFmt();
|
|
|
|
};
|
|
|
|
|
|
|
|
CPPUNIT_TEST_SUITE_REGISTRATION(FmtTest);
|
|
|
|
|
|
|
|
void FmtTest::testFmt()
|
|
|
|
{
|
|
|
|
int major = 1;
|
|
|
|
int minor = 0;
|
|
|
|
int release = 7;
|
|
|
|
CPPUNIT_ASSERT_EQUAL(std::string("aria2-1.0.7-beta"),
|
|
|
|
fmt("aria2-%d.%d.%d-%s", major, minor, release, "beta"));
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace aria2
|