1f8e2c85aSAndrew Rist /************************************************************** 2*a6cd7a72Smseidel * 3f8e2c85aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4f8e2c85aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5f8e2c85aSAndrew Rist * distributed with this work for additional information 6f8e2c85aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7f8e2c85aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8f8e2c85aSAndrew Rist * "License"); you may not use this file except in compliance 9f8e2c85aSAndrew Rist * with the License. You may obtain a copy of the License at 10*a6cd7a72Smseidel * 11f8e2c85aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*a6cd7a72Smseidel * 13f8e2c85aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14f8e2c85aSAndrew Rist * software distributed under the License is distributed on an 15f8e2c85aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16f8e2c85aSAndrew Rist * KIND, either express or implied. See the License for the 17f8e2c85aSAndrew Rist * specific language governing permissions and limitations 18f8e2c85aSAndrew Rist * under the License. 19*a6cd7a72Smseidel * 20f8e2c85aSAndrew Rist *************************************************************/ 21f8e2c85aSAndrew Rist 22f8e2c85aSAndrew Rist 235448f169SMichael Stahl 245448f169SMichael Stahl // MARKER(update_precomp.py): autogen include statement, do not remove 255448f169SMichael Stahl #include "precompiled_shell.hxx" 26fb0f01d8SDamjan Jovanovic #include "gtest/gtest.h" 275448f169SMichael Stahl #include <string> 285448f169SMichael Stahl #include "testimpl/testzipimpl.hxx" 295448f169SMichael Stahl using namespace std; 305448f169SMichael Stahl 31fb0f01d8SDamjan Jovanovic class Test : public ::testing::Test 325448f169SMichael Stahl { 33fb0f01d8SDamjan Jovanovic protected: 345448f169SMichael Stahl string documentName; 355448f169SMichael Stahl public: 365448f169SMichael Stahl Test(); 37fb0f01d8SDamjan Jovanovic void SetUp() {} 38*a6cd7a72Smseidel void TearDown() {} 395448f169SMichael Stahl }; 405448f169SMichael Stahl 415448f169SMichael Stahl Test::Test() : 425448f169SMichael Stahl documentName("simpledocument.odt") 43*a6cd7a72Smseidel { 445448f169SMichael Stahl } 455448f169SMichael Stahl 465448f169SMichael Stahl //------------------------------------------------ 47fb0f01d8SDamjan Jovanovic TEST_F(Test, test_directory) 485448f169SMichael Stahl { 495448f169SMichael Stahl TestZipImpl testImpl(documentName.c_str()); 505448f169SMichael Stahl bool isPassed = testImpl.test_directory(); 51fb0f01d8SDamjan Jovanovic ASSERT_TRUE(isPassed) << "Content does not match with expected directory names."; 525448f169SMichael Stahl } 535448f169SMichael Stahl 545448f169SMichael Stahl //------------------------------------------------ 55fb0f01d8SDamjan Jovanovic TEST_F(Test, test_hasContentCaseInSensitive) 565448f169SMichael Stahl { 575448f169SMichael Stahl TestZipImpl testImpl(documentName.c_str()); 585448f169SMichael Stahl bool isPassed = testImpl.test_hasContentCaseInSensitive(); 59fb0f01d8SDamjan Jovanovic ASSERT_TRUE(isPassed) << "Content in zip file was not found."; 605448f169SMichael Stahl } 615448f169SMichael Stahl 625448f169SMichael Stahl //------------------------------------------------ 63fb0f01d8SDamjan Jovanovic TEST_F(Test, test_getContent) 645448f169SMichael Stahl { 655448f169SMichael Stahl TestZipImpl testImpl(documentName.c_str()); 665448f169SMichael Stahl bool isPassed = testImpl.test_getContent(); 67*a6cd7a72Smseidel ASSERT_TRUE(isPassed) << "Couldn't receive content buffer from zipfile."; 685448f169SMichael Stahl } 695448f169SMichael Stahl 70fb0f01d8SDamjan Jovanovic int main(int argc, char **argv) 71fb0f01d8SDamjan Jovanovic { 72*a6cd7a72Smseidel ::testing::InitGoogleTest(&argc, argv); 73*a6cd7a72Smseidel return RUN_ALL_TESTS(); 74fb0f01d8SDamjan Jovanovic } 75*a6cd7a72Smseidel 76*a6cd7a72Smseidel /* vim: set noet sw=4 ts=4: */ 77