├── .gitignore ├── .gitmodules ├── .travis.yml ├── BuildInstructions.md ├── CONTRIBUTING.md ├── ICE_LICENSE ├── LICENSE ├── Makefile ├── README.md ├── allTests.py ├── config ├── MacOSX-SDKSettings.plist ├── Make.rules ├── iPhoneOS-SDKSettings.plist └── iPhoneSimulator-SDKSettings.plist ├── src ├── Makefile ├── cpp │ ├── Glacier2 │ │ └── Makefile │ ├── Ice │ │ ├── Makefile │ │ ├── Notifications.mm │ │ ├── RegisterPluginsInit.cpp │ │ ├── StreamAcceptor.cpp │ │ ├── StreamAcceptor.h │ │ ├── StreamConnector.cpp │ │ ├── StreamConnector.h │ │ ├── StreamEndpointI.cpp │ │ ├── StreamEndpointI.h │ │ ├── StreamTransceiver.cpp │ │ └── StreamTransceiver.h │ ├── IceGrid │ │ └── Makefile │ ├── IceStorm │ │ └── Makefile │ └── Makefile ├── objective-c │ ├── Glacier2 │ │ └── Makefile │ ├── Ice │ │ └── Makefile │ ├── IceGrid │ │ └── Makefile │ ├── IceStorm │ │ └── Makefile │ └── Makefile └── translators │ └── Makefile └── test ├── Makefile ├── cpp ├── Makefile └── iPhone │ └── container │ ├── .gitignore │ ├── BundleInfo.plist │ ├── Classes │ ├── AppDelegate.h │ ├── AppDelegate.mm │ ├── TestSelectController.h │ ├── TestSelectController.m │ ├── TestUtil.h │ ├── TestUtil.mm │ ├── TestViewController.h │ └── TestViewController.mm │ ├── Default-568h@2x.png │ ├── Ice Touch C++ Test Suite-Info.plist │ ├── Ice Touch C++ Test Suite.xcodeproj │ └── project.pbxproj │ ├── Ice Touch C++ Test Suite_Prefix.pch │ ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── New icon-60@3x.png │ │ ├── test_suite-76.png │ │ ├── test_suite-76@2x.png │ │ ├── test_suite-83@2x.png │ │ ├── test_suite-Small-40.png │ │ ├── test_suite-Small-40@2x-1.png │ │ ├── test_suite-Small-40@2x-2.png │ │ ├── test_suite-Small-40@3x-1.png │ │ ├── test_suite-Small-40@3x.png │ │ ├── test_suite-Small.png │ │ ├── test_suite-Small@2x-1.png │ │ ├── test_suite-Small@2x-2.png │ │ └── test_suite-Small@3x.png │ ├── MainWindow-iPad.xib │ ├── MainWindow.xib │ ├── README.md │ ├── TestSelect-iPad.xib │ ├── TestSelect.xib │ ├── TestView-iPad.xib │ ├── TestView.xib │ ├── dummy.ice │ └── main.m └── objective-c ├── Makefile └── iPhone └── container ├── .gitignore ├── Classes ├── AppDelegate.h ├── AppDelegate.m ├── Test.h ├── Test.m ├── TestSelectController.h ├── TestSelectController.m ├── TestViewController.h └── TestViewController.m ├── Default-568h@2x.png ├── Ice Touch Objective-C Test Suite.xcodeproj └── project.pbxproj ├── Ice Touch Objective-C Test Suite_Prefix.pch ├── Images.xcassets └── AppIcon.appiconset │ ├── Contents.json │ ├── New icon-60@3x.png │ ├── test_suite-76.png │ ├── test_suite-76@2x.png │ ├── test_suite-83@2x.png │ ├── test_suite-Small-40.png │ ├── test_suite-Small-40@2x-1.png │ ├── test_suite-Small-40@2x-2.png │ ├── test_suite-Small-40@3x-1.png │ ├── test_suite-Small-40@3x.png │ ├── test_suite-Small.png │ ├── test_suite-Small@2x-1.png │ ├── test_suite-Small@2x-2.png │ └── test_suite-Small@3x.png ├── Info-ARC.plist ├── Info.plist ├── MainWindow-iPad.xib ├── MainWindow.xib ├── TestSelect-iPad.xib ├── TestSelect.xib ├── TestView-iPad.xib ├── TestView.xib └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore objects and archives. 2 | *.[oa] 3 | *.dylib 4 | *.pyc 5 | .gdb_history 6 | .DS_Store 7 | *# 8 | .#* 9 | *~ 10 | .metadata 11 | # VIM swap file 12 | *.swp 13 | 14 | # OS X Keychain 15 | *.keychain 16 | .fl???????? 17 | 18 | .depend 19 | 20 | project.xcworkspace 21 | xcuserdata 22 | xcshareddata 23 | SDKs 24 | macosx 25 | iphoneos 26 | iphonesimulator 27 | test/cpp/Ice 28 | test/objective-c/Common 29 | test/objective-c/Ice 30 | bin 31 | lib 32 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ice"] 2 | path = ice 3 | url = https://github.com/zeroc-ice/ice.git 4 | branch = 3.6 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | env: 3 | - BUILD_TARGET=OSX 4 | - BUILD_TARGET=IPHONE 5 | - BUILD_TARGET=IPHONE_SIMULATOR 6 | git: 7 | submodules: false 8 | before_install: 9 | - echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc 10 | - git submodule update --init --recursive 11 | install: 12 | - brew install mcpp 13 | before_script: 14 | - export COMPILE_FOR_${BUILD_TARGET}=yes 15 | script: 16 | - make -j3 17 | - make test 18 | notifications: 19 | slack: 20 | secure: gyjuHfic3SE+/0rJyXkRC0/KCFv37sj65XHnRLxAHG0oF7enY7OFxipJC7LPqzSp4HLRsSfHBKfSEcSKABcsFhhtunKfhB3aDAMwPf2Mg7XjDPqUEhfilf46Uayqn7KzHsqd9HrKayay+SKC0QE82yNeiDMLyVEF2td75zRyC8e+DbYvmEFDUcPgF6Rre2mIZRmm9j8y0kQFSb6EMp9NYDqssWfLlc4MQB9dc1KRVUoOjVfr7w6Il6h0AxBqlpIIeqdipYDwewA9oUWV9yH23SUtex+dLowAQLDjBr7Bf6cqgwuS4G4NI9eYqDIeYWkQN/8XFNP8NDLmd0jdKfPi+kzFxukKcBYO1syc6WuswQAkUDKu91A3ko9B9QlH/ePWoEdj8pIWxEaKo3vKU/mbHnT3HtBayEBu+cPFA8DcFAmPNeieQScrOBXek/A4Rqkq5ItUoCAoysQO66SwFRBUnfoLs1+fC5ek5a1gLBoeBafv2EJtfmnLqw9UFALdNmPoOWfuVvAsR/uoddw/hUXxoSe3STvSKdvkYjXIx/gKdfJUnzldN+jVN1/HU+ZxDZExaaqA79LnAWus3yc0x7jmZgmEzV9Zkba56nn2QqBhD+387wM3zg6taKt2Sk0A8kIBKzZ3L6D4pVHmSsctsBsQE+wpdKOQkpumOmCA8/Uktz4= 21 | -------------------------------------------------------------------------------- /BuildInstructions.md: -------------------------------------------------------------------------------- 1 | # Building Ice Touch on macOS 2 | 3 | This page describes the Ice Touch source distribution, including information 4 | about compiler requirements, third-party dependencies, and instructions for 5 | building and testing the distribution. If you prefer, you can install a 6 | [Homebrew][1] package instead. 7 | 8 | ## Build Requirements 9 | 10 | ### Operating Systems and Compilers 11 | 12 | Ice Touch is supported on macOS, and was extensively tested using the operating 13 | system and compiler versions listed for our [supported platforms][2]. 14 | 15 | ### Third-Party Libraries 16 | 17 | Ice Touch depends on [mcpp][3] 2.7.2 (with patches). We recommend you install 18 | mcpp with [Homebrew][4]: 19 | ``` 20 | brew install mcpp 21 | ``` 22 | 23 | ### Ice Builder for Xcode 24 | 25 | The [Ice Builder for Xcode][5] is required for building the iOS test 26 | projects in this distribution. 27 | 28 | ## Building Ice Touch 29 | 30 | Edit `config/Make.rules` to establish your build configuration. The comments in 31 | the file provide more information. Pay particular attention to the variables 32 | that define the locations of the third-party libraries. 33 | 34 | In a command window, run `make` to build Ice Touch. 35 | 36 | This will build: 37 | 38 | - the Slice-to-C++ and Slice-to-Objective-C compilers 39 | - the C++ Xcode SDK 40 | - the Objective-C Xcode SDK 41 | - the C++ tests 42 | 43 | The Xcode SDKs are built in the `lib/IceTouch` directory. 44 | 45 | You should now use Xcode to build the test suite GUI located in the 46 | following subdirectories: 47 | 48 | - `test/cpp/iPhone/container` 49 | - `test/objective-c/iPhone/container` 50 | 51 | ## Installing Ice Touch 52 | 53 | Run `make install` to install Ice Touch in the directory specified by the 54 | `prefix` variables in `config/Make.rules`. 55 | 56 | The use Ice Touch, add one of the following directories to the `Additional SDKs` 57 | setting in your Xcode project build settings: 58 | 59 | - `prefix/lib/IceTouch/ObjC/$(PLATFORM_NAME).sdk` for the Objective-C SDK 60 | - `prefix/lib/IceTouch/Cpp/$(PLATFORM_NAME).sdk` for the C++ SDK 61 | 62 | ## Running the Test Suite 63 | 64 | Python is required to run the test suite. After a successful source build, you 65 | can run the tests as follows: 66 | ``` 67 | python allTests.py 68 | ``` 69 | 70 | If everything worked out, you should see lots of `ok` messages. In case of a 71 | failure, the tests abort with `failed`. 72 | 73 | For the iPhone or iPhone simulator, the test suite runs within an iPhone 74 | application named `Test Suite`. You can run it from the Xcode project located in 75 | the `test/cpp/iPhone/container` or `test/objective-c/iPhone/container` 76 | directories. 77 | 78 | [1]: https://doc.zeroc.com/display/Ice36/Using+the+Ice+Touch+Binary+Distribution 79 | [2]: https://doc.zeroc.com/display/Ice36/Supported+Platforms+for+Ice+Touch+3.6.4 80 | [3]: https://github.com/zeroc-ice/mcpp 81 | [4]: http://brew.sh 82 | [5]: https://github.com/zeroc-ice/ice-builder-xcode 83 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Ice Touch 2 | 3 | Thank you for your interest in contributing to Ice Touch! 4 | 5 | ## How to Contribute 6 | 7 | To contribute code or documentation to this project, please follow these steps: 8 | 9 | 1. Review the [ZeroC Contributor Agreement](https://gist.github.com/zcabot/1a4c24dca55adaa83d78cdeabc63226b). 10 | The CLA assistant bot will ask you to sign this agreement when you submit 11 | your first pull request. 12 | 13 | 2. If you're planning to make a significant contribution, such as a new feature 14 | or major changes, please discuss your ideas with the community first by 15 | starting a [discussion](https://github.com/zeroc-ice/icetouch/discussions) or by 16 | contacting us via [email](mailto:contributing@zeroc.com). 17 | 18 | 3. Fork this repository. 19 | 20 | 4. When implementing your contribution, please adhere to the project's naming 21 | and coding conventions to maintain consistency in the source code. 22 | 23 | 5. Submit a pull request. 24 | 25 | We review carefully any contribution that we accept, and these reviews may take 26 | some time. Please keep in mind there is no guarantee your contribution will be 27 | accepted: we may reject a pull request for any reason, or no reason. 28 | 29 | ## Contact 30 | 31 | - GitHub Discussions: 32 | - Twitter: 33 | - Email: 34 | -------------------------------------------------------------------------------- /ICE_LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 2 | 3 | This copy of Ice Touch is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU General Public License version 2 as 5 | published by the Free Software Foundation. 6 | 7 | Ice Touch is distributed in the hope that it will be useful, but WITHOUT 8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 9 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 10 | more details. 11 | 12 | You should have received a copy of the GNU General Public License version 13 | 2 along with this program; if not, see http://www.gnu.org/licenses. 14 | 15 | Linking Ice Touch statically or dynamically with other software (such as 16 | a library, module or application) is making a combined work based on Ice 17 | Touch. Thus, the terms and conditions of the GNU General Public License 18 | version 2 cover this combined work. 19 | 20 | If such software can only be used together with Ice Touch, then not only 21 | the combined work but the software itself is a work derived from Ice 22 | Touch and as such shall be licensed under the terms of the GNU General 23 | Public License version 2. This includes the situation where Ice Touch is 24 | only being used through an abstraction layer. 25 | 26 | As a special exception to the above, ZeroC grants to the copyright 27 | holders and contributors of the Mumble project (http://www.mumble.info) 28 | the permission to license the Ice Touch - based software they contribute 29 | to Mumble under the terms of the BSD license. This exception does not 30 | extend to the parts of Ice Touch used by Mumble, or to any other derived 31 | work: as a whole, any work based on Ice Touch shall be licensed under the 32 | terms and conditions of the GNU General Public License version 2. 33 | 34 | You may also combine Ice Touch with any software not derived from Ice 35 | Touch, provided the license of such software is compatible with the GNU 36 | General Public License version 2. In addition, as a special exception, 37 | ZeroC grants you permission to combine Ice Touch with: 38 | 39 | - the OpenSSL library, or with a modified version of the OpenSSL library 40 | that uses the same license as OpenSSL 41 | 42 | - any library not derived from Ice Touch and licensed under the terms of 43 | the Apache License, version 2.0 44 | (http://www.apache.org/licenses/LICENSE-2.0.html) 45 | 46 | If you modify this copy of Ice Touch, you may extend any of the 47 | exceptions provided above to your version of Ice Touch, but you are not 48 | obligated to do so. 49 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = . 11 | 12 | # 13 | # Figure out the platforms to build, if empty we'll build all the platforms. 14 | # 15 | PLATFORMS := $(strip $(foreach f,IPHONE IPHONE_SIMULATOR OSX,$(if $(findstring yes,$(COMPILE_FOR_$f)),$f))) 16 | 17 | include $(top_srcdir)/config/Make.rules 18 | 19 | ifeq ($(USE_BIN_DIST),yes) 20 | SUBDIRS = test 21 | else 22 | SUBDIRS = src test 23 | endif 24 | 25 | INSTALL_SUBDIRS = 26 | 27 | install:: 28 | @for subdir in $(INSTALL_SUBDIRS); \ 29 | do \ 30 | if test ! -d $$subdir ; \ 31 | then \ 32 | echo "Creating $$subdir..." ; \ 33 | mkdir -p $$subdir ; \ 34 | chmod a+rx $$subdir ; \ 35 | fi ; \ 36 | done 37 | ifeq ($(create_runpath_symlink),yes) 38 | @if test -h $(embedded_runpath_prefix) ; \ 39 | then \ 40 | if `\rm -f $(embedded_runpath_prefix) 2>/dev/null`; \ 41 | then echo "Removed symbolic link $(embedded_runpath_prefix)"; fi \ 42 | fi 43 | @if ! test -d $(embedded_runpath_prefix) ; \ 44 | then \ 45 | if `ln -s $(prefix) $(embedded_runpath_prefix) 2>/dev/null`; \ 46 | then echo "Created symbolic link $(embedded_runpath_prefix) --> $(prefix)"; fi \ 47 | fi 48 | endif 49 | 50 | ifneq ($(USE_BIN_DIST),yes) 51 | install all:: sdks 52 | endif 53 | 54 | sdks: 55 | if [ ! -d lib ] || [ ! -d lib/IceTouch ]; \ 56 | then \ 57 | $(call mkdir,lib) ; \ 58 | $(call mkdir,lib/IceTouch) ; \ 59 | for sdk in lib/IceTouch/Cpp lib/IceTouch/ObjC; \ 60 | do \ 61 | $(call mkdir,$$sdk) ;\ 62 | $(call mkdir,$$sdk/bin) ;\ 63 | $(call mkdir,$$sdk/slice) ;\ 64 | for platform in macosx iphoneos iphonesimulator ; \ 65 | do \ 66 | platform_sdk=$$sdk/$$platform.sdk ;\ 67 | $(call mkdir,$$platform_sdk) ;\ 68 | $(call mkdir,$$platform_sdk/usr) ;\ 69 | $(call mkdir,$$platform_sdk/usr/local) ;\ 70 | $(call mkdir,$$platform_sdk/usr/local/include) ;\ 71 | $(call mkdir,$$platform_sdk/usr/local/include/IceUtil) ;\ 72 | $(call mkdir,$$platform_sdk/usr/local/include/Ice) ;\ 73 | $(call mkdir,$$platform_sdk/usr/local/include/IceSSL) ;\ 74 | $(call mkdir,$$platform_sdk/usr/local/include/Glacier2) ;\ 75 | $(call mkdir,$$platform_sdk/usr/local/include/IceGrid) ;\ 76 | $(call mkdir,$$platform_sdk/usr/local/include/IceStorm) ;\ 77 | $(call mkdir,$$platform_sdk/usr/local/lib) ;\ 78 | $(INSTALL_DATA) $(top_srcdir)/config/$$platform-SDKSettings.plist $$platform_sdk/SDKSettings.plist ;\ 79 | chmod a+r $$platform_sdk/SDKSettings.plist ;\ 80 | done ;\ 81 | for subdir in $(ice_dir)/slice/* ; \ 82 | do \ 83 | echo "Copying $$subdir to $$sdk/slice..." ; \ 84 | cp -fpr $$subdir $$sdk/slice ; \ 85 | done ;\ 86 | done; \ 87 | else \ 88 | touch lib/IceTouch; \ 89 | fi 90 | 91 | ifeq ($(PLATFORMS),) 92 | clean:: 93 | rm -rf lib 94 | endif 95 | 96 | $(EVERYTHING):: 97 | @for subdir in $(SUBDIRS); \ 98 | do \ 99 | for platform in $(if $(PLATFORMS),$(PLATFORMS),OSX IPHONE IPHONE_SIMULATOR); \ 100 | do \ 101 | echo "making COMPILE_FOR_$$platform=yes $@ in $$subdir"; \ 102 | ( cd $$subdir && $(MAKE) -f Makefile $@ COMPILE_FOR_$$platform=yes ) || exit 1; \ 103 | done; \ 104 | done 105 | 106 | tests: 107 | for platform in $(if $(PLATFORMS),$(PLATFORMS),OSX IPHONE IPHONE_SIMULATOR); \ 108 | do \ 109 | echo "making COMPILE_FOR_$$platform=yes"; \ 110 | ( cd test && $(MAKE) -f Makefile COMPILE_FOR_$$platform=yes ) || exit 1; \ 111 | done; \ 112 | 113 | ifeq ($(COMPILE_FOR_OSX),yes) 114 | test:: 115 | @python $(top_srcdir)/allTests.py 116 | endif 117 | 118 | install:: 119 | @if test ! -d $(prefix) ; \ 120 | then \ 121 | echo "Creating $(prefix)..." ; \ 122 | $(call mkdir,$(prefix)) ; \ 123 | fi 124 | @if test ! -f $(prefix)/ICE_LICENSE ; \ 125 | then \ 126 | $(call installdata,$(top_srcdir)/ICE_LICENSE,$(prefix)) ; \ 127 | fi 128 | @if test ! -f $(prefix)/ICE_LICENSE ; \ 129 | then \ 130 | $(call installdata,$(ice_dir)/ICE_LICENSE,$(prefix)) ; \ 131 | fi 132 | @if test ! -f $(prefix)/LICENSE ; \ 133 | then \ 134 | $(call installdata,$(ice_dir)/LICENSE,$(prefix)) ; \ 135 | fi 136 | @if test ! -d $(prefix)/lib ; \ 137 | then \ 138 | $(call mkdir,$(prefix)/lib); \ 139 | fi 140 | @if test ! -d $(prefix)/lib/IceTouch ; \ 141 | then \ 142 | $(call mkdir,$(prefix)/lib/IceTouch); \ 143 | fi 144 | if [ -d $(prefix)/lib/IceTouch/Cpp ]; \ 145 | then \ 146 | rm -rf $(prefix)/lib/IceTouch/Cpp; \ 147 | fi 148 | cp -fpr $(top_srcdir)/lib/IceTouch/Cpp $(prefix)/lib/IceTouch/Cpp 149 | if [ -d $(prefix)/lib/IceTouch/ObjC ]; \ 150 | then \ 151 | rm -rf $(prefix)/lib/IceTouch/ObjC; \ 152 | fi 153 | cp -fpr $(top_srcdir)/lib/IceTouch/ObjC $(prefix)/lib/IceTouch/ObjC 154 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/zeroc-ice/icetouch.svg)](https://travis-ci.org/zeroc-ice/icetouch) 2 | 3 | # Ice Touch 4 | 5 | Ice Touch brings [Ice](https://github.com/zeroc-ice/ice) for Objective-C and C++ to iOS devices. 6 | 7 | With Ice Touch, you can build iOS apps that communicate with each other and with Ice servers running on macOS, Windows, or Linux. You can implement these servers in any of the languages supported by Ice (C++, Java, C#, Python, Objective-C). 8 | 9 | Ice Touch provides development kits and run-times for iOS devices, the 10 | iOS simulator, and macOS. 11 | 12 | ## Copyright and License 13 | 14 | Ice Touch is a single-copyright project: all the source code in this [icetouch repository](https://github.com/zeroc-ice/icetouch) is Copyright © ZeroC, Inc. 15 | 16 | As copyright owner, ZeroC can license Ice Touch under different license terms, and offers the following licenses for Ice Touch: 17 | - GPL v2, a popular open-source license with strong [copyleft](http://en.wikipedia.org/wiki/Copyleft) conditions 18 | (the default license) 19 | - Commercial or closed-source licenses 20 | 21 | If you license Ice Touch under GPL v2, there is no license fee or signed license agreement: you just need to comply with the GPL v2 terms and conditions. See [ICE_LICENSE](./ICE_LICENSE) and [LICENSE](./LICENSE) for further information. Note that the GPL v2 terms are not compatible with the Apple App Store terms; as a result, you cannot distribute an application licensed under GPL v2 in the App Store. 22 | 23 | If you purchase a commercial or closed-source license for Ice Touch, you must comply with the terms and conditions listed in the associated license agreement; the GPL v2 terms and conditions do not apply. 24 | 25 | The Ice Touch software itself remains the same: the only difference between an open-source Ice Touch and a commercial Ice Touch are the license terms. 26 | 27 | ## Documentation 28 | 29 | - [Ice Touch Release Notes](https://doc.zeroc.com/display/Ice36/Ice+Touch+Release+Notes) 30 | - [Ice Manual](https://doc.zeroc.com/display/Ice36/Home) 31 | -------------------------------------------------------------------------------- /allTests.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # ********************************************************************** 3 | # 4 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 5 | # 6 | # This copy of Ice Touch is licensed to you under the terms described 7 | # in the ICE_LICENSE file included in this distribution. 8 | # 9 | # ********************************************************************** 10 | 11 | import os, sys, re, getopt 12 | 13 | sys.path.append(os.path.join(os.path.dirname(__file__), "ice", "scripts")) 14 | import TestUtil 15 | 16 | # 17 | # List of all basic tests. 18 | # 19 | tests = [ 20 | ("cpp/Ice/proxy", ["core"]), 21 | ("cpp/Ice/operations", ["core"]), 22 | ("cpp/Ice/exceptions", ["core"]), 23 | ("cpp/Ice/ami", ["core", "nocompress"]), 24 | ("cpp/Ice/info", ["core", "noipv6", "nocompress"]), 25 | ("cpp/Ice/inheritance", ["core"]), 26 | ("cpp/Ice/facets", ["core"]), 27 | ("cpp/Ice/objects", ["core"]), 28 | ("cpp/Ice/optional", ["core"]), 29 | ("cpp/Ice/binding", ["core"]), 30 | ("cpp/Ice/faultTolerance", ["core", "novalgrind"]), # valgrind reports leak with aborted servers 31 | ("cpp/Ice/location", ["core"]), 32 | ("cpp/Ice/adapterDeactivation", ["core"]), 33 | ("cpp/Ice/slicing/exceptions", ["core"]), 34 | ("cpp/Ice/slicing/objects", ["core"]), 35 | ("cpp/Ice/dispatcher", ["once"]), 36 | ("cpp/Ice/stream", ["core"]), 37 | ("cpp/Ice/hold", ["core"]), 38 | ("cpp/Ice/custom", ["core", "nossl", "nows"]), 39 | ("cpp/Ice/retry", ["core"]), 40 | ("cpp/Ice/timeout", ["core", "nocompress"]), 41 | ("cpp/Ice/servantLocator", ["core"]), 42 | ("cpp/Ice/interceptor", ["core"]), 43 | ("cpp/Ice/udp", ["core"]), 44 | ("cpp/Ice/defaultServant", ["core"]), 45 | ("cpp/Ice/defaultValue", ["core"]), 46 | ("cpp/Ice/invoke", ["core"]), 47 | ("cpp/Ice/hash", ["once"]), 48 | ("cpp/Ice/admin", ["core", "noipv6"]), 49 | ("cpp/Ice/metrics", ["core", "nossl", "nows", "noipv6", "nocompress", "nomingw"]), 50 | ("cpp/Ice/enums", ["once"]), 51 | ("cpp/Ice/services", ["once"]), 52 | ("objective-c/Ice/proxy", ["core"]), 53 | ("objective-c/Ice/ami", ["core", "nocompress"]), 54 | ("objective-c/Ice/operations", ["core"]), 55 | ("objective-c/Ice/exceptions", ["core"]), 56 | ("objective-c/Ice/inheritance", ["core"]), 57 | ("objective-c/Ice/invoke", ["core"]), 58 | ("objective-c/Ice/metrics", ["core", "nows", "nossl", "noipv6", "nocompress"]), 59 | ("objective-c/Ice/facets", ["core"]), 60 | ("objective-c/Ice/objects", ["core"]), 61 | ("objective-c/Ice/optional", ["core"]), 62 | ("objective-c/Ice/interceptor", ["core"]), 63 | ("objective-c/Ice/dispatcher", ["core"]), 64 | ("objective-c/Ice/defaultServant", ["core"]), 65 | ("objective-c/Ice/servantLocator", ["core"]), 66 | ("objective-c/Ice/defaultValue", ["core"]), 67 | ("objective-c/Ice/binding", ["core"]), 68 | ("objective-c/Ice/stream", ["core"]), 69 | ("objective-c/Ice/hold", ["core"]), 70 | ("objective-c/Ice/faultTolerance", ["core"]), 71 | ("objective-c/Ice/location", ["core"]), 72 | ("objective-c/Ice/adapterDeactivation", ["core"]), 73 | ("objective-c/Ice/slicing/exceptions", ["core"]), 74 | ("objective-c/Ice/slicing/objects", ["core"]), 75 | ("objective-c/Ice/retry", ["core"]), 76 | ("objective-c/Ice/timeout", ["core", "nocompress"]), 77 | ("objective-c/Ice/hash", ["core"]), 78 | ("objective-c/Ice/info", ["core", "noipv6", "nocompress"]), 79 | ("objective-c/Ice/enums", ["once"]), 80 | ("objective-c/Ice/acm", ["core"]), 81 | ] 82 | 83 | # Run tests relative to ice sub-directory. 84 | tests = [ (os.path.join("..", "test", x), y) for x, y in tests ] 85 | if __name__ == "__main__": 86 | TestUtil.run(tests, True) 87 | -------------------------------------------------------------------------------- /config/MacOSX-SDKSettings.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CanonicalName 6 | IceTouch 3.6.0 7 | DefaultProperties 8 | 9 | MACOSX_DEPLOYMENT_TARGET 10 | 10.9 11 | PLATFORM_NAME 12 | macosx 13 | 14 | DisplayName 15 | IceTouch 3.6.0 16 | FamilyIdentifier 17 | macosx 18 | FamilyName 19 | Mac OS X 20 | MinimalDisplayName 21 | 10.10 22 | MinimumSupportedToolsVersion 23 | 6.1 24 | Version 25 | 3.6.0 26 | IsBaseSDK 27 | NO 28 | 29 | 30 | -------------------------------------------------------------------------------- /config/iPhoneOS-SDKSettings.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AlternateSDK 6 | IceTouch 3.6.0 7 | CanonicalName 8 | IceTouch 3.6.0 9 | CustomProperties 10 | 11 | DefaultProperties 12 | 13 | IPHONEOS_DEPLOYMENT_TARGET 14 | 7.1 15 | MACOSX_DEPLOYMENT_TARGET 16 | 10.9 17 | PLATFORM_NAME 18 | iphoneos 19 | 20 | DisplayName 21 | Ice Touch 3.6.0 22 | FamilyIdentifier 23 | iphoneos 24 | FamilyName 25 | iPhone OS 26 | IsBaseSDK 27 | NO 28 | MaximumOSDeploymentTarget 29 | 10.10 30 | MinimalDisplayName 31 | Device 32 | MinimumSupportedToolsVersion 33 | 6.0 34 | Version 35 | 3.6.0 36 | 37 | 38 | -------------------------------------------------------------------------------- /config/iPhoneSimulator-SDKSettings.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AlternateSDK 6 | IceTouch 3.6.0 7 | CanonicalName 8 | IceTouch 3.6.0 9 | CustomProperties 10 | 11 | DefaultProperties 12 | 13 | PLATFORM_NAME 14 | iPhoneSimulator 15 | 16 | DisplayName 17 | Ice Touch 3.6.0 18 | IsBaseSDK 19 | NO 20 | MinimumSupportedToolsVersion 21 | 6.0 22 | Version 23 | 3.6.0 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = .. 11 | 12 | include $(top_srcdir)/config/Make.rules 13 | 14 | SUBDIRS = translators cpp objective-c 15 | 16 | $(EVERYTHING):: 17 | @for subdir in $(SUBDIRS); \ 18 | do \ 19 | echo "making $@ in $$subdir"; \ 20 | ( cd $$subdir && $(MAKE) $@ ) || exit 1; \ 21 | done 22 | -------------------------------------------------------------------------------- /src/cpp/Glacier2/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../../.. 11 | 12 | LIBNAME = $(call mklibname,Glacier2$(libsuffix)) 13 | 14 | TARGETS = $(libdir)/$(LIBNAME) 15 | 16 | SLICE_DIRS = Glacier2 17 | HEADER_DIRS = Glacier2 18 | 19 | SRCS = Glacier2Lib/SessionHelper.cpp \ 20 | Glacier2Lib/NullPermissionsVerifier.cpp 21 | 22 | include $(top_srcdir)/config/Make.rules 23 | 24 | SLICE2CPPFLAGS := --ice --dll-export GLACIER2_API $(SLICE2CPPFLAGS) 25 | 26 | install:: all 27 | -------------------------------------------------------------------------------- /src/cpp/Ice/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../../.. 11 | 12 | LIBNAME = $(call mklibname,Ice$(libsuffix)) 13 | 14 | TARGETS = $(libdir)/$(LIBNAME) 15 | 16 | # Headers for these Slices files won't be installed in the SDK 17 | PRIVATE_SLICE_SRCS = IceDiscovery/IceDiscovery.ice \ 18 | IceLocatorDiscovery/IceLocatorDiscovery.ice \ 19 | 20 | SLICE_DIRS = Ice IceSSL 21 | HEADER_DIRS = IceUtil Ice IceSSL 22 | SRC_DIRS = IceUtil Ice IceDiscovery IceLocatorDiscovery 23 | 24 | LOCAL_SRCS = Notifications.mm 25 | EXCLUDE_SRCS = Ice/DLLMain.cpp Ice/RegisterPluginsInit.cpp 26 | 27 | ifeq ($(COMPILE_FOR_OSX),yes) 28 | 29 | SRC_DIRS += IceSSL 30 | LOCAL_SRCS += RegisterPluginsInit.cpp 31 | 32 | else 33 | 34 | LOCAL_SRCS += $(wildcard *.cpp) 35 | EXCLUDE_SRCS += IceUtil/CtrlCHandler.cpp \ 36 | Ice/Application.cpp \ 37 | Ice/Service.cpp \ 38 | Ice/StreamSocket.cpp \ 39 | Ice/TcpEndpointI.cpp \ 40 | Ice/TcpAcceptor.cpp \ 41 | Ice/TcpConnector.cpp \ 42 | Ice/TcpTransceiver.cpp 43 | 44 | endif 45 | 46 | include $(top_srcdir)/config/Make.rules 47 | 48 | CPPFLAGS := -DICE_API_EXPORTS $(CPPFLAGS) 49 | SLICE2CPPFLAGS := --ice --dll-export ICE_API $(SLICE2CPPFLAGS) 50 | 51 | ifneq ($(PLATFORM_NAME),macosx) 52 | SLICE2CPPFLAGS := -DICE_USE_CFSTREAM $(SLICE2CPPFLAGS) 53 | endif 54 | 55 | install:: all 56 | 57 | # Rules for local sources 58 | $(OBJDIR)/%.o: %.cpp 59 | @$(call mkobj,$<,$@,-I$(cppdir)/src $(CXX_CPPFLAGS)) 60 | 61 | $(OBJDIR)/%.o: %.mm 62 | @$(call mkobj,$<,$@,-I$(cppdir)/src $(OBJCXX_CPPFLAGS)) 63 | -------------------------------------------------------------------------------- /src/cpp/Ice/Notifications.mm: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | #if TARGET_OS_IPHONE != 0 13 | 14 | #import 15 | #import 16 | #import 17 | 18 | #include 19 | 20 | #include 21 | 22 | using namespace std; 23 | using namespace IceInternal; 24 | 25 | namespace IceInternal 26 | { 27 | 28 | bool registerForBackgroundNotification(IncomingConnectionFactory*); 29 | void unregisterForBackgroundNotification(IncomingConnectionFactory*); 30 | 31 | } 32 | 33 | namespace 34 | { 35 | 36 | class Observer 37 | { 38 | public: 39 | 40 | Observer() : _background(false) 41 | { 42 | [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidEnterBackgroundNotification 43 | object:nil 44 | queue:nil 45 | usingBlock:^(NSNotification*) 46 | { 47 | didEnterBackground(); 48 | }]; 49 | 50 | [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillEnterForegroundNotification 51 | object:nil 52 | queue:nil 53 | usingBlock:^(NSNotification*) 54 | { 55 | willEnterForeground(); 56 | }]; 57 | } 58 | 59 | bool 60 | add(IncomingConnectionFactory* factory) 61 | { 62 | IceUtil::Mutex::Lock sync(_mutex); 63 | _factories.insert(factory); 64 | factory->__incRef(); 65 | if(_background) 66 | { 67 | factory->stopAcceptor(); 68 | } 69 | else 70 | { 71 | factory->startAcceptor(); 72 | } 73 | return _background; 74 | } 75 | 76 | void 77 | remove(IncomingConnectionFactory* factory) 78 | { 79 | IceUtil::Mutex::Lock sync(_mutex); 80 | _factories.erase(factory); 81 | factory->__decRef(); 82 | } 83 | 84 | void 85 | didEnterBackground() 86 | { 87 | IceUtil::Mutex::Lock sync(_mutex); 88 | 89 | // 90 | // Notify all the incoming connection factories that we are 91 | // entering the background mode. 92 | // 93 | for(set::const_iterator p = _factories.begin(); p != _factories.end(); ++p) 94 | { 95 | (*p)->stopAcceptor(); 96 | } 97 | _background = true; 98 | } 99 | 100 | void 101 | willEnterForeground() 102 | { 103 | IceUtil::Mutex::Lock sync(_mutex); 104 | 105 | // 106 | // Notify all the incoming connection factories that we are 107 | // entering the foreground mode. 108 | // 109 | _background = false; 110 | for(set::const_iterator p = _factories.begin(); p != _factories.end(); ++p) 111 | { 112 | (*p)->startAcceptor(); 113 | } 114 | } 115 | 116 | private: 117 | 118 | IceUtil::Mutex _mutex; 119 | bool _background; 120 | set _factories; 121 | }; 122 | 123 | 124 | } 125 | 126 | static Observer* observer = new Observer(); 127 | 128 | bool 129 | IceInternal::registerForBackgroundNotification(IncomingConnectionFactory* factory) 130 | { 131 | return observer->add(factory); 132 | } 133 | 134 | void 135 | IceInternal::unregisterForBackgroundNotification(IncomingConnectionFactory* factory) 136 | { 137 | observer->remove(factory); 138 | } 139 | 140 | #endif 141 | -------------------------------------------------------------------------------- /src/cpp/Ice/RegisterPluginsInit.cpp: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #include 11 | #include 12 | 13 | using namespace std; 14 | using namespace Ice; 15 | using namespace IceInternal; 16 | 17 | extern "C" 18 | { 19 | 20 | Plugin* createIceUDP(const CommunicatorPtr&, const string&, const StringSeq&); 21 | Plugin* createIceTCP(const CommunicatorPtr&, const string&, const StringSeq&); 22 | Plugin* createStringConverter(const CommunicatorPtr&, const string&, const StringSeq&); 23 | Plugin* createIceSSL(const CommunicatorPtr&, const string&, const StringSeq&); 24 | Plugin* createIceDiscovery(const CommunicatorPtr&, const string&, const StringSeq&); 25 | Plugin* createIceLocatorDiscovery(const CommunicatorPtr&, const string&, const StringSeq&); 26 | 27 | } 28 | 29 | namespace Ice 30 | { 31 | 32 | #if TARGET_OS_IPHONE > 0 33 | void 34 | registerIceSSL(bool) 35 | { 36 | // Nothing to do, IceSSL is always registered by the static initializer. 37 | } 38 | #endif 39 | 40 | } 41 | 42 | RegisterPluginsInit::RegisterPluginsInit() 43 | { 44 | Ice::registerPluginFactory("IceUDP", createIceUDP, true); 45 | Ice::registerPluginFactory("IceTCP", createIceTCP, true); 46 | Ice::registerPluginFactory("IceStringConverter", createStringConverter, false); 47 | Ice::registerPluginFactory("IceSSL", createIceSSL, true); 48 | Ice::registerPluginFactory("IceDiscovery", createIceDiscovery, false); 49 | Ice::registerPluginFactory("IceLocatorDiscovery", createIceLocatorDiscovery, false); 50 | } 51 | -------------------------------------------------------------------------------- /src/cpp/Ice/StreamAcceptor.cpp: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #include "StreamTransceiver.h" 11 | #include "StreamEndpointI.h" 12 | #include "StreamAcceptor.h" 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | using namespace std; 24 | using namespace Ice; 25 | using namespace IceInternal; 26 | 27 | IceInternal::NativeInfoPtr 28 | IceObjC::StreamAcceptor::getNativeInfo() 29 | { 30 | return this; 31 | } 32 | 33 | void 34 | IceObjC::StreamAcceptor::close() 35 | { 36 | if(_fd != INVALID_SOCKET) 37 | { 38 | closeSocketNoThrow(_fd); 39 | _fd = INVALID_SOCKET; 40 | } 41 | } 42 | 43 | IceInternal::EndpointIPtr 44 | IceObjC::StreamAcceptor::listen() 45 | { 46 | try 47 | { 48 | const_cast(_addr) = doBind(_fd, _addr); 49 | doListen(_fd, _backlog); 50 | } 51 | catch(...) 52 | { 53 | _fd = INVALID_SOCKET; 54 | throw; 55 | } 56 | 57 | _endpoint = _endpoint->endpoint(this); 58 | return _endpoint; 59 | } 60 | 61 | TransceiverPtr 62 | IceObjC::StreamAcceptor::accept() 63 | { 64 | SOCKET fd = doAccept(_fd); 65 | setBlock(fd, false); 66 | setTcpBufSize(fd, _instance); 67 | 68 | // 69 | // Create the read/write streams 70 | // 71 | CFReadStreamRef readStream = nil; 72 | CFWriteStreamRef writeStream = nil; 73 | try 74 | { 75 | CFStreamCreatePairWithSocket(NULL, fd, &readStream, &writeStream); 76 | _instance->setupStreams(readStream, writeStream, true, ""); 77 | return new StreamTransceiver(_instance, readStream, writeStream, fd); 78 | } 79 | catch(const Ice::LocalException& ex) 80 | { 81 | if(fd != INVALID_SOCKET) 82 | { 83 | closeSocketNoThrow(fd); 84 | } 85 | if(readStream) 86 | { 87 | CFRelease(readStream); 88 | } 89 | if(writeStream) 90 | { 91 | CFRelease(writeStream); 92 | } 93 | throw; 94 | } 95 | } 96 | 97 | string 98 | IceObjC::StreamAcceptor::protocol() const 99 | { 100 | return _instance->protocol(); 101 | } 102 | 103 | string 104 | IceObjC::StreamAcceptor::toString() const 105 | { 106 | return addrToString(_addr); 107 | } 108 | 109 | string 110 | IceObjC::StreamAcceptor::toDetailedString() const 111 | { 112 | ostringstream os; 113 | os << "local address = " << toString(); 114 | vector intfs = getHostsForEndpointExpand(inetAddrToString(_addr), _instance->protocolSupport(), true); 115 | if(!intfs.empty()) 116 | { 117 | os << "\nlocal interfaces = "; 118 | os << IceUtilInternal::joinString(intfs, ", "); 119 | } 120 | return os.str(); 121 | } 122 | 123 | int 124 | IceObjC::StreamAcceptor::effectivePort() const 125 | { 126 | return getPort(_addr); 127 | } 128 | 129 | IceObjC::StreamAcceptor::StreamAcceptor(const StreamEndpointIPtr& endpoint, 130 | const InstancePtr& instance, 131 | const string& host, 132 | int port) : 133 | _endpoint(endpoint), 134 | _instance(instance), 135 | _addr(getAddressForServer(host, port, instance->protocolSupport(), instance->preferIPv6())) 136 | { 137 | #ifdef SOMAXCONN 138 | _backlog = instance->properties()->getPropertyAsIntWithDefault("Ice.TCP.Backlog", SOMAXCONN); 139 | #else 140 | _backlog = instance->properties()->getPropertyAsIntWithDefault("Ice.TCP.Backlog", 511); 141 | #endif 142 | 143 | try 144 | { 145 | _fd = createSocket(false, _addr); 146 | setBlock(_fd, false); 147 | setTcpBufSize(_fd, _instance); 148 | setReuseAddress(_fd, true); 149 | } 150 | catch(...) 151 | { 152 | _fd = INVALID_SOCKET; 153 | throw; 154 | } 155 | } 156 | 157 | IceObjC::StreamAcceptor::~StreamAcceptor() 158 | { 159 | assert(_fd == INVALID_SOCKET); 160 | } 161 | -------------------------------------------------------------------------------- /src/cpp/Ice/StreamAcceptor.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #ifndef ICE_STREAM_ACCEPTOR_H 11 | #define ICE_STREAM_ACCEPTOR_H 12 | 13 | #include 14 | #include 15 | 16 | namespace IceObjC 17 | { 18 | 19 | class StreamEndpointI; 20 | typedef IceUtil::Handle StreamEndpointIPtr; 21 | 22 | class Instance; 23 | typedef IceUtil::Handle InstancePtr; 24 | 25 | class StreamAcceptor : public IceInternal::Acceptor, public IceInternal::NativeInfo 26 | { 27 | public: 28 | 29 | virtual IceInternal::NativeInfoPtr getNativeInfo(); 30 | virtual void close(); 31 | virtual IceInternal::EndpointIPtr listen(); 32 | virtual IceInternal::TransceiverPtr accept(); 33 | virtual std::string protocol() const; 34 | virtual std::string toString() const; 35 | virtual std::string toDetailedString() const; 36 | 37 | int effectivePort() const; 38 | 39 | private: 40 | 41 | StreamAcceptor(const StreamEndpointIPtr&, const InstancePtr&, const std::string&, int); 42 | virtual ~StreamAcceptor(); 43 | friend class StreamEndpointI; 44 | 45 | StreamEndpointIPtr _endpoint; 46 | InstancePtr _instance; 47 | int _backlog; 48 | IceInternal::Address _addr; 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/cpp/Ice/StreamConnector.cpp: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #include "StreamTransceiver.h" 11 | #include "StreamEndpointI.h" 12 | #include "StreamConnector.h" 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | using namespace std; 23 | using namespace Ice; 24 | using namespace IceInternal; 25 | 26 | TransceiverPtr 27 | IceObjC::StreamConnector::connect() 28 | { 29 | CFReadStreamRef readStream = nil; 30 | CFWriteStreamRef writeStream = nil; 31 | try 32 | { 33 | CFStringRef h = CFStringCreateWithCString(NULL, _host.c_str(), kCFStringEncodingUTF8); 34 | CFHostRef host = CFHostCreateWithName(NULL, h); 35 | CFRelease(h); 36 | CFStreamCreatePairWithSocketToCFHost(NULL, host, _port, &readStream, &writeStream); 37 | CFRelease(host); 38 | 39 | _instance->setupStreams(readStream, writeStream, false, _host); 40 | return new StreamTransceiver(_instance, readStream, writeStream, _host, _port); 41 | } 42 | catch(const Ice::LocalException& ex) 43 | { 44 | if(readStream) 45 | { 46 | CFRelease(readStream); 47 | } 48 | if(writeStream) 49 | { 50 | CFRelease(writeStream); 51 | } 52 | throw; 53 | } 54 | } 55 | 56 | Short 57 | IceObjC::StreamConnector::type() const 58 | { 59 | return _instance->type(); 60 | } 61 | 62 | string 63 | IceObjC::StreamConnector::toString() const 64 | { 65 | string proxyHost = _instance->proxyHost(); 66 | ostringstream os; 67 | if(!proxyHost.empty()) 68 | { 69 | os << proxyHost << ":" << _instance->proxyPort(); 70 | } 71 | else 72 | { 73 | os << _host << ":" << _port; 74 | } 75 | return os.str(); 76 | } 77 | 78 | bool 79 | IceObjC::StreamConnector::operator==(const IceInternal::Connector& r) const 80 | { 81 | const StreamConnector* p = dynamic_cast(&r); 82 | if(!p) 83 | { 84 | return false; 85 | } 86 | 87 | if(_timeout != p->_timeout) 88 | { 89 | return false; 90 | } 91 | 92 | if(_connectionId != p->_connectionId) 93 | { 94 | return false; 95 | } 96 | 97 | if(_host != p->_host) 98 | { 99 | return false; 100 | } 101 | 102 | if(_port != p->_port) 103 | { 104 | return false; 105 | } 106 | 107 | return true; 108 | } 109 | 110 | bool 111 | IceObjC::StreamConnector::operator!=(const IceInternal::Connector& r) const 112 | { 113 | return !operator==(r); 114 | } 115 | 116 | bool 117 | IceObjC::StreamConnector::operator<(const IceInternal::Connector& r) const 118 | { 119 | const StreamConnector* p = dynamic_cast(&r); 120 | if(!p) 121 | { 122 | return type() < r.type(); 123 | } 124 | 125 | if(_timeout < p->_timeout) 126 | { 127 | return true; 128 | } 129 | else if(p->_timeout < _timeout) 130 | { 131 | return false; 132 | } 133 | 134 | if(_connectionId < p->_connectionId) 135 | { 136 | return true; 137 | } 138 | else if(p->_connectionId < _connectionId) 139 | { 140 | return false; 141 | } 142 | 143 | if(_host < p->_host) 144 | { 145 | return true; 146 | } 147 | else if(p->_host < _host) 148 | { 149 | return false; 150 | } 151 | 152 | return _port < p->_port; 153 | } 154 | 155 | IceObjC::StreamConnector::StreamConnector(const InstancePtr& instance, 156 | const string& host, 157 | Ice::Int port, 158 | Ice::Int timeout, 159 | const string& connectionId) : 160 | _instance(instance), 161 | _host(host.empty() ? string("127.0.0.1") : host), 162 | _port(port), 163 | _timeout(timeout), 164 | _connectionId(connectionId) 165 | { 166 | } 167 | 168 | IceObjC::StreamConnector::~StreamConnector() 169 | { 170 | } 171 | -------------------------------------------------------------------------------- /src/cpp/Ice/StreamConnector.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #ifndef ICE_STREAM_CONNECTOR_H 11 | #define ICE_STREAM_CONNECTOR_H 12 | 13 | #include 14 | #include 15 | 16 | namespace IceObjC 17 | { 18 | 19 | class StreamEndpointI; 20 | 21 | class Instance; 22 | typedef IceUtil::Handle InstancePtr; 23 | 24 | class StreamConnector : public IceInternal::Connector 25 | { 26 | public: 27 | 28 | virtual IceInternal::TransceiverPtr connect(); 29 | 30 | virtual Ice::Short type() const; 31 | virtual std::string toString() const; 32 | 33 | virtual bool operator==(const IceInternal::Connector&) const; 34 | virtual bool operator!=(const IceInternal::Connector&) const; 35 | virtual bool operator<(const IceInternal::Connector&) const; 36 | 37 | private: 38 | 39 | StreamConnector(const InstancePtr&, const std::string&, Ice::Int, Ice::Int, const std::string&); 40 | virtual ~StreamConnector(); 41 | friend class StreamEndpointI; 42 | 43 | const InstancePtr _instance; 44 | const std::string _host; 45 | const Ice::Int _port; 46 | const Ice::Int _timeout; 47 | const std::string _connectionId; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/cpp/Ice/StreamEndpointI.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #ifndef ICE_STREAM_ENDPOINT_I_H 11 | #define ICE_STREAM_ENDPOINT_I_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | namespace IceObjC 23 | { 24 | 25 | class Instance : public IceInternal::ProtocolInstance 26 | { 27 | public: 28 | 29 | Instance(const Ice::CommunicatorPtr&, Ice::Short, const std::string&, bool); 30 | virtual ~Instance(); 31 | 32 | CFArrayRef certificateAuthorities() const 33 | { 34 | return _certificateAuthorities; 35 | } 36 | 37 | CFDataRef trustOnlyKeyID() const 38 | { 39 | return _trustOnlyKeyID; 40 | } 41 | 42 | const std::string& proxyHost() const 43 | { 44 | return _proxyHost; 45 | } 46 | 47 | int proxyPort() const 48 | { 49 | return _proxyPort; 50 | } 51 | 52 | void setupStreams(CFReadStreamRef, CFWriteStreamRef, bool, const std::string&) const; 53 | 54 | Instance* clone(const IceInternal::ProtocolInstancePtr&); 55 | 56 | private: 57 | 58 | const bool _voip; 59 | const Ice::CommunicatorPtr _communicator; 60 | CFMutableDictionaryRef _serverSettings; 61 | CFMutableDictionaryRef _clientSettings; 62 | CFMutableDictionaryRef _proxySettings; 63 | CFArrayRef _certificateAuthorities; 64 | CFDataRef _trustOnlyKeyID; 65 | 66 | std::string _proxyHost; 67 | int _proxyPort; 68 | }; 69 | typedef IceUtil::Handle InstancePtr; 70 | 71 | class StreamEndpointI; 72 | typedef IceUtil::Handle StreamEndpointIPtr; 73 | 74 | class StreamAcceptor; 75 | typedef IceUtil::Handle StreamAcceptorPtr; 76 | 77 | class StreamEndpointI : public IceInternal::IPEndpointI, public IceInternal::WSEndpointDelegate 78 | { 79 | public: 80 | 81 | StreamEndpointI(const InstancePtr&, const std::string&, Ice::Int, const IceInternal::Address&, Ice::Int, 82 | const std::string&, bool); 83 | StreamEndpointI(const InstancePtr&); 84 | StreamEndpointI(const InstancePtr&, IceInternal::BasicStream*); 85 | 86 | virtual Ice::EndpointInfoPtr getInfo() const; 87 | virtual Ice::EndpointInfoPtr getWSInfo(const std::string&) const; 88 | 89 | virtual Ice::Int timeout() const; 90 | virtual IceInternal::EndpointIPtr timeout(Ice::Int) const; 91 | virtual bool compress() const; 92 | virtual IceInternal::EndpointIPtr compress(bool) const; 93 | virtual bool datagram() const; 94 | virtual bool secure() const; 95 | 96 | virtual void connectors_async(Ice::EndpointSelectionType, const IceInternal::EndpointI_connectorsPtr&) const; 97 | virtual IceInternal::TransceiverPtr transceiver() const; 98 | virtual IceInternal::AcceptorPtr acceptor(const std::string&) const; 99 | virtual std::string options() const; 100 | 101 | virtual bool operator==(const Ice::LocalObject&) const; 102 | virtual bool operator<(const Ice::LocalObject&) const; 103 | 104 | StreamEndpointIPtr endpoint(const StreamAcceptorPtr&) const; 105 | 106 | using IPEndpointI::connectionId; 107 | 108 | protected: 109 | 110 | virtual void streamWriteImpl(IceInternal::BasicStream*) const; 111 | virtual void hashInit(Ice::Int&) const; 112 | virtual void fillEndpointInfo(Ice::IPEndpointInfo*) const; 113 | virtual bool checkOption(const std::string&, const std::string&, const std::string&); 114 | 115 | virtual IceInternal::ConnectorPtr createConnector(const IceInternal::Address&, 116 | const IceInternal::NetworkProxyPtr&) const; 117 | virtual IceInternal::IPEndpointIPtr createEndpoint(const std::string&, int, const std::string&) const; 118 | 119 | private: 120 | 121 | const InstancePtr _instance; 122 | 123 | // 124 | // All members are const, because endpoints are immutable. 125 | // 126 | const Ice::Int _timeout; 127 | const bool _compress; 128 | }; 129 | 130 | class StreamEndpointFactory : public IceInternal::EndpointFactory 131 | { 132 | public: 133 | 134 | StreamEndpointFactory(const InstancePtr&); 135 | 136 | virtual ~StreamEndpointFactory(); 137 | 138 | virtual Ice::Short type() const; 139 | virtual std::string protocol() const; 140 | virtual IceInternal::EndpointIPtr create(std::vector&, bool) const; 141 | virtual IceInternal::EndpointIPtr read(IceInternal::BasicStream*) const; 142 | virtual void destroy(); 143 | 144 | virtual IceInternal::EndpointFactoryPtr clone(const IceInternal::ProtocolInstancePtr&) const; 145 | 146 | private: 147 | 148 | InstancePtr _instance; 149 | }; 150 | 151 | } 152 | 153 | #endif 154 | -------------------------------------------------------------------------------- /src/cpp/Ice/StreamTransceiver.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #ifndef ICE_STREAM_TRANSCEIVER_H 11 | #define ICE_STREAM_TRANSCEIVER_H 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | struct __CFError; 18 | typedef struct __CFError * CFErrorRef; 19 | 20 | struct __CFWriteStream; 21 | typedef struct __CFWriteStream * CFWriteStreamRef; 22 | 23 | struct __CFReadStream; 24 | typedef struct __CFReadStream * CFReadStreamRef; 25 | 26 | namespace IceObjC 27 | { 28 | 29 | class Instance; 30 | typedef IceUtil::Handle InstancePtr; 31 | 32 | class StreamTransceiver : public IceInternal::Transceiver, public IceInternal::StreamNativeInfo, 33 | public IceInternal::WSTransceiverDelegate 34 | { 35 | enum State 36 | { 37 | StateNeedConnect, 38 | StateConnectPending, 39 | StateConnected 40 | }; 41 | 42 | public: 43 | 44 | StreamTransceiver(const InstancePtr&, CFReadStreamRef, CFWriteStreamRef, const std::string&, Ice::Int); 45 | StreamTransceiver(const InstancePtr&, CFReadStreamRef, CFWriteStreamRef, SOCKET); 46 | virtual ~StreamTransceiver(); 47 | 48 | virtual IceInternal::NativeInfoPtr getNativeInfo(); 49 | 50 | virtual void initStreams(IceInternal::SelectorReadyCallback*); 51 | virtual IceInternal::SocketOperation registerWithRunLoop(IceInternal::SocketOperation); 52 | virtual IceInternal::SocketOperation unregisterFromRunLoop(IceInternal::SocketOperation, bool); 53 | virtual void closeStreams(); 54 | 55 | virtual IceInternal::SocketOperation initialize(IceInternal::Buffer&, IceInternal::Buffer&, bool&); 56 | virtual IceInternal::SocketOperation closing(bool, const Ice::LocalException&); 57 | virtual void close(); 58 | 59 | virtual IceInternal::SocketOperation write(IceInternal::Buffer&); 60 | virtual IceInternal::SocketOperation read(IceInternal::Buffer&, bool&); 61 | 62 | virtual std::string protocol() const; 63 | virtual std::string toString() const; 64 | virtual std::string toDetailedString() const; 65 | virtual Ice::ConnectionInfoPtr getInfo() const; 66 | virtual Ice::ConnectionInfoPtr getWSInfo(const Ice::HeaderDict&) const; 67 | virtual void checkSendSize(const IceInternal::Buffer&); 68 | virtual void setBufferSize(int, int); 69 | 70 | private: 71 | 72 | void checkCertificates(); 73 | void checkError(CFErrorRef, const char*, int); 74 | void fillConnectionInfo(const Ice::IPConnectionInfoPtr&) const; 75 | 76 | const InstancePtr _instance; 77 | const std::string _host; 78 | const Ice::Int _port; 79 | CFReadStreamRef _readStream; 80 | CFWriteStreamRef _writeStream; 81 | bool _readStreamRegistered; 82 | bool _writeStreamRegistered; 83 | bool _opening; 84 | bool _checkCertificates; 85 | 86 | IceUtil::Mutex _mutex; 87 | bool _error; 88 | 89 | State _state; 90 | std::string _desc; 91 | 92 | size_t _maxSendPacketSize; 93 | size_t _maxRecvPacketSize; 94 | }; 95 | 96 | } 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /src/cpp/IceGrid/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../../.. 11 | 12 | LIBNAME = $(call mklibname,IceGrid$(libsuffix)) 13 | 14 | TARGETS = $(libdir)/$(LIBNAME) 15 | 16 | SLICE_DIRS = IceGrid 17 | HEADER_DIRS = IceGrid 18 | 19 | include $(top_srcdir)/config/Make.rules 20 | 21 | SLICE2CPPFLAGS := --ice --dll-export ICE_GRID_API $(SLICE2CPPFLAGS) 22 | 23 | install:: all 24 | -------------------------------------------------------------------------------- /src/cpp/IceStorm/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../../.. 11 | 12 | LIBNAME = $(call mklibname,IceStorm$(libsuffix)) 13 | 14 | TARGETS = $(libdir)/$(LIBNAME) 15 | 16 | SLICE_DIRS = IceStorm 17 | HEADER_DIRS = IceStorm 18 | 19 | include $(top_srcdir)/config/Make.rules 20 | 21 | SLICE2CPPFLAGS := --ice --dll-export ICE_STORM_API $(SLICE2CPPFLAGS) 22 | 23 | install:: all 24 | -------------------------------------------------------------------------------- /src/cpp/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../.. 11 | 12 | include $(top_srcdir)/config/Make.rules 13 | 14 | SUBDIRS = Ice Glacier2 IceStorm IceGrid 15 | 16 | .PHONY: $(EVERYTHING) $(SUBDIRS) 17 | 18 | # 19 | # Dependencies for 'all' target when using -jx 20 | # 21 | 22 | Glacier2 IceStorm IceGrid: Ice 23 | 24 | IceGrid: Glacier2 25 | 26 | all:: $(SUBDIRS) 27 | 28 | $(SUBDIRS): 29 | @echo "making all in $@" 30 | @$(MAKE) all --directory=$@ 31 | 32 | $(EVERYTHING_EXCEPT_ALL):: 33 | @for subdir in $(SUBDIRS); \ 34 | do \ 35 | if test -d $$subdir ; \ 36 | then \ 37 | echo "making $@ in $$subdir"; \ 38 | ( cd $$subdir && $(MAKE) $@ ) || exit 1; \ 39 | fi; \ 40 | done 41 | -------------------------------------------------------------------------------- /src/objective-c/Glacier2/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../../.. 11 | 12 | LIBNAME = $(call mklibname,Glacier2ObjC) 13 | 14 | TARGETS = $(libdir)/$(LIBNAME) 15 | 16 | SLICE_DIRS = Glacier2 17 | HEADER_DIRS = objc/Glacier2 18 | 19 | HEADERS = objc/Glacier2.h 20 | 21 | include $(top_srcdir)/config/Make.rules 22 | 23 | SLICE2OBJCFLAGS := --ice --dll-export GLACIER2_API $(SLICE2OBJCFLAGS) 24 | 25 | install:: all 26 | -------------------------------------------------------------------------------- /src/objective-c/Ice/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../../.. 11 | 12 | LIBNAME = $(call mklibname,IceObjC) 13 | 14 | TARGETS = $(libdir)/$(LIBNAME) 15 | 16 | SLICE_DIRS = Ice IceSSL 17 | HEADER_DIRS = objc/Ice objc/IceSSL 18 | SRC_DIRS = Ice IceSSL 19 | 20 | EXCLUDE_SLICE_SRCS = Ice/ObjectFactory.ice 21 | 22 | HEADERS = objc/Ice.h objc/IceSSL.h 23 | 24 | include $(top_srcdir)/config/Make.rules 25 | 26 | # Add objects from the C++ SDK 27 | OBJS += $(wildcard ../../cpp/Ice/$(PLATFORM_NAME)/*.o) \ 28 | $(wildcard ../../cpp/Ice/$(PLATFORM_NAME)/*/*.o) 29 | 30 | $(libdir)/$(LIBNAME): $(OBJS) 31 | 32 | CPPFLAGS := -I$(objcdir)/src/Ice -DICE_API_EXPORTS $(CPPFLAGS) 33 | SLICE2OBJCFLAGS := --ice --dll-export ICE_API $(SLICE2CPPFLAGS) 34 | 35 | ifneq ($(PLATFORM_NAME),macosx) 36 | SLICE2OBJCFLAGS := -DICE_USE_CFSTREAM $(SLICE2OBJCFLAGS) 37 | endif 38 | 39 | install:: all 40 | 41 | # Objective-C++ source 42 | $(call mkobjtargetpattern,$(OBJDIR)/%_mm.o): $(objcdir)/src/%.mm 43 | @$(call mkobj,$<,$@,-I$(subst ObjC,Cpp,$(includedir)) -I$(objcdir)/src -I$(cppdir)/src $(OBJCXX_CPPFLAGS)) 44 | 45 | $(includedir)/objc/Ice/ObjectFactory.h $(OBJDIR)/Ice/ObjectFactory.m: $(slicedir)/Ice/ObjectFactory.ice 46 | @$(call mkheader,$(langdir)/include/objc/Ice/ObjectFactory.h,$(includedir)/objc/Ice/ObjectFactory.h) 47 | -------------------------------------------------------------------------------- /src/objective-c/IceGrid/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../../.. 11 | 12 | LIBNAME = $(call mklibname,IceGridObjC) 13 | 14 | TARGETS = $(libdir)/$(LIBNAME) 15 | 16 | SLICE_DIRS = IceGrid 17 | HEADER_DIRS = objc/IceGrid 18 | 19 | HEADERS = objc/IceGrid.h 20 | 21 | include $(top_srcdir)/config/Make.rules 22 | 23 | SLICE2OBJCFLAGS := --ice --dll-export ICE_GRID_API $(SLICE2OBJCFLAGS) 24 | 25 | install:: all 26 | -------------------------------------------------------------------------------- /src/objective-c/IceStorm/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../../.. 11 | 12 | LIBNAME = $(call mklibname,IceStormObjC) 13 | 14 | TARGETS = $(libdir)/$(LIBNAME) 15 | 16 | SLICE_DIRS = IceStorm 17 | HEADER_DIRS = objc/IceStorm 18 | 19 | HEADERS = objc/IceStorm.h 20 | 21 | include $(top_srcdir)/config/Make.rules 22 | 23 | SLICE2OBJCFLAGS := --ice --dll-export ICE_STORM_API $(SLICE2OBJCFLAGS) 24 | 25 | install:: all 26 | -------------------------------------------------------------------------------- /src/objective-c/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../.. 11 | 12 | include $(top_srcdir)/config/Make.rules 13 | 14 | SUBDIRS = Ice Glacier2 IceStorm IceGrid 15 | 16 | .PHONY: $(EVERYTHING) $(SUBDIRS) 17 | 18 | # 19 | # Dependencies for 'all' target when using -jx 20 | # 21 | 22 | Glacier2 IceStorm IceGrid: Ice 23 | 24 | IceGrid: Glacier2 25 | 26 | all:: $(SUBDIRS) 27 | 28 | $(SUBDIRS): 29 | @echo "making all in $@" 30 | @$(MAKE) all --directory=$@ 31 | 32 | $(EVERYTHING_EXCEPT_ALL):: 33 | @for subdir in $(SUBDIRS); \ 34 | do \ 35 | if test -d $$subdir ; \ 36 | then \ 37 | echo "making $@ in $$subdir"; \ 38 | ( cd $$subdir && $(MAKE) $@ ) || exit 1; \ 39 | fi; \ 40 | done 41 | -------------------------------------------------------------------------------- /src/translators/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../.. 11 | 12 | TARGETS = $(top_srcdir)/lib/IceTouch/Cpp/bin/slice2cpp $(top_srcdir)/lib/IceTouch/ObjC/bin/slice2objc 13 | 14 | # Compile sources from the the IceUtil, Slice directories 15 | SRC_DIRS := IceUtil Slice 16 | 17 | SLICE2CPP_SRCS := slice2cpp/Main.cpp slice2cpp/Gen.cpp 18 | SLICE2OBJC_SRCS := slice2objc/Main.cpp slice2objc/Gen.cpp 19 | 20 | SRCS := $(SLICE2CPP_SRCS) $(SLICE2OBJC_SRCS) 21 | 22 | # Don't compile the sources below, they aren't needed for translators. 23 | EXCLUDE_SRCS := IceUtil/CountDownLatch.cpp \ 24 | IceUtil/StopWatch.cpp \ 25 | IceUtil/Timer.cpp \ 26 | IceUtil/Thread.cpp \ 27 | Slice/Grammar.cpp \ 28 | Slice/Scanner.cpp \ 29 | Slice/DotNetNames.cpp \ 30 | Slice/CsUtil.cpp \ 31 | Slice/JavaUtil.cpp \ 32 | Slice/Python.cpp \ 33 | Slice/PythonUtil.cpp \ 34 | Slice/PHPUtil.cpp \ 35 | Slice/Ruby.cpp \ 36 | Slice/RubyUtil.cpp 37 | 38 | FLEXFLAGS := -L 39 | BISONFLAGS := --name-prefix "slice_" -dvt 40 | 41 | COMPILE_TRANSLATORS = yes 42 | 43 | include $(top_srcdir)/config/Make.rules 44 | 45 | SLICE2CPP_OBJS = $(filter-out $(OBJDIR)/slice2objc/%,$(OBJS)) $(OBJDIR)/Grammar.o $(OBJDIR)/Scanner.o 46 | SLICE2OBJC_OBJS = $(filter-out $(OBJDIR)/slice2cpp/%,$(OBJS)) $(OBJDIR)/Grammar.o $(OBJDIR)/Scanner.o 47 | 48 | $(top_srcdir)/lib/IceTouch/Cpp/bin/slice2cpp: $(SLICE2CPP_OBJS) 49 | $(CXX) $(LDFLAGS) $(LDEXEFLAGS) -o $@ $(SLICE2CPP_OBJS) $(MCPP_LIBS) 50 | 51 | $(top_srcdir)/lib/IceTouch/ObjC/bin/slice2objc: $(SLICE2OBJC_OBJS) 52 | $(CXX) $(LDFLAGS) $(LDEXEFLAGS) -o $@ $(SLICE2OBJC_OBJS) $(MCPP_LIBS) 53 | 54 | %.o: %.cpp 55 | @$(call mkobj,$<,$@,-I$(cppdir)/src $(CPPFLAGS),$(CXX)) 56 | 57 | $(OBJDIR)/Grammar.h $(OBJDIR)/Grammar.cpp: $(cppdir)/src/Slice/Grammar.y | $(OBJDIR) 58 | @rm -f Grammar.h Grammar.cpp 59 | bison $(BISONFLAGS) $< 60 | @mv Grammar.tab.c $(OBJDIR)/Grammar.cpp 61 | @mv Grammar.tab.h $(OBJDIR)/Grammar.h 62 | @rm -f Grammar.output 63 | 64 | $(OBJDIR)/Scanner.cpp: $(cppdir)/src/Slice/Scanner.l | $(OBJDIR) 65 | flex $(FLEXFLAGS) $< 66 | @rm -f $@ 67 | @echo '#include ' >> $@ 68 | @cat lex.yy.c >> $@ 69 | @rm -f lex.yy.c 70 | 71 | clean:: 72 | rm -f Scanner.cpp Grammar.cpp Grammar.h 73 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = .. 11 | 12 | include $(top_srcdir)/config/Make.rules 13 | 14 | SUBDIRS = cpp objective-c 15 | 16 | .PHONY: $(EVERYTHING) $(SUBDIRS) 17 | 18 | all:: $(SUBDIRS) 19 | 20 | $(SUBDIRS): 21 | @echo "making all in $@" 22 | @$(MAKE) all --directory=$@ 23 | 24 | $(EVERYTHING_EXCEPT_ALL):: 25 | @for subdir in $(SUBDIRS); \ 26 | do \ 27 | echo "making $@ in $$subdir"; \ 28 | ( cd $$subdir && $(MAKE) $@ ) || exit 1; \ 29 | done 30 | -------------------------------------------------------------------------------- /test/cpp/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../.. 11 | 12 | include $(top_srcdir)/config/Make.rules 13 | 14 | SUBDIRS = Ice/admin \ 15 | Ice/ami \ 16 | Ice/adapterDeactivation \ 17 | Ice/binding \ 18 | Ice/defaultServant \ 19 | Ice/defaultValue \ 20 | Ice/dispatcher \ 21 | Ice/enums \ 22 | Ice/exceptions \ 23 | Ice/facets \ 24 | Ice/hash \ 25 | Ice/hold \ 26 | Ice/inheritance \ 27 | Ice/interceptor \ 28 | Ice/invoke \ 29 | Ice/location \ 30 | Ice/metrics \ 31 | Ice/objects \ 32 | Ice/operations \ 33 | Ice/optional \ 34 | Ice/proxy \ 35 | Ice/retry \ 36 | Ice/stream \ 37 | Ice/info \ 38 | Ice/timeout \ 39 | Ice/services \ 40 | Ice/slicing/objects \ 41 | Ice/slicing/exceptions \ 42 | Ice/custom \ 43 | Ice/servantLocator \ 44 | Ice/udp 45 | 46 | ifeq ($(PLATFORM_NAME),macosx) 47 | SUBDIRS:= $(SUBDIRS) \ 48 | Ice/faultTolerance 49 | endif 50 | 51 | .PHONY: $(EVERYTHING) $(SUBDIRS) 52 | 53 | all:: $(addsuffix .target,$(SUBDIRS)) 54 | 55 | # 56 | # Copy the Makefile and run.py script from the C++ source tree (fix 57 | # the top_srcdir and remove the -I option from the Makefile) 58 | # 59 | %.target: 60 | @if [ ! -d $* ]; \ 61 | then \ 62 | mkdir -p $*; \ 63 | cat $(testdir)/$*/Makefile | \ 64 | sed -e 's/^top_srcdir.*= \./top_srcdir = \.\.\/\./g' -e 's/-I[\.\/a-z]* //g' > $*/Makefile; \ 65 | if [ -f $(testdir)/$*/run.py ]; \ 66 | then \ 67 | cat $(testdir)/$*/run.py | \ 68 | sed -e 's/"scripts", "TestUtil\.py"/"allTests\.py"/g' -e 's/path\[0\]/path[0], "ice"/g' > $*/run.py; \ 69 | chmod a+x $*/run.py; \ 70 | fi; \ 71 | fi 72 | @echo "making all in $*" 73 | @$(MAKE) all --directory=$* 74 | 75 | clean:: 76 | rm -rf Ice 77 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.mode1v3 3 | *.pbxuser 4 | Bundles-* -------------------------------------------------------------------------------- /test/cpp/iPhone/container/BundleInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 12C60 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | NAME.dylib 11 | CFBundleIdentifier 12 | com.zeroc.NAME 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | NAME 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | CFPlugInDynamicRegisterFunction 26 | 27 | CFPlugInDynamicRegistration 28 | NO 29 | CFPlugInUnloadFunction 30 | 31 | DTCompiler 32 | 33 | DTPlatformBuild 34 | 4H127 35 | DTPlatformVersion 36 | GM 37 | DTSDKBuild 38 | 12C37 39 | DTSDKName 40 | macosx10.8 41 | DTXcode 42 | 0460 43 | DTXcodeBuild 44 | 4H127 45 | NSHumanReadableCopyright 46 | Copyright © 2013 ZeroC. All rights reserved. 47 | 48 | 49 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | @class TestViewController; 13 | 14 | @interface AppDelegate : NSObject 15 | { 16 | @private 17 | UIWindow *window; 18 | IBOutlet UINavigationController *navigationController; 19 | NSArray* tests; 20 | NSInteger currentTest; 21 | NSString* protocol; 22 | BOOL loop; 23 | BOOL runAll; 24 | } 25 | 26 | @property (nonatomic, retain) IBOutlet UIWindow *window; 27 | @property (nonatomic, retain) IBOutlet UINavigationController* navigationController; 28 | @property (nonatomic, readonly) NSArray* tests; 29 | @property (nonatomic) NSInteger currentTest; 30 | @property (nonatomic, retain) NSString* protocol; 31 | @property (nonatomic) BOOL loop; 32 | @property (readonly) BOOL runAll; 33 | 34 | -(BOOL)testCompleted:(BOOL)success; 35 | 36 | @end 37 | 38 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Classes/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | struct TestData 15 | { 16 | NSString* name; 17 | NSString* prefix; 18 | NSString* client; 19 | NSString* server; 20 | NSString* serverAMD; 21 | NSString* collocated; 22 | bool sslSupport; 23 | bool wsSupport; 24 | bool runWithSlicedFormat; 25 | bool runWith10Encoding; 26 | }; 27 | 28 | static NSString* protocols[] = { @"tcp", @"ssl", @"ws", @"wss" }; 29 | const int nProtocols = sizeof(protocols) / sizeof(NSString*); 30 | 31 | static const struct TestData alltests[] = 32 | { 33 | // 34 | // | Name | lib base name | client | server | amdserver | collocated | ssl support | ws support sliced | encoding 1.0 | 35 | // 36 | { @"proxy", @"Ice_proxy_", @"client.bundle", @"server.bundle", @"serveramd.bundle", @"collocated.bundle", true, true, false, false }, 37 | { @"operations", @"Ice_operations_", @"client.bundle", @"server.bundle", @"serveramd.bundle", @"collocated.bundle", true, true, false, false }, 38 | { @"exceptions", @"Ice_exceptions_", @"client.bundle", @"server.bundle", @"serveramd.bundle", @"collocated.bundle", true, true, true, true }, 39 | { @"ami", @"Ice_ami_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 40 | { @"info", @"Ice_info_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 41 | { @"inheritance", @"Ice_inheritance_", @"client.bundle", @"server.bundle", 0, @"collocated.bundle", true, true, false, false}, 42 | { @"facets", @"Ice_facets_", @"client.bundle", @"server.bundle", 0, @"collocated.bundle", true, true, false, false }, 43 | { @"objects", @"Ice_objects_", @"client.bundle", @"server.bundle", 0, @"collocated.bundle", true, true, true, true }, 44 | { @"optional", @"Ice_optional_", @"client.bundle", @"server.bundle", 0, 0, true, true, true, false }, 45 | { @"binding", @"Ice_binding_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 46 | { @"location", @"Ice_location_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 47 | { @"adapterDeactivation", @"Ice_adapterDeactivation_", @"client.bundle", @"server.bundle", 0, @"collocated.bundle", true, true, false, false }, 48 | { @"slicing/exceptions", @"Ice_slicing_exceptions_", @"client.bundle", @"server.bundle", @"serveramd.bundle", 0, true, true, false, true }, 49 | { @"slicing/objects", @"Ice_slicing_objects_", @"client.bundle", @"server.bundle", @"serveramd.bundle", 0, true, true, false, true }, 50 | { @"dispatcher", @"Ice_dispatcher_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 51 | { @"stream", @"Ice_stream_", @"client.bundle", 0, 0, 0, true, true, false, false }, 52 | { @"hold", @"Ice_hold_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 53 | { @"custom", @"Ice_custom_", @"client.bundle", @"server.bundle", @"serveramd.bundle", @"collocated.bundle", true, true, false, false }, 54 | { @"retry", @"Ice_retry_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 55 | { @"timeout", @"Ice_timeout_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 56 | { @"interceptor", @"Ice_interceptor_", @"client.bundle", 0, 0, 0, true, true, false, false }, 57 | { @"udp", @"Ice_udp_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 58 | { @"defaultServant", @"Ice_defaultServant_", @"client.bundle", 0, 0, 0, true, true, false, false }, 59 | { @"defaultValue", @"Ice_defaultValue_", @"client.bundle", 0, 0, 0, true, true, false, false }, 60 | { @"servantLocator", @"Ice_servantLocator_", @"client.bundle", @"server.bundle", @"serveramd.bundle", @"collocated.bundle", true, true, false, false }, 61 | { @"invoke", @"Ice_invoke_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 62 | { @"hash", @"Ice_hash_", @"client.bundle", 0, 0, 0, true, true, false, false }, 63 | { @"admin", @"Ice_admin_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, false }, 64 | { @"metrics", @"Ice_metrics_", @"client.bundle", @"server.bundle", 0, 0, false, false, false, false }, 65 | { @"enums", @"Ice_enums_", @"client.bundle", @"server.bundle", 0, 0, true, true, false, true }, 66 | { @"services", @"Ice_services_", @"client.bundle", 0, 0, 0, true, true, false, false }, 67 | }; 68 | 69 | @implementation AppDelegate 70 | 71 | @synthesize window; 72 | @synthesize navigationController; 73 | @synthesize tests; 74 | @synthesize currentTest; 75 | @synthesize loop; 76 | @synthesize runAll; 77 | 78 | static NSString* currentTestKey = @"currentTestKey"; 79 | static NSString* protocolKey = @"protocolKey"; 80 | 81 | +(void)initialize 82 | { 83 | NSDictionary* appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: 84 | @"0", currentTestKey, 85 | @"tcp", protocolKey, 86 | nil]; 87 | [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; 88 | } 89 | 90 | -(id)init 91 | { 92 | if(self = [super init]) 93 | { 94 | self->runAll = getenv("RUNALL") != NULL; 95 | 96 | NSMutableArray* theTests = [NSMutableArray array]; 97 | for(int i = 0; i < sizeof(alltests)/sizeof(alltests[0]); ++i) 98 | { 99 | TestCase* test = [TestCase testWithName:alltests[i].name 100 | prefix:alltests[i].prefix 101 | client:alltests[i].client 102 | server:alltests[i].server 103 | serveramd:alltests[i].serverAMD 104 | collocated:alltests[i].collocated 105 | sslSupport:alltests[i].sslSupport 106 | wsSupport:alltests[i].wsSupport 107 | runWithSlicedFormat:alltests[i].runWithSlicedFormat 108 | runWith10Encoding:alltests[i].runWith10Encoding]; 109 | [theTests addObject:test]; 110 | } 111 | tests = [[theTests copy] retain]; 112 | 113 | // Initialize the application defaults. 114 | currentTest = [[NSUserDefaults standardUserDefaults] integerForKey:currentTestKey]; 115 | if(runAll || currentTest < 0 || currentTest > tests.count) 116 | { 117 | currentTest = 0; 118 | } 119 | 120 | protocol = [[NSUserDefaults standardUserDefaults] stringForKey:protocolKey]; 121 | int i = 0; 122 | for(; i < nProtocols; ++i) 123 | { 124 | if([protocols[i] isEqualToString:protocol]) 125 | { 126 | break; 127 | } 128 | } 129 | if(i == nProtocols) 130 | { 131 | protocol = @"tcp"; 132 | } 133 | 134 | loop = NO; 135 | } 136 | return self; 137 | } 138 | 139 | - (void)applicationDidFinishLaunching:(UIApplication *)application 140 | { 141 | 142 | // Override point for customization after app launch 143 | [window setRootViewController:navigationController]; 144 | [window makeKeyAndVisible]; 145 | } 146 | 147 | - (void)dealloc 148 | { 149 | [tests release]; 150 | [protocol release]; 151 | [navigationController release]; 152 | [window release]; 153 | [super dealloc]; 154 | } 155 | 156 | -(NSInteger)currentTest 157 | { 158 | return currentTest; 159 | } 160 | 161 | -(void)setCurrentTest:(NSInteger)test 162 | { 163 | currentTest = test; 164 | 165 | [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:currentTest] forKey:currentTestKey]; 166 | } 167 | 168 | -(NSString*)protocol 169 | { 170 | return protocol; 171 | } 172 | 173 | -(void)setProtocol:(NSString*)v 174 | { 175 | protocol = [v retain]; 176 | [[NSUserDefaults standardUserDefaults] setObject:v forKey:protocolKey]; 177 | } 178 | 179 | -(BOOL)testCompleted:(BOOL)success 180 | { 181 | if(success) 182 | { 183 | self.currentTest = (currentTest+1) % tests.count; 184 | if(runAll || loop) 185 | { 186 | if(self.currentTest == 0) 187 | { 188 | int i = 0; 189 | for(; i < nProtocols; ++i) 190 | { 191 | if([protocols[i] isEqualToString:protocol]) 192 | { 193 | break; 194 | } 195 | } 196 | 197 | if(++i == nProtocols && !loop) 198 | { 199 | std::cout << "\n*** Finished running all tests" << std::endl; 200 | return NO; 201 | } 202 | else 203 | { 204 | protocol = protocols[i % nProtocols]; 205 | return YES; 206 | } 207 | } 208 | return YES; 209 | } 210 | } 211 | return NO; 212 | } 213 | 214 | @end 215 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Classes/TestSelectController.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | @class TestViewController; 13 | 14 | @interface TestSelectController : UIViewController 15 | { 16 | @private 17 | IBOutlet UIPickerView* pickerView; 18 | IBOutlet UISegmentedControl* protocol; 19 | IBOutlet UISwitch* loopSwitch; 20 | NSArray* tests; 21 | TestViewController *testViewController; 22 | } 23 | 24 | -(IBAction)runTest:(id)sender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Classes/TestSelectController.m: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | @interface TestSelectController() 16 | 17 | @property (nonatomic, retain) NSArray* tests; 18 | @property (nonatomic, retain) UIPickerView* pickerView; 19 | @property (nonatomic, retain) UISegmentedControl* protocol; 20 | @property (nonatomic, retain) TestViewController* testViewController; 21 | 22 | @end 23 | 24 | @implementation TestSelectController 25 | 26 | @synthesize tests; 27 | @synthesize pickerView; 28 | @synthesize protocol; 29 | @synthesize testViewController; 30 | 31 | - (void)viewDidLoad 32 | { 33 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 34 | self.tests = appDelegate.tests; 35 | [super viewDidLoad]; 36 | } 37 | 38 | -(void)viewWillAppear:(BOOL)animated 39 | { 40 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 41 | [pickerView selectRow:appDelegate.currentTest inComponent:0 animated:NO]; 42 | for (int i = 0; i != [self.protocol numberOfSegments]; ++i) { 43 | if([[self.protocol titleForSegmentAtIndex:i] isEqualToString:[appDelegate.protocol uppercaseString]]) 44 | { 45 | self.protocol.selectedSegmentIndex = i; 46 | break; 47 | } 48 | } 49 | if(appDelegate.runAll) 50 | { 51 | [self.navigationController pushViewController:self.testViewController animated:YES]; 52 | } 53 | } 54 | 55 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 56 | { 57 | // Return YES for supported orientations 58 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 59 | } 60 | 61 | - (void)didReceiveMemoryWarning 62 | { 63 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 64 | // Release anything that's not essential, such as cached data 65 | } 66 | 67 | - (void)dealloc 68 | { 69 | [tests release]; 70 | [pickerView release]; 71 | [protocol release]; 72 | [loopSwitch release]; 73 | [testViewController release]; 74 | 75 | [super dealloc]; 76 | } 77 | 78 | -(TestViewController*)testViewController 79 | { 80 | // Instantiate the test view controller if necessary. 81 | if (testViewController == nil) 82 | { 83 | NSString* nib; 84 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 85 | { 86 | nib = @"TestView-iPad"; 87 | } 88 | else 89 | { 90 | nib = @"TestView"; 91 | } 92 | testViewController = [[TestViewController alloc] initWithNibName:nib bundle:nil]; 93 | } 94 | return testViewController; 95 | } 96 | 97 | #pragma mark - 98 | 99 | -(IBAction)runTest:(id)sender 100 | { 101 | NSInteger row = [pickerView selectedRowInComponent:0]; 102 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 103 | appDelegate.currentTest = row; 104 | appDelegate.protocol = [[protocol titleForSegmentAtIndex:[protocol selectedSegmentIndex]] lowercaseString]; 105 | appDelegate.loop = loopSwitch.isOn; 106 | 107 | TestViewController* controller = self.testViewController; 108 | [self.navigationController pushViewController:controller animated:YES]; 109 | } 110 | 111 | #pragma mark UIPickerViewDelegate 112 | 113 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component 114 | { 115 | TestCase* test = (TestCase*)[tests objectAtIndex:row]; 116 | return test.name; 117 | } 118 | 119 | #pragma mark UIPickerViewDataSource 120 | 121 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 122 | { 123 | return 1; 124 | } 125 | 126 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)componen 127 | { 128 | return tests.count; 129 | } 130 | @end 131 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Classes/TestUtil.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #ifndef TEST_UTIL_H 11 | #define TEST_UTIL_H 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | @interface TestCase : NSObject 18 | { 19 | @private 20 | 21 | NSString* name; 22 | NSString* prefix; 23 | NSString* client; 24 | NSString* server; 25 | NSString* serveramd; 26 | NSString* collocated; 27 | BOOL sslSupport; 28 | BOOL wsSupport; 29 | BOOL runWithSlicedFormat; 30 | BOOL runWith10Encoding; 31 | } 32 | 33 | +(id) testWithName:(NSString*)name 34 | prefix:(NSString*) prefix 35 | client:(NSString*) client 36 | server:(NSString*) server 37 | serveramd:(NSString*) serveramd 38 | collocated:(NSString*) collocated 39 | sslSupport:(BOOL) sslSupport 40 | wsSupport:(BOOL) wsSupport 41 | runWithSlicedFormat:(BOOL)runWithSlicedFormat 42 | runWith10Encoding:(BOOL)runWith10Encoding; 43 | 44 | -(BOOL)hasServer; 45 | -(BOOL)hasAMDServer; 46 | -(BOOL)hasCollocated; 47 | -(BOOL)isProtocolSupported:(NSString*)protocol; 48 | 49 | @property (readonly) NSString* name; 50 | @property (readonly) NSString* prefix; 51 | @property (readonly) NSString* client; 52 | @property (readonly) NSString* server; 53 | @property (readonly) NSString* serveramd; 54 | @property (readonly) NSString* collocated; 55 | @property (readonly) BOOL sslSupport; 56 | @property (readonly) BOOL wsSupport; 57 | @property (readonly) BOOL runWithSlicedFormat; 58 | @property (readonly) BOOL runWith10Encoding; 59 | 60 | @end 61 | 62 | typedef int (*MAIN_ENTRY_POINT)(int argc, char** argv, Test::MainHelper* helper); 63 | typedef int (*SHUTDOWN_ENTRY_POINT)(); 64 | 65 | enum TestConfigType { TestConfigTypeClient, TestConfigTypeServer, TestConfigTypeColloc }; 66 | enum TestConfigOption {TestConfigOptionDefault, TestConfigOptionSliced, TestConfigOptionEncoding10 }; 67 | 68 | struct TestConfig 69 | { 70 | TestConfigType type; 71 | TestConfigOption option; 72 | std::string protocol; 73 | bool hasServer; 74 | }; 75 | 76 | class MainHelperI : public Test::MainHelper 77 | { 78 | public: 79 | 80 | MainHelperI(const std::string& test, const std::string& libName, TestConfig config, 81 | id target, SEL output, SEL ready) : 82 | _test(test), 83 | _libName(libName), 84 | _config(config), 85 | _completed(false), 86 | _status(0), 87 | _target(target), 88 | _output(output), 89 | _ready(ready) 90 | { 91 | } 92 | 93 | virtual ~MainHelperI(); 94 | 95 | virtual void run(); 96 | 97 | virtual void serverReady(); 98 | 99 | virtual void shutdown(); 100 | 101 | virtual void waitForCompleted(){}; 102 | 103 | virtual bool redirect(); 104 | 105 | virtual void print(const std::string&); 106 | 107 | int 108 | status() 109 | { 110 | return _status; 111 | } 112 | 113 | private: 114 | 115 | void 116 | completed(int status) 117 | { 118 | _completed = true; 119 | _status = status; 120 | } 121 | 122 | std::string _test; 123 | std::string _libName; 124 | TestConfig _config; 125 | CFBundleRef _handle; 126 | SHUTDOWN_ENTRY_POINT _dllTestShutdown; 127 | bool _completed; 128 | int _status; 129 | 130 | id _target; 131 | SEL _ready; 132 | SEL _output; 133 | }; 134 | 135 | #endif 136 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Classes/TestUtil.mm: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #import 19 | #import 20 | #import 21 | 22 | @implementation TestCase 23 | 24 | @synthesize name; 25 | @synthesize prefix; 26 | @synthesize server; 27 | @synthesize client; 28 | @synthesize serveramd; 29 | @synthesize collocated; 30 | @synthesize sslSupport; 31 | @synthesize wsSupport; 32 | @synthesize runWithSlicedFormat; 33 | @synthesize runWith10Encoding; 34 | 35 | +(id)testWithName:(NSString*)name 36 | prefix:(NSString*) prefix 37 | client:(NSString*) client 38 | server:(NSString*) server 39 | serveramd:(NSString*) serveramd 40 | collocated:(NSString*) collocated 41 | sslSupport:(BOOL) sslSupport 42 | wsSupport:(BOOL) wsSupport 43 | runWithSlicedFormat:(BOOL)runWithSlicedFormat 44 | runWith10Encoding:(BOOL)runWith10Encoding 45 | { 46 | TestCase* t = [[TestCase alloc] init]; 47 | if(t != nil) 48 | { 49 | t->name = name; 50 | t->prefix = prefix; 51 | t->client = client; 52 | t->server = server; 53 | t->serveramd = serveramd; 54 | t->collocated = collocated; 55 | t->sslSupport = sslSupport; 56 | t->wsSupport = wsSupport; 57 | t->runWithSlicedFormat = runWithSlicedFormat; 58 | t->runWith10Encoding = runWith10Encoding; 59 | } 60 | return [t autorelease]; 61 | } 62 | 63 | -(BOOL) hasServer 64 | { 65 | return server != 0; 66 | } 67 | 68 | -(BOOL) hasAMDServer 69 | { 70 | return serveramd != 0; 71 | } 72 | 73 | -(BOOL) hasCollocated 74 | { 75 | return collocated != 0; 76 | } 77 | 78 | -(BOOL)isProtocolSupported:(NSString*)protocol 79 | { 80 | BOOL supported = YES; 81 | if(!sslSupport) 82 | { 83 | supported &= [protocol isEqualToString:@"tcp"] || [protocol isEqualToString:@"ws"]; 84 | } 85 | if(!wsSupport) 86 | { 87 | supported &= [protocol isEqualToString:@"tcp"] || [protocol isEqualToString:@"ssl"]; 88 | } 89 | return supported; 90 | } 91 | -(void)dealloc 92 | { 93 | [name release]; 94 | [prefix release]; 95 | [client release]; 96 | [server release]; 97 | [serveramd release]; 98 | [collocated release]; 99 | [super dealloc]; 100 | } 101 | 102 | @end 103 | 104 | MainHelperI::~MainHelperI() 105 | { 106 | if(_handle) 107 | { 108 | CFBundleUnloadExecutable(_handle); 109 | } 110 | } 111 | 112 | void 113 | MainHelperI::run() 114 | { 115 | // 116 | // Compose the path of the Test.bundle resources folder 117 | // 118 | NSString* bundlePath = [[NSBundle mainBundle] privateFrameworksPath]; 119 | 120 | bundlePath = [bundlePath stringByAppendingPathComponent:[NSString stringWithUTF8String:_libName.c_str()]]; 121 | 122 | NSURL* bundleURL = [NSURL fileURLWithPath:bundlePath]; 123 | _handle = CFBundleCreate(NULL, (CFURLRef)bundleURL); 124 | 125 | int status = EXIT_FAILURE; 126 | NSError* error = nil; 127 | Boolean loaded = CFBundleLoadExecutableAndReturnError(_handle, (CFErrorRef*)&error); 128 | if(error != nil || !loaded) 129 | { 130 | print([[error description] UTF8String]); 131 | completed(status); 132 | return; 133 | } 134 | 135 | void* sym = dlsym(_handle, "dllTestShutdown"); 136 | sym = CFBundleGetFunctionPointerForName(_handle, CFSTR("dllTestShutdown")); 137 | if(sym == 0) 138 | { 139 | NSString* err = [NSString stringWithFormat:@"Could not get function pointer dllTestShutdown from bundle %@", 140 | bundlePath]; 141 | print([err UTF8String]); 142 | completed(status); 143 | return; 144 | } 145 | _dllTestShutdown = (SHUTDOWN_ENTRY_POINT)sym; 146 | 147 | sym = CFBundleGetFunctionPointerForName(_handle, CFSTR("dllMain")); 148 | if(sym == 0) 149 | { 150 | NSString* err = [NSString stringWithFormat:@"Could not get function pointer dllMain from bundle %@", 151 | bundlePath]; 152 | print([err UTF8String]); 153 | completed(status); 154 | return; 155 | } 156 | 157 | MAIN_ENTRY_POINT dllMain = (MAIN_ENTRY_POINT)sym; 158 | 159 | std::vector args; 160 | if(_config.type == TestConfigTypeServer) 161 | { 162 | args.push_back("server"); 163 | } 164 | else 165 | { 166 | args.push_back("client"); 167 | } 168 | args.push_back("--Ice.NullHandleAbort=1"); 169 | args.push_back("--Ice.Warn.Connections=1"); 170 | args.push_back("--Ice.Default.Host=127.0.0.1"); 171 | args.push_back("--Ice.Trace.Network=0"); 172 | args.push_back("--Ice.Trace.Protocol=0"); 173 | 174 | if(_config.type == TestConfigTypeServer) 175 | { 176 | args.push_back("--Ice.ThreadPool.Server.Size=1"); 177 | args.push_back("--Ice.ThreadPool.Server.SizeMax=3"); 178 | args.push_back("--Ice.ThreadPool.Server.SizeWarn=0"); 179 | //args.push_back("--Ice.PrintAdapterReady=1"); 180 | args.push_back("--Ice.ServerIdleTime=30"); 181 | } 182 | 183 | args.push_back("--Ice.Default.Protocol=" + _config.protocol); 184 | if(_config.protocol == "ssl" || _config.protocol == "wss") 185 | { 186 | args.push_back("--IceSSL.CAs=cacert.der"); 187 | args.push_back("--IceSSL.CheckCertName=0"); 188 | if(_config.type == TestConfigTypeServer) 189 | { 190 | args.push_back("--IceSSL.CertFile=server.p12"); 191 | } 192 | else 193 | { 194 | args.push_back("--IceSSL.CertFile=client.p12"); 195 | } 196 | args.push_back("--IceSSL.Password=password"); 197 | args.push_back("--Ice.Override.ConnectTimeout=10000"); // COMPILERFIX: Workaround for SSL hang on iOS devices 198 | } 199 | 200 | if(_config.option == TestConfigOptionSliced) 201 | { 202 | args.push_back("--Ice.Default.SlicedFormat"); 203 | } 204 | else if(_config.option == TestConfigOptionEncoding10) 205 | { 206 | args.push_back("--Ice.Default.EncodingVersion=1.0"); 207 | } 208 | 209 | if(_config.type == TestConfigTypeServer) 210 | { 211 | if(_libName.find("serveramd") != std::string::npos) 212 | { 213 | print("Running test with AMD server & "); 214 | } 215 | else 216 | { 217 | print("Running test with "); 218 | } 219 | } 220 | else if(_config.type == TestConfigTypeClient || _config.type == TestConfigTypeColloc) 221 | { 222 | if(_config.type == TestConfigTypeColloc) 223 | { 224 | print("Running collocated test with "); 225 | } 226 | else if(!_config.hasServer) 227 | { 228 | print("Running test with "); 229 | } 230 | print(_config.protocol + " and "); 231 | if(_config.option == TestConfigOptionDefault) 232 | { 233 | print("default format.\n"); 234 | } 235 | else if(_config.option == TestConfigOptionSliced) 236 | { 237 | print("sliced format.\n"); 238 | } 239 | else if(_config.option == TestConfigOptionEncoding10) 240 | { 241 | print("1.0 encoding.\n"); 242 | } 243 | } 244 | 245 | char** argv = new char*[args.size() + 1]; 246 | for(unsigned int i = 0; i < args.size(); ++i) 247 | { 248 | argv[i] = const_cast(args[i].c_str()); 249 | } 250 | argv[args.size()] = 0; 251 | try 252 | { 253 | status = dllMain(static_cast(args.size()), argv, this); 254 | } 255 | catch(const std::exception& ex) 256 | { 257 | print("unexpected exception while running `" + _test + "':\n" + ex.what()); 258 | } 259 | catch(...) 260 | { 261 | print("unexpected unknown exception while running `" + _test + "'"); 262 | } 263 | completed(status); 264 | delete[] argv; 265 | } 266 | 267 | void 268 | MainHelperI::serverReady() 269 | { 270 | [_target performSelectorOnMainThread:_ready withObject:nil waitUntilDone:NO]; 271 | } 272 | 273 | void 274 | MainHelperI::shutdown() 275 | { 276 | if(_dllTestShutdown) 277 | { 278 | _dllTestShutdown(); 279 | } 280 | } 281 | 282 | bool 283 | MainHelperI::redirect() 284 | { 285 | return _config.type == TestConfigTypeClient || _config.type == TestConfigTypeColloc; 286 | } 287 | 288 | void 289 | MainHelperI::print(const std::string& msg) 290 | { 291 | [_target performSelectorOnMainThread:_output withObject:[NSString stringWithUTF8String: msg.c_str()] 292 | waitUntilDone:NO]; 293 | } 294 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Classes/TestViewController.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | #import 12 | 13 | @interface TestViewController : UIViewController 14 | { 15 | @private 16 | IBOutlet UITableView* output; 17 | IBOutlet UIActivityIndicatorView* activity; 18 | IBOutlet UIButton* nextButton; 19 | 20 | NSMutableString* currentMessage; 21 | NSMutableArray* messages; 22 | NSOperationQueue* queue; 23 | TestCase* test; 24 | NSEnumerator* testRunEnumator; 25 | bool reloadScheduled; 26 | } 27 | -(IBAction)next:(id)sender; 28 | -(NSOperationQueue*) queue; 29 | @end 30 | 31 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Default-568h@2x.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Ice Touch C++ Test Suite-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Test Suite 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIcons 12 | 13 | CFBundleIcons~ipad 14 | 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | ${PRODUCT_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | NSMainNibFile~ipad 32 | MainWindow-iPad 33 | UIRequiresFullScreen 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Ice Touch C++ Test Suite_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'container' target in the 'container' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "test_suite-Small@2x-1.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "test_suite-Small@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "test_suite-Small-40@2x-1.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "test_suite-Small-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "test_suite-Small-40@3x-1.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "New icon-60@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "29x29", 41 | "idiom" : "ipad", 42 | "filename" : "test_suite-Small.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "test_suite-Small@2x-2.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "40x40", 53 | "idiom" : "ipad", 54 | "filename" : "test_suite-Small-40.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "test_suite-Small-40@2x-2.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "76x76", 65 | "idiom" : "ipad", 66 | "filename" : "test_suite-76.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "test_suite-76@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "83.5x83.5", 77 | "idiom" : "ipad", 78 | "filename" : "test_suite-83@2x.png", 79 | "scale" : "2x" 80 | } 81 | ], 82 | "info" : { 83 | "version" : 1, 84 | "author" : "xcode" 85 | } 86 | } -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/New icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/New icon-60@3x.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-76.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-76@2x.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-83@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-83@2x.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@2x-1.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@2x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@2x-2.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@3x-1.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@3x.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@2x-1.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@2x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@2x-2.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/cpp/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@3x.png -------------------------------------------------------------------------------- /test/cpp/iPhone/container/MainWindow-iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/README.md: -------------------------------------------------------------------------------- 1 | This project builds the IceTouch C++ Test Suite application for running tests with the 2 | iOS simulator or on an iOS device. 3 | 4 | You should use the "IceTouch C++ Test Suite iOS 7" target if you plan to run the tests on 5 | an iOS 7.x device, use the "IceTouch C++ Test Suite" target otherwise. Bundles are not signed 6 | with the iOS 7 target (iOS 7.x doesn't support loading signed bundles). 7 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/TestSelect-iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 47 | 48 | 49 | 50 | 51 | 52 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/TestSelect.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 47 | 48 | 49 | 50 | 51 | 52 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/TestView-iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/TestView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /test/cpp/iPhone/container/dummy.ice: -------------------------------------------------------------------------------- 1 | // 2 | // Dummy Slice file to enable Slice Xcode Plug-in 3 | // -------------------------------------------------------------------------------- /test/cpp/iPhone/container/main.m: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | int main(int argc, char *argv[]) { 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /test/objective-c/Makefile: -------------------------------------------------------------------------------- 1 | # ********************************************************************** 2 | # 3 | # Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | # 5 | # This copy of Ice Touch is licensed to you under the terms described 6 | # in the ICE_LICENSE file included in this distribution. 7 | # 8 | # ********************************************************************** 9 | 10 | top_srcdir = ../.. 11 | 12 | include $(top_srcdir)/config/Make.rules 13 | 14 | ifeq ($(PLATFORM_NAME),macosx) 15 | SUBDIRS = Common \ 16 | Ice/proxy \ 17 | Ice/acm \ 18 | Ice/admin \ 19 | Ice/ami \ 20 | Ice/operations \ 21 | Ice/exceptions \ 22 | Ice/inheritance \ 23 | Ice/facets \ 24 | Ice/objects \ 25 | Ice/optional \ 26 | Ice/interceptor \ 27 | Ice/invoke \ 28 | Ice/dispatcher \ 29 | Ice/defaultServant \ 30 | Ice/defaultValue \ 31 | Ice/enums \ 32 | Ice/faultTolerance \ 33 | Ice/location \ 34 | Ice/adapterDeactivation \ 35 | Ice/slicing/objects \ 36 | Ice/slicing/exceptions \ 37 | Ice/binding \ 38 | Ice/hold \ 39 | Ice/retry \ 40 | Ice/stream \ 41 | Ice/timeout \ 42 | Ice/hash \ 43 | Ice/info \ 44 | Ice/metrics \ 45 | Ice/services \ 46 | Ice/servantLocator 47 | else 48 | SUBDIRS = 49 | endif 50 | 51 | # Make sure we build $(top_srcdir)/test/lib/TestCommon as a static library 52 | export STATICLIBS = yes 53 | 54 | .PHONY: $(EVERYTHING) $(SUBDIRS) 55 | 56 | all:: $(addsuffix .target,$(SUBDIRS)) 57 | 58 | # 59 | # Copy the Makefile and run.py script from the Objective-C source tree (fix 60 | # the top_srcdir and remove the -I option from the Makefile) 61 | # 62 | %.target: 63 | @if [ ! -d $* ]; \ 64 | then \ 65 | mkdir -p $*; \ 66 | cat $(testdir)/$*/Makefile | \ 67 | sed -e 's/^top_srcdir.*= \./top_srcdir = \.\.\/\./g' -e 's/-I[\.\/a-z]* //g' > $*/Makefile; \ 68 | if [ -f $(testdir)/$*/run.py ]; \ 69 | then \ 70 | cat $(testdir)/$*/run.py | \ 71 | sed -e 's/"scripts", "TestUtil\.py"/"allTests\.py"/g' -e 's/path\[0\]/path[0], "ice"/g' > $*/run.py; \ 72 | chmod a+x $*/run.py; \ 73 | fi; \ 74 | fi 75 | @echo "making all in $*" 76 | @$(MAKE) all --directory=$* 77 | 78 | $(addsuffix .target,$(filter-out Common,$(SUBDIRS))): Common.target 79 | 80 | clean:: 81 | rm -rf Common 82 | rm -rf Ice 83 | rm -rf $(top_srcdir)/test/lib 84 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.mode1v3 3 | *.pbxuser 4 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | @class TestViewController; 13 | 14 | @interface AppDelegate : NSObject 15 | { 16 | @private 17 | UIWindow *window; 18 | IBOutlet UINavigationController *navigationController; 19 | NSArray* tests; 20 | NSInteger currentTest; 21 | NSString* protocol; 22 | BOOL loop; 23 | BOOL runAll; 24 | } 25 | 26 | @property (nonatomic, retain) IBOutlet UIWindow *window; 27 | @property (nonatomic, retain) IBOutlet UINavigationController* navigationController; 28 | @property (nonatomic, readonly) NSArray* tests; 29 | @property (nonatomic) NSInteger currentTest; 30 | @property (nonatomic, retain) NSString* protocol; 31 | @property (nonatomic) BOOL loop; 32 | @property (readonly) BOOL runAll; 33 | 34 | -(BOOL)testCompleted:(BOOL)success; 35 | 36 | @end 37 | 38 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Classes/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | struct TestCases 15 | { 16 | NSString* __unsafe_unretained name; 17 | int (*startServer)(int, char**); 18 | int (*startClient)(int, char**); 19 | bool sslSupport; 20 | bool wsSupport; 21 | bool runWithSlicedFormat; 22 | bool runWith10Encoding; 23 | }; 24 | 25 | static NSString* protocols[] = { @"tcp", @"ssl", @"ws", @"wss" }; 26 | const int nProtocols = sizeof(protocols) / sizeof(NSString*); 27 | 28 | int adapterDeactivationServer(int, char**); 29 | int adapterDeactivationClient(int, char**); 30 | int adminServer(int, char**); 31 | int adminClient(int, char**); 32 | int amiServer(int, char**); 33 | int amiClient(int, char**); 34 | int bindingServer(int, char**); 35 | int bindingClient(int, char**); 36 | int defaultServantServer(int, char**); 37 | int defaultServantClient(int, char**); 38 | int defaultValueClient(int, char**); 39 | int dispatcherServer(int, char**); 40 | int dispatcherClient(int, char**); 41 | int enumServer(int, char**); 42 | int enumClient(int, char**); 43 | int exceptionsServer(int, char**); 44 | int exceptionsClient(int, char**); 45 | int facetsServer(int, char**); 46 | int facetsClient(int, char**); 47 | int holdServer(int, char**); 48 | int holdClient(int, char**); 49 | int inheritanceServer(int, char**); 50 | int inheritanceClient(int, char**); 51 | int interceptorServer(int, char**); 52 | int interceptorClient(int, char**); 53 | int invokeServer(int, char**); 54 | int invokeClient(int, char**); 55 | int locationServer(int, char**); 56 | int locationClient(int, char**); 57 | int objectsServer(int, char**); 58 | int objectsClient(int, char**); 59 | int operationsServer(int, char**); 60 | int operationsClient(int, char**); 61 | int optionalServer(int, char**); 62 | int optionalClient(int, char**); 63 | int proxyServer(int, char**); 64 | int proxyClient(int, char**); 65 | int retryServer(int, char**); 66 | int retryClient(int, char**); 67 | int streamClient(int, char**); 68 | int timeoutServer(int, char**); 69 | int timeoutClient(int, char**); 70 | int slicingExceptionsServer(int, char**); 71 | int slicingExceptionsClient(int, char**); 72 | int hashClient(int, char**); 73 | int infoServer(int, char**); 74 | int infoClient(int, char**); 75 | int metricsServer(int, char**); 76 | int metricsClient(int, char**); 77 | int servicesClient(int, char**); 78 | 79 | static const struct TestCases alltests[] = 80 | { 81 | // 82 | // Name | Server | Client | SSL Support | WS Support | Sliced | 1.0 Encoding | 83 | // 84 | { @"proxy", proxyServer, proxyClient, true, true, false, false }, 85 | { @"admin", adminServer, adminClient, true, true, false, false }, 86 | { @"ami", amiServer, amiClient, true, true, false, false }, 87 | { @"operations", operationsServer, operationsClient, true, true, false, false }, 88 | { @"exceptions", exceptionsServer, exceptionsClient, true, true, true, true }, 89 | { @"inheritance", inheritanceServer, inheritanceClient, true, true, false, false }, 90 | { @"invoke", invokeServer, invokeClient, true, true, false, false }, 91 | { @"metrics", metricsServer, metricsClient, false, false, false, false}, 92 | { @"facets", facetsServer, facetsClient, true, true, false, false }, 93 | { @"objects", objectsServer, objectsClient, true, true, true, true }, 94 | { @"optional", optionalServer, optionalClient, true, true, true, false }, 95 | { @"interceptor", interceptorServer, interceptorClient, true, true, false, false }, 96 | { @"dispatcher", dispatcherServer, dispatcherClient, true, true, false, false }, 97 | { @"defaultServant", defaultServantServer, defaultServantClient, true, true, false, false }, 98 | { @"defaultValue", 0, defaultValueClient, true, true, false, false }, 99 | { @"binding", bindingServer, bindingClient, true, true, false, false }, 100 | { @"hold", holdServer, holdClient, true, true, false, false }, 101 | { @"location", locationServer, locationClient, true, true, false, false }, 102 | { @"adapterDeactivation", adapterDeactivationServer, adapterDeactivationClient, true, true, false, false }, 103 | { @"stream", 0, streamClient, true, true, false, true }, 104 | { @"slicing/exceptions", slicingExceptionsServer, slicingExceptionsClient, true, true, false, true }, 105 | // 106 | // Slicing objects will not work as both applications are linked in the same executable 107 | // and have knowledge of the same Slice types. 108 | // 109 | //{ @"slicing/objects",slicingObjectsServer, slicingObjectsClient, true, false, true }, 110 | { @"retry",retryServer, retryClient, true, true, false, false }, 111 | { @"timeout",timeoutServer, timeoutClient, true, true, false, false }, 112 | { @"hash", 0, hashClient, true, true, false, false }, 113 | { @"info",infoServer, infoClient, true, true, false , false }, 114 | { @"enums", enumServer, enumClient, true, true, false, true }, 115 | { @"services", 0, servicesClient, true, true, false, false } 116 | }; 117 | 118 | @implementation AppDelegate 119 | 120 | @synthesize window; 121 | @synthesize navigationController; 122 | @synthesize tests; 123 | @synthesize currentTest; 124 | @synthesize protocol; 125 | @synthesize loop; 126 | @synthesize runAll; 127 | 128 | static NSString* currentTestKey = @"currentTestKey"; 129 | static NSString* protocolKey = @"protocolKey"; 130 | 131 | +(void)initialize 132 | { 133 | NSDictionary* appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: 134 | @"0", currentTestKey, 135 | @"tcp", protocolKey, 136 | nil]; 137 | [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; 138 | } 139 | 140 | -(id)init 141 | { 142 | if(self = [super init]) 143 | { 144 | self->runAll = getenv("RUNALL") != NULL; 145 | 146 | NSMutableArray* theTests = [NSMutableArray array]; 147 | for(int i = 0; i < sizeof(alltests)/sizeof(alltests[0]); ++i) 148 | { 149 | Test* test = [Test testWithName:alltests[i].name 150 | server:alltests[i].startServer 151 | client:alltests[i].startClient 152 | sslSupport:alltests[i].sslSupport 153 | wsSupport:alltests[i].wsSupport 154 | runWithSlicedFormat:alltests[i].runWithSlicedFormat 155 | runWith10Encoding:alltests[i].runWith10Encoding]; 156 | [theTests addObject:test]; 157 | } 158 | tests = [theTests copy]; 159 | #if defined(__clang__) && !__has_feature(objc_arc) 160 | [tests retain]; 161 | #endif 162 | // Initialize the application defaults. 163 | currentTest = [[NSUserDefaults standardUserDefaults] integerForKey:currentTestKey]; 164 | if(runAll || currentTest < 0 || currentTest > tests.count) 165 | { 166 | currentTest = 0; 167 | } 168 | 169 | protocol = [[NSUserDefaults standardUserDefaults] stringForKey:protocolKey]; 170 | int i = 0; 171 | for(; i < nProtocols; ++i) 172 | { 173 | if([protocols[i] isEqualToString:protocol]) 174 | { 175 | break; 176 | } 177 | } 178 | if(i == nProtocols) 179 | { 180 | protocol = @"tcp"; 181 | } 182 | 183 | loop = NO; 184 | } 185 | return self; 186 | } 187 | 188 | - (void)applicationDidFinishLaunching:(UIApplication *)application 189 | { 190 | 191 | // Override point for customization after app launch 192 | [window setRootViewController:navigationController]; 193 | [window makeKeyAndVisible]; 194 | } 195 | 196 | #if defined(__clang__) && !__has_feature(objc_arc) 197 | - (void)dealloc 198 | { 199 | [tests release]; 200 | [protocol release]; 201 | [navigationController release]; 202 | [window release]; 203 | [super dealloc]; 204 | } 205 | #endif 206 | 207 | -(NSInteger)currentTest 208 | { 209 | return currentTest; 210 | } 211 | 212 | -(void)setCurrentTest:(NSInteger)test 213 | { 214 | currentTest = test; 215 | 216 | [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:currentTest] forKey:currentTestKey]; 217 | } 218 | 219 | -(NSString*)protocol 220 | { 221 | return protocol; 222 | } 223 | 224 | -(void)setprotocol:(NSString*)v 225 | { 226 | protocol = v; 227 | [[NSUserDefaults standardUserDefaults] setObject:protocol forKey:protocolKey]; 228 | } 229 | 230 | -(BOOL)testCompleted:(BOOL)success 231 | { 232 | if(success) 233 | { 234 | self.currentTest = (currentTest+1) % tests.count; 235 | if(runAll || loop) 236 | { 237 | if(self.currentTest == 0) 238 | { 239 | int i = 0; 240 | for(; i < nProtocols; ++i) 241 | { 242 | if([protocols[i] isEqualToString:protocol]) 243 | { 244 | break; 245 | } 246 | } 247 | 248 | if(++i == nProtocols && !loop) 249 | { 250 | return NO; 251 | } 252 | else 253 | { 254 | protocol = protocols[i % nProtocols]; 255 | } 256 | } 257 | return YES; 258 | } 259 | } 260 | return NO; 261 | } 262 | 263 | @end 264 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Classes/Test.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | 13 | @interface Test : NSObject 14 | { 15 | @private 16 | int (*server)(int,char**); 17 | int (*client)(int,char**); 18 | NSString* name; 19 | BOOL sslSupport; 20 | BOOL wsSupport; 21 | BOOL runWithSlicedFormat; 22 | BOOL runWith10Encoding; 23 | } 24 | 25 | +(id) testWithName:(const NSString*)name 26 | server:(int (*)(int, char**))server 27 | client:(int (*)(int, char**))client 28 | sslSupport:(BOOL)sslSupport 29 | wsSupport:(BOOL)wsSupport 30 | runWithSlicedFormat:(BOOL)runWithSlicedFormat 31 | runWith10Encoding:(BOOL)runWith10Encoding; 32 | 33 | -(BOOL)hasServer; 34 | -(BOOL)isProtocolSupported:(NSString*)protocol; 35 | -(int)server; 36 | -(int)client; 37 | 38 | @property (readonly) NSString* name; 39 | @property (readonly) BOOL sslSupport; 40 | @property (readonly) BOOL wsSupport; 41 | @property (readonly) BOOL runWithSlicedFormat; 42 | @property (readonly) BOOL runWith10Encoding; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Classes/Test.m: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | #include 12 | 13 | @implementation Test 14 | 15 | @synthesize name; 16 | @synthesize sslSupport; 17 | @synthesize wsSupport; 18 | @synthesize runWithSlicedFormat; 19 | @synthesize runWith10Encoding; 20 | 21 | +(id)testWithName:(NSString*)name 22 | server:(int (*)(int, char**))server 23 | client:(int (*)(int, char**))client 24 | sslSupport:(BOOL)sslSupport 25 | wsSupport:(BOOL)wsSupport 26 | runWithSlicedFormat:(BOOL)runWithSlicedFormat 27 | runWith10Encoding:(BOOL)runWith10Encoding 28 | { 29 | Test* t = [[Test alloc] init]; 30 | if(t != nil) 31 | { 32 | t->name = name; 33 | t->server = server; 34 | t->client = client; 35 | t->sslSupport = sslSupport; 36 | t->wsSupport = wsSupport; 37 | t->runWithSlicedFormat = runWithSlicedFormat; 38 | t->runWith10Encoding = runWith10Encoding; 39 | } 40 | #if defined(__clang__) && !__has_feature(objc_arc) 41 | return [t autorelease]; 42 | #else 43 | return t; 44 | #endif 45 | } 46 | -(BOOL) hasServer 47 | { 48 | return server != 0; 49 | } 50 | -(BOOL)isProtocolSupported:(NSString*)protocol 51 | { 52 | BOOL supported = YES; 53 | if(!sslSupport) 54 | { 55 | supported &= [protocol isEqualToString:@"tcp"] || [protocol isEqualToString:@"ws"]; 56 | } 57 | if(!wsSupport) 58 | { 59 | supported &= [protocol isEqualToString:@"tcp"] || [protocol isEqualToString:@"ssl"]; 60 | } 61 | return supported; 62 | } 63 | -(int)server 64 | { 65 | NSAssert(server != 0, @"server != 0"); 66 | int argc = 0; 67 | char** argv = 0; 68 | return (*server)(argc, argv); 69 | } 70 | 71 | -(int)client 72 | { 73 | int argc = 0; 74 | char** argv = 0; 75 | 76 | NSAssert(client != 0, @"client != 0"); 77 | return (*client)(argc, argv); 78 | } 79 | 80 | #if defined(__clang__) && !__has_feature(objc_arc) 81 | -(void)dealloc 82 | { 83 | [name release]; 84 | [super dealloc]; 85 | } 86 | #endif 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Classes/TestSelectController.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | @class TestViewController; 13 | 14 | @interface TestSelectController : UIViewController 15 | { 16 | @private 17 | IBOutlet UIPickerView* pickerView; 18 | IBOutlet UISegmentedControl* protocol; 19 | IBOutlet UISwitch* loopSwitch; 20 | NSArray* tests; 21 | TestViewController *testViewController; 22 | } 23 | 24 | -(IBAction)runTest:(id)sender; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Classes/TestSelectController.m: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | @interface TestSelectController() 16 | 17 | @property (nonatomic, retain) NSArray* tests; 18 | @property (nonatomic, retain) UIPickerView* pickerView; 19 | @property (nonatomic, retain) UISwitch* sslSwitch; 20 | @property (nonatomic, retain) UISegmentedControl* protocol; 21 | @property (nonatomic, retain) TestViewController* testViewController; 22 | 23 | @end 24 | 25 | @implementation TestSelectController 26 | 27 | @synthesize tests; 28 | @synthesize pickerView; 29 | @synthesize protocol; 30 | @synthesize testViewController; 31 | 32 | - (void)viewDidLoad 33 | { 34 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 35 | self.tests = appDelegate.tests; 36 | [super viewDidLoad]; 37 | } 38 | 39 | -(void)viewWillAppear:(BOOL)animated 40 | { 41 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 42 | [pickerView selectRow:appDelegate.currentTest inComponent:0 animated:NO]; 43 | for (int i = 0; i != [self.protocol numberOfSegments]; ++i) 44 | { 45 | if([[self.protocol titleForSegmentAtIndex:i] isEqualToString:[appDelegate.protocol uppercaseString]]) 46 | { 47 | self.protocol.selectedSegmentIndex = i; 48 | break; 49 | } 50 | } 51 | 52 | if(appDelegate.runAll) 53 | { 54 | [self.navigationController pushViewController:self.testViewController animated:YES]; 55 | } 56 | } 57 | 58 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 59 | { 60 | // Return YES for supported orientations 61 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 62 | } 63 | 64 | - (void)didReceiveMemoryWarning 65 | { 66 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 67 | // Release anything that's not essential, such as cached data 68 | } 69 | 70 | #if defined(__clang__) && !__has_feature(objc_arc) 71 | - (void)dealloc 72 | { 73 | [tests release]; 74 | [pickerView release]; 75 | [protocol release]; 76 | [loopSwitch release]; 77 | [testViewController release]; 78 | 79 | [super dealloc]; 80 | } 81 | #endif 82 | 83 | -(TestViewController*)testViewController 84 | { 85 | // Instantiate the test view controller if necessary. 86 | if (testViewController == nil) 87 | { 88 | NSString* nib; 89 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 90 | { 91 | nib = @"TestView-iPad"; 92 | } 93 | else 94 | { 95 | nib = @"TestView"; 96 | } 97 | testViewController = [[TestViewController alloc] initWithNibName:nib bundle:nil]; 98 | } 99 | return testViewController; 100 | } 101 | 102 | #pragma mark - 103 | 104 | -(IBAction)runTest:(id)sender 105 | { 106 | NSUInteger row = [pickerView selectedRowInComponent:0]; 107 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 108 | appDelegate.currentTest = row; 109 | appDelegate.protocol = [[protocol titleForSegmentAtIndex:[protocol selectedSegmentIndex]] lowercaseString]; 110 | appDelegate.loop = loopSwitch.isOn; 111 | 112 | TestViewController* controller = self.testViewController; 113 | [self.navigationController pushViewController:controller animated:YES]; 114 | } 115 | 116 | #pragma mark UIPickerViewDelegate 117 | 118 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component 119 | { 120 | Test* test = (Test*)[tests objectAtIndex:row]; 121 | return test.name; 122 | } 123 | 124 | #pragma mark UIPickerViewDataSource 125 | 126 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 127 | { 128 | return 1; 129 | } 130 | 131 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)componen 132 | { 133 | return tests.count; 134 | } 135 | @end 136 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Classes/TestViewController.h: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | typedef enum 13 | { 14 | TestConfigOptionDefault, 15 | TestConfigOptionSliced, 16 | TestConfigOptionEncoding10 17 | } TestConfigOption; 18 | 19 | @class Test; 20 | 21 | @interface TestViewController : UIViewController 22 | { 23 | @private 24 | IBOutlet UITableView* output; 25 | IBOutlet UIActivityIndicatorView* activity; 26 | IBOutlet UIButton* nextButton; 27 | 28 | NSMutableString* currentMessage; 29 | NSMutableArray* messages; 30 | NSOperationQueue* queue; 31 | Test* test; 32 | NSEnumerator* testRunEnumerator; 33 | } 34 | -(IBAction)next:(id)sender; 35 | -(NSOperationQueue*) queue; 36 | @end 37 | 38 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Classes/TestViewController.m: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | #import 15 | 16 | // 17 | // Avoid warning for undocumented method. 18 | // 19 | @interface UIApplication(UndocumentedAPI) 20 | -(void)launchApplicationWithIdentifier:(NSString*)id suspended:(BOOL)flag; 21 | @end 22 | 23 | // TODO: Would be nice to have a red font for fatal, and error messages. 24 | @interface MessageCell : UITableViewCell 25 | { 26 | @private 27 | UILabel* body; 28 | } 29 | 30 | @property (nonatomic, retain) UILabel* body; 31 | 32 | +(CGFloat)heightForMessage:(NSString*)messsage; 33 | 34 | @end 35 | 36 | @implementation MessageCell 37 | @synthesize body; 38 | 39 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 40 | { 41 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) 42 | { 43 | body = [[UILabel alloc] initWithFrame:CGRectZero]; 44 | body.textColor = [UIColor blackColor]; 45 | body.font = [UIFont boldSystemFontOfSize:14]; 46 | body.numberOfLines = 0; 47 | 48 | [self.contentView addSubview:self.body]; 49 | } 50 | 51 | return self; 52 | } 53 | 54 | +(CGFloat)heightForMessage:(NSString*)text 55 | { 56 | // The header is always one line, the body is multiple lines. 57 | // The width of the table is 320 - 20px of left & right padding. We don't want to let the body 58 | // text go past 200px. 59 | CGRect body = [text boundingRectWithSize:CGSizeMake(300.f, 200.0f) options:NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14] } context:nil]; 60 | return body.size.height + 20.f; 61 | } 62 | 63 | - (void)layoutSubviews 64 | { 65 | [super layoutSubviews]; 66 | 67 | CGRect contentRect = self.contentView.bounds; 68 | 69 | CGRect bodyFrame = CGRectMake(10.f, 0.f, CGRectGetWidth(contentRect)-20.f, CGRectGetHeight(contentRect)); 70 | 71 | self.body.frame = bodyFrame; 72 | } 73 | 74 | #if defined(__clang__) && !__has_feature(objc_arc) 75 | - (void)dealloc 76 | { 77 | [body release]; 78 | [super dealloc]; 79 | } 80 | #endif 81 | 82 | -(void)setMessage:(NSString*)m 83 | { 84 | self.body.text = m; 85 | } 86 | 87 | @end 88 | 89 | @interface TestViewController() 90 | 91 | @property (nonatomic, retain) UITableView* output; 92 | @property (nonatomic, retain) UIActivityIndicatorView* activity; 93 | @property (nonatomic, retain) UIButton* nextButton; 94 | 95 | @property (nonatomic, retain) NSMutableString* currentMessage; 96 | @property (nonatomic, retain) NSMutableArray* messages; 97 | @property (nonatomic, retain) NSOperationQueue* queue; 98 | @property (retain) Test* test; 99 | 100 | -(void)add:(NSString*)d; 101 | -(void)startTest; 102 | @end 103 | 104 | @interface TestRun : NSObject 105 | { 106 | TestConfigOption option; 107 | Test* test; 108 | int completed; 109 | int error; 110 | TestViewController* viewController; 111 | } 112 | 113 | +(id) testRun:(Test*)test; 114 | +(id) testRunWithConfigOption:(Test*)test option:(TestConfigOption)option; 115 | 116 | -(NSInvocationOperation*) runInvocation:(TestViewController*)callback; 117 | @end 118 | 119 | @implementation TestViewController 120 | 121 | @synthesize output; 122 | @synthesize activity; 123 | @synthesize nextButton; 124 | @synthesize currentMessage; 125 | @synthesize messages; 126 | @synthesize queue; 127 | @synthesize test; 128 | 129 | - (void)viewDidLoad 130 | { 131 | self.currentMessage = [NSMutableString string]; 132 | self.messages = [NSMutableArray array]; 133 | queue = [[NSOperationQueue alloc] init]; 134 | self.queue.maxConcurrentOperationCount = 2; // We need at least 2 concurrent operations. 135 | TestCommonInit(self, @selector(add:)); 136 | [super viewDidLoad]; 137 | } 138 | 139 | -(void)viewWillAppear:(BOOL)animated 140 | { 141 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 142 | self.test = (Test*)[appDelegate.tests objectAtIndex:appDelegate.currentTest]; 143 | [self startTest]; 144 | } 145 | 146 | -(void)viewWillDisappear:(BOOL)animated 147 | { 148 | // TODO: Waiting isn't possible until the tests periodically find out whether 149 | // they should terminate. 150 | // Wait until the tests are complete. 151 | //[queue waitUntilAllOperationsAreFinished]; 152 | } 153 | 154 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 155 | { 156 | // Return YES for supported orientations 157 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 158 | } 159 | 160 | - (void)didReceiveMemoryWarning 161 | { 162 | [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview 163 | // Release anything that's not essential, such as cached data 164 | } 165 | 166 | #if defined(__clang__) && !__has_feature(objc_arc) 167 | - (void)dealloc 168 | { 169 | [output release]; 170 | [activity release]; 171 | [nextButton release]; 172 | 173 | [currentMessage release]; 174 | [messages release]; 175 | [queue release]; 176 | [test release]; 177 | 178 | [super dealloc]; 179 | } 180 | #endif 181 | 182 | #pragma mark - 183 | 184 | -(void)startTest 185 | { 186 | self.title = test.name; 187 | [self.navigationItem setHidesBackButton:YES animated:YES]; 188 | 189 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 190 | if(appDelegate.loop) 191 | { 192 | [nextButton setTitle:@"Stop running" forState:UIControlStateNormal]; 193 | } 194 | else 195 | { 196 | nextButton.enabled = NO; 197 | [nextButton setAlpha:0.5]; 198 | [nextButton setTitle:@"Test is running" forState:UIControlStateDisabled]; 199 | } 200 | 201 | // Clear the current message, and the the table log. 202 | [currentMessage deleteCharactersInRange:NSMakeRange(0, currentMessage.length)]; 203 | [messages removeAllObjects]; 204 | [output reloadData]; 205 | [activity startAnimating]; 206 | 207 | if(![test isProtocolSupported:appDelegate.protocol]) 208 | { 209 | tprintf("Test not supported with %s\n", [appDelegate.protocol UTF8String]); 210 | [self testComplete:YES]; 211 | return; 212 | } 213 | 214 | NSMutableArray* testRuns = [NSMutableArray array]; 215 | [testRuns addObject:[TestRun testRun:test]]; 216 | if(test.runWithSlicedFormat) 217 | { 218 | [testRuns addObject:[TestRun testRunWithConfigOption:test option:TestConfigOptionSliced]]; 219 | } 220 | if(test.runWith10Encoding) 221 | { 222 | [testRuns addObject:[TestRun testRunWithConfigOption:test option:TestConfigOptionEncoding10]]; 223 | } 224 | testRunEnumerator = [testRuns objectEnumerator]; 225 | #if defined(__clang__) && !__has_feature(objc_arc) 226 | [testRunEnumerator retain]; 227 | #endif 228 | id testRun = [testRunEnumerator nextObject]; 229 | [queue addOperation:[testRun runInvocation:self]]; 230 | } 231 | 232 | -(void)testRunComplete:(BOOL)success 233 | { 234 | if(!success) 235 | { 236 | [self testComplete:NO]; 237 | return; 238 | } 239 | 240 | id testRun = [testRunEnumerator nextObject]; 241 | if(testRun == nil) 242 | { 243 | [self testComplete:YES]; 244 | } 245 | else 246 | { 247 | [queue addOperation:[testRun runInvocation:self]]; 248 | } 249 | } 250 | 251 | -(void)testComplete:(BOOL)success 252 | { 253 | [activity stopAnimating]; 254 | 255 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 256 | Test* nextTest = (Test*)[appDelegate.tests objectAtIndex:(appDelegate.currentTest+1)%(appDelegate.tests.count)]; 257 | NSString* buttonTitle = [NSString stringWithFormat:@"Run %@", nextTest.name]; 258 | [nextButton setTitle:buttonTitle forState:UIControlStateNormal]; 259 | 260 | nextButton.enabled = YES; 261 | [nextButton setAlpha:1.0]; 262 | [self.navigationItem setHidesBackButton:NO animated:YES]; 263 | 264 | self.test = nil; 265 | #if defined(__clang__) && !__has_feature(objc_arc) 266 | [testRunEnumerator release]; 267 | #endif 268 | testRunEnumerator = nil; 269 | 270 | // For memory leak testing comment the following line out. 271 | if([appDelegate testCompleted:success]) 272 | { 273 | self.test = (Test*)[appDelegate.tests objectAtIndex:appDelegate.currentTest]; 274 | [self startTest]; 275 | } 276 | } 277 | 278 | -(IBAction)next:(id)sender 279 | { 280 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 281 | if(appDelegate.loop) 282 | { 283 | appDelegate.loop = NO; 284 | nextButton.enabled = NO; 285 | [nextButton setAlpha:0.5]; 286 | [nextButton setTitle:@"Waiting..." forState:UIControlStateDisabled]; 287 | } 288 | else 289 | { 290 | NSAssert(test == nil, @"test == nil"); 291 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 292 | self.test = (Test*)[appDelegate.tests objectAtIndex:appDelegate.currentTest]; 293 | [self startTest]; 294 | } 295 | } 296 | 297 | -(NSOperationQueue*) queue 298 | { 299 | return queue; 300 | } 301 | 302 | -(void)add:(NSString*)s 303 | { 304 | AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 305 | if(appDelegate.runAll) 306 | { 307 | printf("%s", [s UTF8String]); 308 | } 309 | 310 | [currentMessage appendString:s]; 311 | NSRange range = [currentMessage rangeOfString:@"\n" options:NSBackwardsSearch]; 312 | if(range.location != NSNotFound) 313 | { 314 | #if defined(__clang__) && !__has_feature(objc_arc) 315 | [messages addObject:[[currentMessage copy] autorelease]]; 316 | #else 317 | [messages addObject:[currentMessage copy]]; 318 | #endif 319 | [currentMessage deleteCharactersInRange:NSMakeRange(0, currentMessage.length)]; 320 | [output reloadData]; 321 | NSUInteger path[] = {0, messages.count-1}; 322 | [output scrollToRowAtIndexPath:[NSIndexPath indexPathWithIndexes:path length:2] 323 | atScrollPosition:UITableViewScrollPositionBottom 324 | animated:NO]; 325 | } 326 | } 327 | 328 | #pragma mark Methods 329 | 330 | -(NSInteger)numberOfSectionsInTableView:(UITableView *)tv 331 | { 332 | return 1; 333 | } 334 | 335 | -(NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section 336 | { 337 | return messages.count; 338 | } 339 | 340 | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 341 | { 342 | if([messages count] <= indexPath.row) 343 | { 344 | return [MessageCell heightForMessage:@""]; 345 | } 346 | return [MessageCell heightForMessage:[messages objectAtIndex:indexPath.row]]; 347 | } 348 | 349 | -(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath 350 | { 351 | MessageCell *cell = (MessageCell*)[output dequeueReusableCellWithIdentifier:@"MessageCell"]; 352 | if(cell == nil) 353 | { 354 | #if defined(__clang__) && !__has_feature(objc_arc) 355 | cell = [[[MessageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MessageCell"] autorelease]; 356 | #else 357 | cell = [[MessageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MessageCell"]; 358 | #endif 359 | } 360 | [cell setMessage:[messages objectAtIndex:indexPath.row]]; 361 | return cell; 362 | } 363 | 364 | -(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath 365 | { 366 | return nil; 367 | } 368 | 369 | @end 370 | 371 | @implementation TestRun 372 | -(id) init:(Test*)t option:(TestConfigOption)opt 373 | { 374 | self = [super init]; 375 | if(!self) 376 | { 377 | return nil; 378 | } 379 | self->test = t; 380 | self->option = opt; 381 | self->completed = 0; 382 | self->error = 0; 383 | return self; 384 | } 385 | 386 | +(id) testRun:(Test*)test 387 | { 388 | TestRun* run = [[TestRun alloc] init:test option:TestConfigOptionDefault]; 389 | #if defined(__clang__) && !__has_feature(objc_arc) 390 | [run autorelease]; 391 | #endif 392 | return run; 393 | } 394 | +(id) testRunWithConfigOption:(Test*)test option:(TestConfigOption)option 395 | { 396 | TestRun* run = [[TestRun alloc] init:test option:option]; 397 | #if defined(__clang__) && !__has_feature(objc_arc) 398 | [run autorelease]; 399 | #endif 400 | return run; 401 | } 402 | 403 | -(NSInvocationOperation*) runInvocation:(TestViewController*)ctl 404 | { 405 | viewController = ctl; 406 | #if defined(__clang__) && !__has_feature(objc_arc) 407 | return [[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(run) object:nil] autorelease]; 408 | #else 409 | return [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(run) object:nil]; 410 | #endif 411 | 412 | } 413 | 414 | -(void) run 415 | { 416 | // Initialize testCommon. 417 | AppDelegate* appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; 418 | if(appDelegate.runAll) 419 | { 420 | printf("\n*** running %s test %ld/%lu ...\n", [test.name UTF8String], (long)appDelegate.currentTest + 1, 421 | (unsigned long)[appDelegate.tests count]); 422 | printf("*** protocol: %s\n", [appDelegate.protocol UTF8String]); 423 | fflush(stdout); 424 | } 425 | 426 | TestCommonTestInit(self, 427 | @selector(serverReady), 428 | appDelegate.protocol, 429 | option == TestConfigOptionSliced, 430 | option == TestConfigOptionEncoding10); 431 | 432 | if(option == TestConfigOptionSliced) 433 | { 434 | tprintf("Running test with %s and sliced format.\n", [appDelegate.protocol UTF8String]); 435 | } 436 | else if(option == TestConfigOptionEncoding10) 437 | { 438 | tprintf("Running test with %s and 1.0 encoding.\n", [appDelegate.protocol UTF8String]); 439 | } 440 | else 441 | { 442 | tprintf("Running test with %s and default format.\n", [appDelegate.protocol UTF8String]); 443 | } 444 | 445 | if([test hasServer]) 446 | { 447 | [self runServer]; 448 | } 449 | else 450 | { 451 | [self runClient]; 452 | } 453 | } 454 | 455 | -(void)clientComplete:(NSNumber*)rc 456 | { 457 | if([rc intValue] != 0) 458 | { 459 | [viewController add:[NSString stringWithFormat:@"client error: %@!\n", rc]]; 460 | if([test hasServer]) 461 | { 462 | serverStop(); 463 | } 464 | ++error; 465 | } 466 | 467 | if(![test hasServer] || ++completed == 2) 468 | { 469 | [viewController testRunComplete:error == 0]; 470 | } 471 | } 472 | 473 | // Run in a separate thread. 474 | -(void)runClient 475 | { 476 | int rc = [test client]; 477 | [self performSelectorOnMainThread:@selector(clientComplete:) withObject:[NSNumber numberWithInt:rc] waitUntilDone:NO]; 478 | } 479 | 480 | -(void)serverComplete:(NSNumber*)rc 481 | { 482 | if([rc intValue] != 0) 483 | { 484 | [viewController add:[NSString stringWithFormat:@"server error: %@!\n", rc]]; 485 | ++error; 486 | } 487 | 488 | if(++completed == 2) 489 | { 490 | [viewController testRunComplete:error == 0]; 491 | } 492 | } 493 | 494 | // Run in a separate thread. 495 | -(void)runServer 496 | { 497 | int rc = [test server]; 498 | [self performSelectorOnMainThread:@selector(serverComplete:) withObject:[NSNumber numberWithInt:rc] waitUntilDone:NO]; 499 | } 500 | 501 | // Kick off the client. 502 | -(void)serverReady 503 | { 504 | NSInvocationOperation* invocation = [[NSInvocationOperation alloc] 505 | initWithTarget:self 506 | selector:@selector(runClient) 507 | object:nil]; 508 | #if defined(__clang__) && !__has_feature(objc_arc) 509 | [invocation autorelease]; 510 | #endif 511 | [[viewController queue] addOperation:invocation]; 512 | } 513 | @end 514 | 515 | 516 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Default-568h@2x.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Ice Touch Objective-C Test Suite_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'container' target in the 'container' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "test_suite-Small@2x-1.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "test_suite-Small@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "test_suite-Small-40@2x-1.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "test_suite-Small-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "test_suite-Small-40@3x-1.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "New icon-60@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "29x29", 41 | "idiom" : "ipad", 42 | "filename" : "test_suite-Small.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "test_suite-Small@2x-2.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "40x40", 53 | "idiom" : "ipad", 54 | "filename" : "test_suite-Small-40.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "test_suite-Small-40@2x-2.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "76x76", 65 | "idiom" : "ipad", 66 | "filename" : "test_suite-76.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "test_suite-76@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "83.5x83.5", 77 | "idiom" : "ipad", 78 | "filename" : "test_suite-83@2x.png", 79 | "scale" : "2x" 80 | } 81 | ], 82 | "info" : { 83 | "version" : 1, 84 | "author" : "xcode" 85 | } 86 | } -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/New icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/New icon-60@3x.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-76.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-76@2x.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-83@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-83@2x.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@2x-1.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@2x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@2x-2.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@3x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@3x-1.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small-40@3x.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@2x-1.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@2x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@2x-2.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeroc-ice/icetouch/3a53bc239ce50552cd0a3cfae689a308f5bcd1c2/test/objective-c/iPhone/container/Images.xcassets/AppIcon.appiconset/test_suite-Small@3x.png -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Info-ARC.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Test Suite ARC 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | NSMainNibFile 26 | MainWindow 27 | NSMainNibFile~ipad 28 | MainWindow-iPad 29 | UIRequiresFullScreen 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Test Suite 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | NSMainNibFile 26 | MainWindow 27 | NSMainNibFile~ipad 28 | MainWindow-iPad 29 | UIRequiresFullScreen 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/MainWindow-iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/TestSelect-iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 47 | 48 | 49 | 50 | 51 | 52 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/TestSelect.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 47 | 48 | 49 | 50 | 51 | 52 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/TestView-iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 37 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/TestView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /test/objective-c/iPhone/container/main.m: -------------------------------------------------------------------------------- 1 | // ********************************************************************** 2 | // 3 | // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved. 4 | // 5 | // This copy of Ice Touch is licensed to you under the terms described in the 6 | // ICE_LICENSE file included in this distribution. 7 | // 8 | // ********************************************************************** 9 | 10 | #import 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | int retVal = EXIT_FAILURE; 15 | @autoreleasepool 16 | { 17 | retVal = UIApplicationMain(argc, argv, nil, nil); 18 | } 19 | return retVal; 20 | } 21 | --------------------------------------------------------------------------------