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
225448f169SMichael Stahl // MARKER(update_precomp.py): autogen include statement, do not remove
235448f169SMichael Stahl #include "precompiled_shell.hxx"
24fb0f01d8SDamjan Jovanovic #include "gtest/gtest.h"
255448f169SMichael Stahl #include <string>
265448f169SMichael Stahl #include "testimpl/testzipimpl.hxx"
275448f169SMichael Stahl using namespace std;
285448f169SMichael Stahl
29fb0f01d8SDamjan Jovanovic class Test : public ::testing::Test
305448f169SMichael Stahl {
31fb0f01d8SDamjan Jovanovic protected:
325448f169SMichael Stahl string documentName;
335448f169SMichael Stahl public:
345448f169SMichael Stahl Test();
SetUp()35fb0f01d8SDamjan Jovanovic void SetUp() {}
TearDown()36*a6cd7a72Smseidel void TearDown() {}
375448f169SMichael Stahl };
385448f169SMichael Stahl
Test()395448f169SMichael Stahl Test::Test() :
405448f169SMichael Stahl documentName("simpledocument.odt")
41*a6cd7a72Smseidel {
425448f169SMichael Stahl }
435448f169SMichael Stahl
445448f169SMichael Stahl //------------------------------------------------
TEST_F(Test,test_directory)45fb0f01d8SDamjan Jovanovic TEST_F(Test, test_directory)
465448f169SMichael Stahl {
475448f169SMichael Stahl TestZipImpl testImpl(documentName.c_str());
485448f169SMichael Stahl bool isPassed = testImpl.test_directory();
49fb0f01d8SDamjan Jovanovic ASSERT_TRUE(isPassed) << "Content does not match with expected directory names.";
505448f169SMichael Stahl }
515448f169SMichael Stahl
525448f169SMichael Stahl //------------------------------------------------
TEST_F(Test,test_hasContentCaseInSensitive)53fb0f01d8SDamjan Jovanovic TEST_F(Test, test_hasContentCaseInSensitive)
545448f169SMichael Stahl {
555448f169SMichael Stahl TestZipImpl testImpl(documentName.c_str());
565448f169SMichael Stahl bool isPassed = testImpl.test_hasContentCaseInSensitive();
57fb0f01d8SDamjan Jovanovic ASSERT_TRUE(isPassed) << "Content in zip file was not found.";
585448f169SMichael Stahl }
595448f169SMichael Stahl
605448f169SMichael Stahl //------------------------------------------------
TEST_F(Test,test_getContent)61fb0f01d8SDamjan Jovanovic TEST_F(Test, test_getContent)
625448f169SMichael Stahl {
635448f169SMichael Stahl TestZipImpl testImpl(documentName.c_str());
645448f169SMichael Stahl bool isPassed = testImpl.test_getContent();
65*a6cd7a72Smseidel ASSERT_TRUE(isPassed) << "Couldn't receive content buffer from zipfile.";
665448f169SMichael Stahl }
675448f169SMichael Stahl
main(int argc,char ** argv)68fb0f01d8SDamjan Jovanovic int main(int argc, char **argv)
69fb0f01d8SDamjan Jovanovic {
70*a6cd7a72Smseidel ::testing::InitGoogleTest(&argc, argv);
71*a6cd7a72Smseidel return RUN_ALL_TESTS();
72fb0f01d8SDamjan Jovanovic }
73*a6cd7a72Smseidel
74*a6cd7a72Smseidel /* vim: set noet sw=4 ts=4: */
75