xref: /trunk/main/shell/qa/zip/ziptest.cxx (revision 6b7c93d1)
1f8e2c85aSAndrew Rist /**************************************************************
2*0ba0bc4aSmseidel  *
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*0ba0bc4aSmseidel  *
11f8e2c85aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*0ba0bc4aSmseidel  *
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*0ba0bc4aSmseidel  *
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*0ba0bc4aSmseidel 				void TearDown() {}
375448f169SMichael Stahl };
385448f169SMichael Stahl 
Test()395448f169SMichael Stahl Test::Test() :
405448f169SMichael Stahl 		documentName("simpledocument.odt")
41*0ba0bc4aSmseidel {
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*0ba0bc4aSmseidel 		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*0ba0bc4aSmseidel 	::testing::InitGoogleTest(&argc, argv);
71*0ba0bc4aSmseidel 	return RUN_ALL_TESTS();
72fb0f01d8SDamjan Jovanovic }
73*0ba0bc4aSmseidel 
74*0ba0bc4aSmseidel /* vim: set noet sw=4 ts=4: */
75