document RasterOp a little
[LibreOffice.git] / shell / qa / zip / testzipimpl.cxx
blobe39408f98496b101875f0c4a977cee02a837c8c0
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 "testzipimpl.hxx"
22 TestZipImpl::TestZipImpl(StreamInterface* stream)
23 : zipFile(ZipFile(stream))
24 , expectedContents()
26 expectedContents.push_back("mimetype");
27 expectedContents.push_back("Configurations2/statusbar/");
28 expectedContents.push_back("Configurations2/accelerator/current.xml");
29 expectedContents.push_back("Configurations2/floater/");
30 expectedContents.push_back("Configurations2/popupmenu/");
31 expectedContents.push_back("Configurations2/progressbar/");
32 expectedContents.push_back("Configurations2/toolpanel/");
33 expectedContents.push_back("Configurations2/menubar/");
34 expectedContents.push_back("Configurations2/toolbar/");
35 expectedContents.push_back("Configurations2/images/Bitmaps/");
36 expectedContents.push_back("content.xml");
37 expectedContents.push_back("manifest.rdf");
38 expectedContents.push_back("styles.xml");
39 expectedContents.push_back("meta.xml");
40 expectedContents.push_back("Thumbnails/thumbnail.png");
41 expectedContents.push_back("settings.xml");
42 expectedContents.push_back("META-INF/manifest.xml");
43 sort(expectedContents.begin(), expectedContents.end());
46 TestZipImpl::~TestZipImpl() {}
48 bool TestZipImpl::test_directory()
50 ZipFile::DirectoryPtr_t contents = zipFile.GetDirectory();
51 std::vector<std::string>& stringVector = *contents;
52 std::sort(stringVector.begin(), stringVector.end());
53 return expectedContents == stringVector;
56 bool TestZipImpl::test_hasContentCaseInSensitive() { return zipFile.HasContent("mimetype"); }
58 bool TestZipImpl::test_getContent()
60 ZipFile::ZipContentBuffer_t contentBuf;
61 zipFile.GetUncompressedContent("content.xml", contentBuf);
62 return !contentBuf.empty();
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */