You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2016/12/18 00:06:09 UTC
[1/3] thrift git commit: THRIFT-4006 Added removeEventListener method to TSocket.as Client: AS3 Patch: Romain Théry
Repository: thrift
Updated Branches:
refs/heads/master 0d9b713b1 -> f39d4c853
THRIFT-4006 Added removeEventListener method to TSocket.as
Client: AS3
Patch: Romain Th�ry <rt...@ankama.com>
This closes #1140
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/71e678a9
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/71e678a9
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/71e678a9
Branch: refs/heads/master
Commit: 71e678a9d4afaeddd7ac7ab8700ce04097c75676
Parents: 0d9b713
Author: Romain Th�ry <rt...@ankama.com>
Authored: Thu Dec 15 11:20:05 2016 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Sat Dec 17 19:51:35 2016 +0100
----------------------------------------------------------------------
lib/as3/src/org/apache/thrift/transport/TSocket.as | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/71e678a9/lib/as3/src/org/apache/thrift/transport/TSocket.as
----------------------------------------------------------------------
diff --git a/lib/as3/src/org/apache/thrift/transport/TSocket.as b/lib/as3/src/org/apache/thrift/transport/TSocket.as
index 6891388..c60d711 100644
--- a/lib/as3/src/org/apache/thrift/transport/TSocket.as
+++ b/lib/as3/src/org/apache/thrift/transport/TSocket.as
@@ -127,6 +127,11 @@ package org.apache.thrift.transport
{
this.eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
+
+ public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
+ {
+ this.eventDispatcher.removeEventListener(type, listener, useCapture);
+ }
public override function open():void
{
[3/3] thrift git commit: THRIFT-3886 PHP cross test client returns 0 even when failing Client: PHP Patch: Håkon Hitland
Posted by je...@apache.org.
THRIFT-3886 PHP cross test client returns 0 even when failing
Client: PHP
Patch: H�kon Hitland <ha...@zedge.net>
This closes #1131
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/f39d4c85
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/f39d4c85
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/f39d4c85
Branch: refs/heads/master
Commit: f39d4c8535472db962930fb22d733a4f32ed6fc1
Parents: 485e0c4
Author: H�kon Hitland <ha...@zedge.net>
Authored: Thu Nov 17 16:18:03 2016 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Sat Dec 17 19:52:36 2016 +0100
----------------------------------------------------------------------
test/php/TestClient.php | 127 +++++++++++++++++++++++++++++++++----------
test/tests.json | 6 ++
2 files changed, 103 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/f39d4c85/test/php/TestClient.php
----------------------------------------------------------------------
diff --git a/test/php/TestClient.php b/test/php/TestClient.php
index 2443ee0..c1f6435 100755
--- a/test/php/TestClient.php
+++ b/test/php/TestClient.php
@@ -44,6 +44,7 @@ $loader->register();
/** Include the Thrift base */
/** Include the protocols */
use Thrift\Protocol\TBinaryProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Protocol\TCompactProtocol;
use Thrift\Protocol\TJSONProtocol;
@@ -63,9 +64,16 @@ function makeProtocol($transport, $PROTO)
return new TCompactProtocol($transport);
} else if ($PROTO == 'json') {
return new TJSONProtocol($transport);
+ } else if ($PROTO == 'accel') {
+ if (!function_exists('thrift_protocol_write_binary')) {
+ echo "Acceleration extension is not loaded\n";
+ exit(1);
+ }
+ return new TBinaryProtocolAccelerated($transport);
}
- die ("--protocol must be one of {binary|compact|json}");
+ echo "--protocol must be one of {binary|compact|json|accel}\n";
+ exit(1);
}
$host = 'localhost';
@@ -114,11 +122,11 @@ $transport->open();
$start = microtime(true);
-define(ERR_BASETYPES, 1);
-// ERR_STRUCTS = 2;
-// ERR_CONTAINERS = 4;
-// ERR_EXCEPTIONS = 8;
-// ERR_UNKNOWN = 64;
+define('ERR_BASETYPES', 1);
+define('ERR_STRUCTS', 2);
+define('ERR_CONTAINERS', 4);
+define('ERR_EXCEPTIONS', 8);
+define('ERR_UNKNOWN', 64);
$exitcode = 0;
/**
* VOID TEST
@@ -132,7 +140,7 @@ function roundtrip($testClient, $method, $value) {
print_r("$method($value)");
$ret = $testClient->$method($value);
print_r(" = \"$ret\"\n");
- if ($value != $ret) {
+ if ($value !== $ret) {
print_r("*** FAILED ***\n");
$exitcode |= ERR_BASETYPES;
}
@@ -144,9 +152,18 @@ function roundtrip($testClient, $method, $value) {
roundtrip($testClient, 'testString', "Test");
/**
+ * BOOL TEST
+ */
+roundtrip($testClient, 'testBool', true);
+roundtrip($testClient, 'testBool', false);
+
+/**
* BYTE TEST
*/
roundtrip($testClient, 'testByte', 1);
+roundtrip($testClient, 'testByte', -1);
+roundtrip($testClient, 'testByte', 127);
+roundtrip($testClient, 'testByte', -128);
/**
* I32 TEST
@@ -156,6 +173,9 @@ roundtrip($testClient, 'testI32', -1);
/**
* I64 TEST
*/
+roundtrip($testClient, 'testI64', 0);
+roundtrip($testClient, 'testI64', 1);
+roundtrip($testClient, 'testI64', -1);
roundtrip($testClient, 'testI64', -34359738368);
/**
@@ -182,6 +202,11 @@ print_r(" = {\"".$in->string_thing."\", ".
$in->i32_thing.", ".
$in->i64_thing."}\n");
+if ($in != $out) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_STRUCTS;
+}
+
/**
* NESTED STRUCT TEST
*/
@@ -199,6 +224,11 @@ print_r(" = {".$in2->byte_thing.", {\"".
$in->i64_thing."}, ".
$in2->i32_thing."}\n");
+if ($in2 != $out2) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_STRUCTS;
+}
+
/**
* MAP TEST
*/
@@ -231,36 +261,36 @@ foreach ($mapin as $key => $val) {
}
print_r("}\n");
+if ($mapin != $mapout) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_CONTAINERS;
+}
+
/**
* SET TEST
*/
$setout = array();;
for ($i = -2; $i < 3; ++$i) {
- $setout []= $i;
+ $setout[$i]= true;
}
print_r("testSet({");
-$first = true;
-foreach ($setout as $val) {
- if ($first) {
- $first = false;
- } else {
- print_r(", ");
- }
- print_r($val);
-}
+echo implode(',', array_keys($setout));
print_r("})");
$setin = $testClient->testSet($setout);
print_r(" = {");
-$first = true;
-foreach ($setin as $val) {
- if ($first) {
- $first = false;
- } else {
- print_r(", ");
- }
- print_r($val);
-}
+echo implode(', ', array_keys($setin));
print_r("}\n");
+// Order of keys in set does not matter
+ksort($setin);
+if ($setout !== $setin) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_CONTAINERS;
+}
+// Regression test for corrupted array
+if ($setin[2] !== $setout[2] || is_int($setin[2])) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_CONTAINERS;
+}
/**
* LIST TEST
@@ -292,6 +322,10 @@ foreach ($listin as $val) {
print_r($val);
}
print_r("}\n");
+if ($listin !== $listout) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_CONTAINERS;
+}
/**
* ENUM TEST
@@ -299,22 +333,42 @@ print_r("}\n");
print_r("testEnum(ONE)");
$ret = $testClient->testEnum(\ThriftTest\Numberz::ONE);
print_r(" = $ret\n");
+if ($ret != \ThriftTest\Numberz::ONE) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_STRUCTS;
+}
print_r("testEnum(TWO)");
$ret = $testClient->testEnum(\ThriftTest\Numberz::TWO);
print_r(" = $ret\n");
+if ($ret != \ThriftTest\Numberz::TWO) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_STRUCTS;
+}
print_r("testEnum(THREE)");
$ret = $testClient->testEnum(\ThriftTest\Numberz::THREE);
print_r(" = $ret\n");
+if ($ret != \ThriftTest\Numberz::THREE) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_STRUCTS;
+}
print_r("testEnum(FIVE)");
$ret = $testClient->testEnum(\ThriftTest\Numberz::FIVE);
print_r(" = $ret\n");
+if ($ret != \ThriftTest\Numberz::FIVE) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_STRUCTS;
+}
print_r("testEnum(EIGHT)");
$ret = $testClient->testEnum(\ThriftTest\Numberz::EIGHT);
print_r(" = $ret\n");
+if ($ret != \ThriftTest\Numberz::EIGHT) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_STRUCTS;
+}
/**
* TYPEDEF TEST
@@ -322,6 +376,10 @@ print_r(" = $ret\n");
print_r("testTypedef(309858235082523)");
$uid = $testClient->testTypedef(309858235082523);
print_r(" = $uid\n");
+if ($uid !== 309858235082523) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_STRUCTS;
+}
/**
* NESTED MAP TEST
@@ -337,6 +395,14 @@ foreach ($mm as $key => $val) {
print_r("}, ");
}
print_r("}\n");
+$expected_mm = [
+ -4 => [-4 => -4, -3 => -3, -2 => -2, -1 => -1],
+ 4 => [4 => 4, 3 => 3, 2 => 2, 1 => 1],
+];
+if ($mm != $expected_mm) {
+ echo "**FAILED**\n";
+ $exitcode |= ERR_CONTAINERS;
+}
/**
* INSANITY TEST
@@ -388,6 +454,7 @@ print_r("testException('Xception')");
try {
$testClient->testException('Xception');
print_r(" void\nFAILURE\n");
+ $exitcode |= ERR_EXCEPTIONS;
} catch (\ThriftTest\Xception $x) {
print_r(' caught xception '.$x->errorCode.': '.$x->message."\n");
}
@@ -407,19 +474,19 @@ print_r("Total time: $elp ms\n");
// Max I32
$num = pow(2, 30) + (pow(2, 30) - 1);
-roundtrip($testClient, testI32, $num);
+roundtrip($testClient, 'testI32', $num);
// Min I32
$num = 0 - pow(2, 31);
-roundtrip($testClient, testI32, $num);
+roundtrip($testClient, 'testI32', $num);
// Max I64
$num = pow(2, 62) + (pow(2, 62) - 1);
-roundtrip($testClient, testI64, $num);
+roundtrip($testClient, 'testI64', $num);
// Min I64
$num = 0 - pow(2, 62) - pow(2, 62);
-roundtrip($testClient, testI64, $num);
+roundtrip($testClient, 'testI64', $num);
$transport->close();
exit($exitcode);
http://git-wip-us.apache.org/repos/asf/thrift/blob/f39d4c85/test/tests.json
----------------------------------------------------------------------
diff --git a/test/tests.json b/test/tests.json
index 0dbc8bf..2460b83 100644
--- a/test/tests.json
+++ b/test/tests.json
@@ -416,6 +416,12 @@
],
"command": [
"php",
+ "-dextension_dir=../../lib/php/src/ext/thrift_protocol/modules/",
+ "--php-ini=../../lib/php/thrift_protocol.ini",
+ "--no-php-ini",
+ "-ddisplay_errors=stderr",
+ "-dlog_errors=0",
+ "-derror_reporting=E_ALL",
"TestClient.php"
]
},
[2/3] thrift git commit: updated ignores
Posted by je...@apache.org.
updated ignores
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/485e0c4a
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/485e0c4a
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/485e0c4a
Branch: refs/heads/master
Commit: 485e0c4a03c2ec852a64c4552a8918e93663056f
Parents: 71e678a
Author: Jens Geyer <je...@apache.org>
Authored: Sat Dec 17 19:16:34 2016 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Sat Dec 17 19:51:36 2016 +0100
----------------------------------------------------------------------
.gitignore | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/485e0c4a/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 9a0e275..140c93b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,6 +47,9 @@ erl_crash.dump
/aclocal/lt*.m4
/autoscan.log
/autoscan-*.log
+/cmake_*
+/compiler/cpp/compiler.VC.db
+/compiler/cpp/compiler.VC.VC.opendb
/compiler/cpp/test/plugin/t_cpp_generator.cc
/compiler/cpp/src/thrift/plugin/plugin_constants.cpp
/compiler/cpp/src/thrift/plugin/plugin_constants.h
@@ -321,5 +324,3 @@ erl_crash.dump
/tutorial/java/build/
/tutorial/js/build/
/ylwrap
-
-/cmake_*