blob: 287d5d0d4fdf7e9499ec4180826d9befaf6c297b (
plain)
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
45
46
47
48
49
50
|
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************
import sys, os
try:
import demoscript
except ImportError:
for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
toplevel = os.path.normpath(toplevel)
if os.path.exists(os.path.join(toplevel, "demoscript")):
break
else:
raise "can't find toplevel directory!"
sys.path.append(os.path.join(toplevel))
import demoscript
import demoscript.Util
demoscript.Util.defaultLanguage = "C++"
server = demoscript.Util.spawn('./server --Ice.PrintAdapterReady')
server.expect('.* ready')
client = demoscript.Util.spawn('./client')
client.expect('.*==>')
print "testing with conversion... ",
sys.stdout.flush()
client.sendline('u')
server.expect('Received \\(UTF-8\\): "Bonne journ(351)e"')
client.expect('Received: "Bonne journ\\\\303\\\\251e"')
print "ok"
print "testing without conversion... ",
client.sendline('t')
server.expect('Received \\(UTF-8\\): "Bonne journ\\\\303\\\\251e"')
client.expect('Received: "Bonne journ\\\\351e"')
print "ok"
client.sendline('s')
server.waitTestSuccess()
client.sendline('x')
client.waitTestSuccess()
|