1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "cppunit/TestAssert.h"
21 #include "cppunit/TestFixture.h"
22 #include "cppunit/extensions/HelperMacros.h"
23 #include "cppunit/plugin/TestPlugIn.h"
25 #include "testimpl/testzipimpl.hxx"
28 class Test
: public CppUnit::TestFixture
36 void test_directory();
37 void test_hasContentCaseInSensitive();
38 void test_getContent();
39 CPPUNIT_TEST_SUITE(Test
);
40 CPPUNIT_TEST(test_directory
);
41 CPPUNIT_TEST(test_hasContentCaseInSensitive
);
42 CPPUNIT_TEST(test_getContent
);
43 CPPUNIT_TEST_SUITE_END();
46 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
49 documentName("simpledocument.odt")
53 void Test::test_directory()
55 TestZipImpl
testImpl(documentName
.c_str());
56 bool isPassed
= testImpl
.test_directory();
57 CPPUNIT_ASSERT_MESSAGE("Content does not match with expected directory names.", isPassed
);
60 void Test::test_hasContentCaseInSensitive()
62 TestZipImpl
testImpl(documentName
.c_str());
63 bool isPassed
= testImpl
.test_hasContentCaseInSensitive();
64 CPPUNIT_ASSERT_MESSAGE("Content in zip file was not found.", isPassed
);
67 void Test::test_getContent()
69 TestZipImpl
testImpl(documentName
.c_str());
70 bool isPassed
= testImpl
.test_getContent();
71 CPPUNIT_ASSERT_MESSAGE("Couldn't receive content buffer form zipfile.", isPassed
);
74 CPPUNIT_PLUGIN_IMPLEMENT();
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */