bump product version to 4.1.6.2
[LibreOffice.git] / shell / qa / zip / ziptest.cxx
blobbea0458e122209717951d2d24a076880cb253ad6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
24 #include <string>
25 #include "testimpl/testzipimpl.hxx"
26 using namespace std;
28 class Test : public CppUnit::TestFixture
30 private:
31 string documentName;
32 public:
33 Test();
34 void setUp() {}
35 void tearDown() {}
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);
48 Test::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: */