testzipimpl.cxx (f8e2c85a) | testzipimpl.cxx (6b7c93d1) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 2 * |
3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at | 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 | 20 *************************************************************/ 21 |
22 23 | |
24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_shell.hxx" 26 27#define DLLIMPLEMENTATION 28#include "testzipimpl.hxx" 29 | 22// MARKER(update_precomp.py): autogen include statement, do not remove 23#include "precompiled_shell.hxx" 24 25#define DLLIMPLEMENTATION 26#include "testzipimpl.hxx" 27 |
30vector<string> expectedContents; | 28vector<string> expectedContents; |
31 32TestZipImpl::TestZipImpl(const char * documentName) : 33 zipFile(ZipFile(string(documentName))) 34{ 35 expectedContents.push_back("mimetype"); 36 expectedContents.push_back("Configurations2/statusbar/"); 37 expectedContents.push_back("Configurations2/accelerator/current.xml"); 38 expectedContents.push_back("Configurations2/floater/"); --- 8 unchanged lines hidden (view full) --- 47 expectedContents.push_back("styles.xml"); 48 expectedContents.push_back("meta.xml"); 49 expectedContents.push_back("Thumbnails/thumbnail.png"); 50 expectedContents.push_back("settings.xml"); 51 expectedContents.push_back("META-INF/manifest.xml"); 52 sort(expectedContents.begin(), expectedContents.end()); 53} 54 | 29 30TestZipImpl::TestZipImpl(const char * documentName) : 31 zipFile(ZipFile(string(documentName))) 32{ 33 expectedContents.push_back("mimetype"); 34 expectedContents.push_back("Configurations2/statusbar/"); 35 expectedContents.push_back("Configurations2/accelerator/current.xml"); 36 expectedContents.push_back("Configurations2/floater/"); --- 8 unchanged lines hidden (view full) --- 45 expectedContents.push_back("styles.xml"); 46 expectedContents.push_back("meta.xml"); 47 expectedContents.push_back("Thumbnails/thumbnail.png"); 48 expectedContents.push_back("settings.xml"); 49 expectedContents.push_back("META-INF/manifest.xml"); 50 sort(expectedContents.begin(), expectedContents.end()); 51} 52 |
55TestZipImpl::~TestZipImpl() 56{ | 53TestZipImpl::~TestZipImpl() 54{ |
57} 58 | 55} 56 |
59 | |
60//------------------------------------------------ 61bool TestZipImpl::test_directory() 62{ 63 ZipFile::DirectoryPtr_t contents = zipFile.GetDirectory(); 64 vector<string> &stringVector = *contents.get(); 65 sort(stringVector.begin(), stringVector.end()); 66 return expectedContents == expectedContents; 67} --- 7 unchanged lines hidden (view full) --- 75//------------------------------------------------ 76bool TestZipImpl::test_getContent() 77{ 78 ZipFile::ZipContentBuffer_t contentBuf; 79 zipFile.GetUncompressedContent("content.xml", contentBuf); 80 return !contentBuf.empty(); 81} 82 | 57//------------------------------------------------ 58bool TestZipImpl::test_directory() 59{ 60 ZipFile::DirectoryPtr_t contents = zipFile.GetDirectory(); 61 vector<string> &stringVector = *contents.get(); 62 sort(stringVector.begin(), stringVector.end()); 63 return expectedContents == expectedContents; 64} --- 7 unchanged lines hidden (view full) --- 72//------------------------------------------------ 73bool TestZipImpl::test_getContent() 74{ 75 ZipFile::ZipContentBuffer_t contentBuf; 76 zipFile.GetUncompressedContent("content.xml", contentBuf); 77 return !contentBuf.empty(); 78} 79 |
80/* vim: set noet sw=4 ts=4: */ |
|