aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Gómez <magomez@igalia.com>2010-12-02 15:40:19 +0100
committerAdrian Yanes <ext-adrian.yanes@nokia.com>2010-12-03 17:08:59 +0000
commit5ddd4ab503e3dc3e9576487aacea1659256886e5 (patch)
treea5c030e31b06087515805dbf97c4ba1b2b2ad903
parentbde96d358a9edd5969781770e44f20be3693468a (diff)
Added test case for MStyleSheetParser::setBinaryFileDirectory()
-rw-r--r--tests/ft_mstylesheetparser/ft_mstylesheetparser.cpp20
-rw-r--r--tests/ft_mstylesheetparser/ft_mstylesheetparser.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/ft_mstylesheetparser/ft_mstylesheetparser.cpp b/tests/ft_mstylesheetparser/ft_mstylesheetparser.cpp
index cfc5faec..d7d555d5 100644
--- a/tests/ft_mstylesheetparser/ft_mstylesheetparser.cpp
+++ b/tests/ft_mstylesheetparser/ft_mstylesheetparser.cpp
@@ -723,4 +723,24 @@ void Ft_MStyleSheetParser::test_binary_speed()
qDebug() << "Total reading time:" << TOTAL_TIME << "microseconds (" << TOTAL_TIME / 1000000.0 << "seconds)";
}
+void Ft_MStyleSheetParser::test_set_binary_file_directory()
+{
+ MStyleSheetParser parser;
+ QString binaryPath = qApp->applicationDirPath();
+ QString cssPath = qApp->applicationDirPath() + QDir::separator() + "ft_mstylesheetparser_test.css";
+
+ parser.setBinaryFileGenerationEnabled(true);
+ parser.setBinaryFileDirectory(binaryPath);
+ parser.load(cssPath);
+
+ QString binaryFilename = cssPath;
+ binaryFilename.replace(QLatin1Char('_'), "__");
+ binaryFilename.replace(QLatin1Char('/'), "_.");
+
+ /* Check that binary file was created in the right dir */
+ QVERIFY(QFile::exists(binaryPath + QDir::separator() + binaryFilename));
+
+ /* remove the created file */
+ QFile::remove(binaryPath + QDir::separator() + binaryFilename);
+}
QTEST_APPLESS_MAIN(Ft_MStyleSheetParser)
diff --git a/tests/ft_mstylesheetparser/ft_mstylesheetparser.h b/tests/ft_mstylesheetparser/ft_mstylesheetparser.h
index f85b964e..4685d9f8 100644
--- a/tests/ft_mstylesheetparser/ft_mstylesheetparser.h
+++ b/tests/ft_mstylesheetparser/ft_mstylesheetparser.h
@@ -47,6 +47,7 @@ private slots:
void test_binary_equality();
void test_parser_speed();
void test_binary_speed();
+ void test_set_binary_file_directory();
/*void test_inheritance();
void test_objectnames();