bump product version to 4.1.6.2
[LibreOffice.git] / shell / qa / zip / testimpl / testzipimpl.cxx
blob9aaa9db92d6b27f77426dfb25d67e9f956de5711
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 #define DLLIMPLEMENTATION
21 #include "testzipimpl.hxx"
23 vector<string> expectedContents;
25 TestZipImpl::TestZipImpl(const char * documentName) :
26 zipFile(ZipFile(string(documentName)))
28 expectedContents.push_back("mimetype");
29 expectedContents.push_back("Configurations2/statusbar/");
30 expectedContents.push_back("Configurations2/accelerator/current.xml");
31 expectedContents.push_back("Configurations2/floater/");
32 expectedContents.push_back("Configurations2/popupmenu/");
33 expectedContents.push_back("Configurations2/progressbar/");
34 expectedContents.push_back("Configurations2/toolpanel/");
35 expectedContents.push_back("Configurations2/menubar/");
36 expectedContents.push_back("Configurations2/toolbar/");
37 expectedContents.push_back("Configurations2/images/Bitmaps/");
38 expectedContents.push_back("content.xml");
39 expectedContents.push_back("manifest.rdf");
40 expectedContents.push_back("styles.xml");
41 expectedContents.push_back("meta.xml");
42 expectedContents.push_back("Thumbnails/thumbnail.png");
43 expectedContents.push_back("settings.xml");
44 expectedContents.push_back("META-INF/manifest.xml");
45 sort(expectedContents.begin(), expectedContents.end());
48 TestZipImpl::~TestZipImpl()
52 bool TestZipImpl::test_directory()
54 ZipFile::DirectoryPtr_t contents = zipFile.GetDirectory();
55 vector<string> &stringVector = *contents.get();
56 sort(stringVector.begin(), stringVector.end());
57 return expectedContents == stringVector;
60 bool TestZipImpl::test_hasContentCaseInSensitive()
62 return zipFile.HasContent("mimetype");
65 bool TestZipImpl::test_getContent()
67 ZipFile::ZipContentBuffer_t contentBuf;
68 zipFile.GetUncompressedContent("content.xml", contentBuf);
69 return !contentBuf.empty();
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */