1 /**************************************************************
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
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 *
20 *************************************************************/
21
22 // MARKER(update_precomp.py): autogen include statement, do not remove
23 #include "precompiled_shell.hxx"
24 #include "gtest/gtest.h"
25 #include <string>
26 #include "testimpl/testzipimpl.hxx"
27 using namespace std;
28
29 class Test : public ::testing::Test
30 {
31 protected:
32 string documentName;
33 public:
34 Test();
SetUp()35 void SetUp() {}
TearDown()36 void TearDown() {}
37 };
38
Test()39 Test::Test() :
40 documentName("simpledocument.odt")
41 {
42 }
43
44 //------------------------------------------------
TEST_F(Test,test_directory)45 TEST_F(Test, test_directory)
46 {
47 TestZipImpl testImpl(documentName.c_str());
48 bool isPassed = testImpl.test_directory();
49 ASSERT_TRUE(isPassed) << "Content does not match with expected directory names.";
50 }
51
52 //------------------------------------------------
TEST_F(Test,test_hasContentCaseInSensitive)53 TEST_F(Test, test_hasContentCaseInSensitive)
54 {
55 TestZipImpl testImpl(documentName.c_str());
56 bool isPassed = testImpl.test_hasContentCaseInSensitive();
57 ASSERT_TRUE(isPassed) << "Content in zip file was not found.";
58 }
59
60 //------------------------------------------------
TEST_F(Test,test_getContent)61 TEST_F(Test, test_getContent)
62 {
63 TestZipImpl testImpl(documentName.c_str());
64 bool isPassed = testImpl.test_getContent();
65 ASSERT_TRUE(isPassed) << "Couldn't receive content buffer from zipfile.";
66 }
67
main(int argc,char ** argv)68 int main(int argc, char **argv)
69 {
70 ::testing::InitGoogleTest(&argc, argv);
71 return RUN_ALL_TESTS();
72 }
73
74 /* vim: set noet sw=4 ts=4: */
75