3836 Martin Zaun 2012-03-07
ndbjtie - merged 71 to 72 (removed 1 overlooked file).
removed:
storage/ndb/src/ndbjtie/test/test/MySqlUtilsDecimalTest.java.THIS
3835 Martin Zaun 2012-03-07 [merge]
ndbjtie - merged 71 to 72 (with --weave).
3834 Martin Zaun 2012-03-07 [merge]
ndbjtie - merged 71 to 72; resolved conflicts in ndbjtie CMakeLists.txt files.
added:
storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.cpp
storage/ndb/src/ndbjtie/jtie/test/myapi/CMakeLists.txt
storage/ndb/src/ndbjtie/jtie/test/myapi/test_myapi.cmd.in
storage/ndb/src/ndbjtie/jtie/test/myapi/test_myapi.sh.in
storage/ndb/src/ndbjtie/jtie/test/myjapi/test_myjapi.cmd.in
storage/ndb/src/ndbjtie/jtie/test/myjapi/test_myjapi.sh.in
storage/ndb/src/ndbjtie/jtie/test/unload/test_unload.cmd.in
storage/ndb/src/ndbjtie/jtie/test/unload/test_unload.sh.in
storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp
storage/ndb/src/ndbjtie/test/test_mutils.cmd.in
storage/ndb/src/ndbjtie/test/test_mutils.sh.in
storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.cmd.in
storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.sh.in
storage/ndb/src/ndbjtie/test/test_ndbjtie_smoke.cmd.in
storage/ndb/src/ndbjtie/test/test_ndbjtie_smoke.sh.in
storage/ndb/src/ndbjtie/test/test_unload_mutils.cmd.in
storage/ndb/src/ndbjtie/test/test_unload_mutils.sh.in
storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.cmd.in
storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.sh.in
storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_smoke.cmd.in
storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_smoke.sh.in
renamed:
storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t => storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.alt*
storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t => storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.alt*
storage/ndb/src/ndbjtie/test/test/MySqlUtilsCharsetMapTest.java => storage/ndb/src/ndbjtie/test/test/MySqlUtilsTest.java
storage/ndb/src/ndbjtie/test/test/MySqlUtilsDecimalTest.java => storage/ndb/src/ndbjtie/test/test/MySqlUtilsDecimalTest.java.THIS
storage/ndb/src/ndbjtie/test/test/NdbJTieLibraryLoadingTest.java => storage/ndb/src/ndbjtie/test/test/NdbJTieMultiLibTest.java
modified:
.bzrignore
storage/ndb/src/ndbjtie/CMakeLists.txt
storage/ndb/src/ndbjtie/jtie/CMakeLists.txt
storage/ndb/src/ndbjtie/jtie/jtie_lib.hpp
storage/ndb/src/ndbjtie/jtie/jtie_tconv_idcache_impl.hpp
storage/ndb/src/ndbjtie/jtie/jtie_tconv_object.hpp
storage/ndb/src/ndbjtie/jtie/jtie_tconv_object_impl.hpp
storage/ndb/src/ndbjtie/jtie/test/CMakeLists.txt
storage/ndb/src/ndbjtie/jtie/test/myapi/myapi.cpp
storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt
storage/ndb/src/ndbjtie/jtie/test/myjapi/MyApiWrapper.hpp
storage/ndb/src/ndbjtie/jtie/test/myjapi/myjapi_classes.hpp
storage/ndb/src/ndbjtie/jtie/test/myjapi/test/MyJapiTest.java
storage/ndb/src/ndbjtie/jtie/test/unload/CMakeLists.txt
storage/ndb/src/ndbjtie/jtie/test/unload/test/MyLoadUnloadTest.java
storage/ndb/src/ndbjtie/test/CMakeLists.txt
storage/ndb/src/ndbjtie/test/test/JTieTestBase.java
storage/ndb/src/ndbjtie/test/test/NdbJTieSmokeTest.java
storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.alt*
storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.alt*
storage/ndb/src/ndbjtie/test/test/MySqlUtilsTest.java
storage/ndb/src/ndbjtie/test/test/NdbJTieMultiLibTest.java
3833 Martin Skold 2012-03-07 [merge]
Merge from 71
modified:
mysql-test/suite/ndb/r/ndb_auto_increment.result
mysql-test/suite/ndb/t/ndb_auto_increment.test
sql/ha_ndbcluster.cc
storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionImpl.java
storage/ndb/src/common/debugger/SignalLoggerManager.cpp
=== modified file '.bzrignore'
--- a/.bzrignore 2012-02-14 08:00:53 +0000
+++ b/.bzrignore 2012-03-05 07:24:11 +0000
@@ -3046,7 +3046,7 @@ storage/ndb/**/target
storage/ndb/**/*.class
storage/ndb/src/ndbjtie/**/*.sh
storage/ndb/src/ndbjtie/**/*.log
-storage/ndb/src/ndbjtie/**/*_test
+storage/ndb/src/ndbjtie/**/*.cmd
storage/ndb/clusterj/**/*MANIFEST.MF
storage/ndb/clusterj/**/*manifest.mf
storage/ndb/test/crund/*.cnf
=== modified file 'storage/ndb/src/ndbjtie/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/CMakeLists.txt 2011-09-12 11:15:40 +0000
+++ b/storage/ndb/src/ndbjtie/CMakeLists.txt 2012-03-05 07:24:11 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,6 +13,20 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# set common Java variables for ndbjtie unit tests
+# neither wildcards (nor line breaks) for clean targets supported by cmake
+#SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "*.log")
+IF(HAVE_JAVA)
+
+ # the native path to the JVM
+ FILE(TO_NATIVE_PATH ${Java_JAVA_EXECUTABLE} Java_JAVA_EXECUTABLE_PATH)
+
+ # the JVM arch option when loading native libraries
+ MATH(EXPR Java_JAVA_ARCH "${CMAKE_SIZEOF_VOID_P} * 8")
+ SET(Java_JAVA_ARCH_OPT "-d${Java_JAVA_ARCH}")
+
+ENDIF(HAVE_JAVA)
+
ADD_SUBDIRECTORY(jtie)
ADD_SUBDIRECTORY(test)
@@ -27,20 +41,26 @@ IF(HAVE_JDK)
ENDIF(HAVE_JDK)
-SET ( JAVA_SOURCE_DIRS
- ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/mysql
- ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/mgmapi
- ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/ndbapi)
+# the NdbJTie Java API
+SET(JAVA_SOURCE_DIRS
+ ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/mysql
+ ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/mgmapi
+ ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/ndbjtie/ndbapi)
-SET ( JAVA_SOURCES "")
+SET(JAVA_SOURCES "")
FOREACH(D ${JAVA_SOURCE_DIRS})
FILE(GLOB tmp ${D}/*.java)
LIST(APPEND JAVA_SOURCES ${tmp})
ENDFOREACH()
-SET ( CLASSPATH jtie/target/classes)
+SET(CLASSPATH
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/target/classes
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes)
+
+SET(JARS
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/jtie.jar)
CREATE_JAR(ndbjtie ${JAVA_SOURCES}
- CLASSPATH ${CLASSPATH}
+ CLASSPATH ${CLASSPATH}
+ MERGE_JARS ${JARS}
DEPENDENCIES jtie.jar)
-
=== modified file 'storage/ndb/src/ndbjtie/jtie/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/CMakeLists.txt 2011-07-17 16:24:18 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/CMakeLists.txt 2012-03-05 07:24:11 +0000
@@ -1,5 +1,4 @@
-
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,8 +15,12 @@
ADD_SUBDIRECTORY(test)
-FILE(GLOB JAVA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/jtie/*.java)
+# the JTie Java API
+FILE(GLOB JAVA_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/com/mysql/jtie/*.java)
-CREATE_JAR(jtie ${JAVA_SOURCES}
- CLASSPATH target/classes)
+SET(CLASSPATH
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes)
+CREATE_JAR(jtie ${JAVA_SOURCES}
+ CLASSPATH ${CLASSPATH})
=== modified file 'storage/ndb/src/ndbjtie/jtie/jtie_lib.hpp'
--- a/storage/ndb/src/ndbjtie/jtie/jtie_lib.hpp 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/jtie_lib.hpp 2012-03-05 07:24:11 +0000
@@ -1,6 +1,5 @@
/*
- Copyright 2010 Sun Microsystems, Inc.
- All rights reserved. Use is subject to license terms.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,27 +35,27 @@
// JTie Library: Global Variable Definitions & Template Instantiations
// ---------------------------------------------------------------------------
-JTIE_INSTANTIATE_CLASS_MEMBER_INFO(_ByteBuffer_isReadOnly,
+JTIE_INSTANTIATE_CLASS_MEMBER_INFO_0(_ByteBuffer_isReadOnly,
"java/nio/ByteBuffer",
"isReadOnly",
"()Z")
-JTIE_INSTANTIATE_CLASS_MEMBER_INFO(_ByteBuffer_asReadOnlyBuffer,
+JTIE_INSTANTIATE_CLASS_MEMBER_INFO_0(_ByteBuffer_asReadOnlyBuffer,
"java/nio/ByteBuffer",
"asReadOnlyBuffer",
"()Ljava/nio/ByteBuffer;")
-JTIE_INSTANTIATE_CLASS_MEMBER_INFO(_ByteBuffer_remaining,
+JTIE_INSTANTIATE_CLASS_MEMBER_INFO_0(_ByteBuffer_remaining,
"java/nio/ByteBuffer",
"remaining",
"()I")
-JTIE_INSTANTIATE_CLASS_MEMBER_INFO(_ByteBuffer_position,
+JTIE_INSTANTIATE_CLASS_MEMBER_INFO_0(_ByteBuffer_position,
"java/nio/ByteBuffer",
"position",
"()I")
-JTIE_INSTANTIATE_CLASS_MEMBER_INFO(_Wrapper_cdelegate,
+JTIE_INSTANTIATE_CLASS_MEMBER_INFO_0(_Wrapper_cdelegate,
"com/mysql/jtie/Wrapper",
"cdelegate",
"J")
=== modified file 'storage/ndb/src/ndbjtie/jtie/jtie_tconv_idcache_impl.hpp'
--- a/storage/ndb/src/ndbjtie/jtie/jtie_tconv_idcache_impl.hpp 2011-09-14 13:49:19 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/jtie_tconv_idcache_impl.hpp 2012-03-05 07:24:11 +0000
@@ -1,6 +1,5 @@
/*
- Copyright 2010 Sun Microsystems, Inc.
- All rights reserved. Use is subject to license terms.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -80,8 +79,6 @@ jniGetMemberID< jfieldID >(JNIEnv * env,
// ---------------------------------------------------------------------------
-// XXX document these macros...
-
/**
* Defines an info type describing a field member of a Java class.
*/
@@ -99,7 +96,7 @@ jniGetMemberID< jfieldID >(JNIEnv * env,
*/
#define JTIE_DEFINE_CLASS_MEMBER_INFO( T, IDT ) \
struct T { \
- static const char * const class_name; \
+ static const char * const jclass_name; \
static const char * const member_name; \
static const char * const member_descriptor; \
typedef IDT * memberID_t; \
@@ -108,16 +105,36 @@ jniGetMemberID< jfieldID >(JNIEnv * env,
/**
* Instantiates an info type describing a member of a Java class.
*/
-#define JTIE_INSTANTIATE_CLASS_MEMBER_INFO( T, CN, MN, MD ) \
- const char * const T::class_name = CN; \
- const char * const T::member_name = MN; \
- const char * const T::member_descriptor = MD; \
+// XXX: unify JTIE_INSTANTIATE_CLASS_MEMBER_INFO_0 and _1
+// Windows CL requires this version for T = non-template type
+#define JTIE_INSTANTIATE_CLASS_MEMBER_INFO_0( T, JCN, JMN, JMD ) \
+ const char * const T::jclass_name = JCN; \
+ const char * const T::member_name = JMN; \
+ const char * const T::member_descriptor = JMD; \
+ template<> unsigned long MemberId< T >::nIdLookUps = 0; \
+ template<> jclass MemberIdCache< T >::gClassRef = NULL; \
+ template<> T::memberID_t MemberIdCache< T >::mid = NULL; \
+ template struct MemberId< T >; \
+ template struct MemberIdCache< T >;
+
+/**
+ * Instantiates an info type describing a member of a Java class.
+ */
+// XXX: unify JTIE_INSTANTIATE_CLASS_MEMBER_INFO_0 and _1
+// Windows CL requires this version for T = template type
+#define JTIE_INSTANTIATE_CLASS_MEMBER_INFO_1( T, JCN, JMN, JMD ) \
+ template<> const char * const T::jclass_name = JCN; \
+ template<> const char * const T::member_name = JMN; \
+ template<> const char * const T::member_descriptor = JMD; \
+ template<> unsigned long MemberId< T >::nIdLookUps = 0; \
+ template<> jclass MemberIdCache< T >::gClassRef = NULL; \
+ template<> T::memberID_t MemberIdCache< T >::mid = NULL; \
template struct MemberId< T >; \
template struct MemberIdCache< T >;
/**
* Provides uniform access to the JNI Field/Method ID of a Java class member
- * as described by the member info type 'C'.
+ * specified by a info type M.
*
* This base class does not cache the member ID and the class object, but
* it retrieves the member ID from JNI upon each access; different caching
@@ -152,9 +169,9 @@ jniGetMemberID< jfieldID >(JNIEnv * env,
*
* Derived classes implement any caching underneath this usage pattern.
*/
-template< typename C >
+template< typename M >
struct MemberId {
- typedef typename C::memberID_t ID_t;
+ typedef typename M::memberID_t ID_t;
// number of JNI Get<Field|Method>ID() invocations for statistics
static unsigned long nIdLookUps;
@@ -176,7 +193,7 @@ struct MemberId {
/**
* Returns a JNI Reference to the class declaring the member specified
- * by info type 'C'.
+ * by info type M.
*
* Depending upon the underlying caching strategy, a returned reference
* may be local or global, weak or strong; the scope of its use must be
@@ -195,23 +212,23 @@ struct MemberId {
*/
static jclass getClass(JNIEnv * env) {
assert(env->ExceptionCheck() == JNI_OK);
- jclass cls = env->FindClass(C::class_name);
+ jclass cls = env->FindClass(M::jclass_name);
if (cls == NULL) { // break out for better diagnostics
assert(env->ExceptionCheck() != JNI_OK); // exception pending
+ env->ExceptionDescribe(); // print error diagnostics to stderr
-//#ifndef NDEBUG // XXX for debugging
- // print error diagnostics
- char m[256];
-#ifndef _WIN32
- snprintf(m, 256, "JTie: failed to find Java class '%s'\n",
+#if 0 // for debugging: raise a fatal error
+#ifdef _WIN32
+#define SNPRINTF _snprintf
#else
- _snprintf(m, 256, "JTie: failed to find Java class '%s'\n",
+#define SNPRINTF snprintf
+#endif
+ char m[1024];
+ SNPRINTF(m, sizeof(m), "JTie: failed to find Java class '%s'",
+ (M::jclass_name == NULL ? "NULL" : M::jclass_name));
+ fprintf(stderr, "%s\n", m);
+ env->FatalError(m);
#endif
- (C::class_name == NULL ? "NULL" : C::class_name));
- fprintf(stderr, "%s", m);
- env->ExceptionDescribe();
- env->FatalError(m); // XXX for debugging
-//#endif // NDEBUG
} else {
assert(env->ExceptionCheck() == JNI_OK); // ok
}
@@ -241,7 +258,7 @@ struct MemberId {
// multithreaded access ok, inaccurate if non-atomic increment
nIdLookUps++;
return jniGetMemberID< ID_t >(env, cls,
- C::member_name, C::member_descriptor);
+ M::member_name, M::member_descriptor);
}
/**
@@ -260,9 +277,9 @@ struct MemberId {
/**
* Base class for caching of JNI Field/Method IDs.
*/
-template< typename C >
-struct MemberIdCache : MemberId< C > {
- typedef typename C::memberID_t ID_t;
+template< typename M >
+struct MemberIdCache : MemberId< M > {
+ typedef typename M::memberID_t ID_t;
static ID_t getId(JNIEnv * env, jclass cls) {
assert(cls != NULL);
@@ -284,10 +301,10 @@ protected:
* Provides caching of JNI Field/Method IDs using weak class references,
* allowing classes to be unloaded when no longer used by Java code.
*/
-template< typename C >
-struct MemberIdWeakCache : MemberIdCache< C > {
- typedef MemberId< C > A;
- typedef MemberIdCache< C > Base;
+template< typename M >
+struct MemberIdWeakCache : MemberIdCache< M > {
+ typedef MemberId< M > A;
+ typedef MemberIdCache< M > Base;
static void setClass(JNIEnv * env, jclass cls) {
assert(cls != NULL);
@@ -326,10 +343,10 @@ struct MemberIdWeakCache : MemberIdCache
* Provides caching of JNI Field/Method IDs using strong class references,
* preventing classes from being unloaded even if no longer used by Java code.
*/
-template< typename C >
-struct MemberIdStrongCache : MemberIdCache< C > {
- typedef MemberId< C > A;
- typedef MemberIdCache< C > Base;
+template< typename M >
+struct MemberIdStrongCache : MemberIdCache< M > {
+ typedef MemberId< M > A;
+ typedef MemberIdCache< M > Base;
static void setClass(JNIEnv * env, jclass cls) {
assert(cls != NULL);
@@ -364,9 +381,9 @@ struct MemberIdStrongCache : MemberIdCac
* Provides caching of JNI Field/Method IDs using weak class references
* with preloading (at class initialization) -- VERY TRICKY, NOT SUPPORTED.
*/
-template< typename C >
-struct MemberIdPreloadedWeakCache : MemberIdWeakCache< C > {
- typedef MemberIdWeakCache< C > Base;
+template< typename M >
+struct MemberIdPreloadedWeakCache : MemberIdWeakCache< M > {
+ typedef MemberIdWeakCache< M > Base;
using Base::setClass; // use as inherited (some compiler wanted this)
@@ -389,9 +406,9 @@ struct MemberIdPreloadedWeakCache : Memb
* Provides caching of JNI Field/Method IDs using strong class references
* with preloading (at class initialization) -- VERY TRICKY, NOT SUPPORTED.
*/
-template< typename C >
-struct MemberIdPreloadedStrongCache : MemberIdStrongCache< C > {
- typedef MemberIdStrongCache< C > Base;
+template< typename M >
+struct MemberIdPreloadedStrongCache : MemberIdStrongCache< M > {
+ typedef MemberIdStrongCache< M > Base;
using Base::setClass; // use as inherited (some compiler wanted this)
@@ -407,16 +424,6 @@ struct MemberIdPreloadedStrongCache : Me
using Base::releaseRef; // use as inherited (some compiler wanted this)
};
-// XXX static initialization <-> multiple compilation units <-> jtie_lib.hpp
-template< typename C > unsigned long MemberId< C >
- ::nIdLookUps = 0;
-
-template< typename C > jclass MemberIdCache< C >
- ::gClassRef = NULL;
-
-template< typename C > typename C::memberID_t MemberIdCache< C >
- ::mid = NULL;
-
// XXX document
/**
@@ -435,29 +442,29 @@ enum JniMemberIdCaching {
/**
* Generic class for member ID access with selection of caching strategy.
*/
-template< JniMemberIdCaching M, typename C >
+template< JniMemberIdCaching S, typename M >
struct JniMemberId;
-template< typename C >
-struct JniMemberId< NO_CACHING, C >
- : MemberId< C > {};
-
-template< typename C >
-struct JniMemberId< WEAK_CACHING, C >
- : MemberIdWeakCache< C > {};
-
-template< typename C >
-struct JniMemberId< STRONG_CACHING, C >
- : MemberIdStrongCache< C > {};
+template< typename M >
+struct JniMemberId< NO_CACHING, M >
+ : MemberId< M > {};
+
+template< typename M >
+struct JniMemberId< WEAK_CACHING, M >
+ : MemberIdWeakCache< M > {};
+
+template< typename M >
+struct JniMemberId< STRONG_CACHING, M >
+ : MemberIdStrongCache< M > {};
#if 0 // preloaded caching very tricky, not supported at this time
-template< typename C >
-struct JniMemberId< WEAK_CACHING_PRELOAD, C >
- : MemberIdPreloadedWeakCache< C > {};
-
-template< typename C >
-struct JniMemberId< STRONG_CACHING_PRELOAD, C >
- : MemberIdPreloadedStrongCache< C > {};
+template< typename M >
+struct JniMemberId< WEAK_CACHING_PRELOAD, M >
+ : MemberIdPreloadedWeakCache< M > {};
+
+template< typename M >
+struct JniMemberId< STRONG_CACHING_PRELOAD, M >
+ : MemberIdPreloadedStrongCache< M > {};
#endif // preloaded caching very tricky, not supported at this time
// ---------------------------------------------------------------------------
=== modified file 'storage/ndb/src/ndbjtie/jtie/jtie_tconv_object.hpp'
--- a/storage/ndb/src/ndbjtie/jtie/jtie_tconv_object.hpp 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/jtie_tconv_object.hpp 2012-03-05 07:24:11 +0000
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@
// ---------------------------------------------------------------------------
/**
- * A root class representing Java peer classes in type mappings.
+ * Internal root class for representing Java classes in peer type mappings.
*
* Rationale: A dedicated type, distinct from JNI's _jobject, allows for
* better control of template resolution (avoiding ambiguities) and
@@ -41,62 +41,21 @@
struct _jtie_Object : _jobject {
};
-// XXX, document: type specifying an Object mapping with a class name
-
-// trait type wrapping named-parametrized Object mappings for specialization
-// XXX make use of
-// JTIE_DEFINE_METHOD_MEMBER_INFO( _jtie_ObjectMapper< T > )
-// to replace
-// static const char * const class_name;
-// static const char * const member_name;
-// static const char * const member_descriptor;
-// typedef _jmethodID * memberID_t;
+/**
+ * Internal, generic trait type mapping a Java class.
+ *
+ * Rationale: This generic class has outlived its purpose, but can be used
+ * as a container for additional, class-specific mapping information.
+ */
template< typename J >
struct _jtie_ObjectMapper : _jtie_Object {
- // the name of the Java peer class in the JVM format (i.e., '/'-separated)
- static const char * const class_name;
-
- // the name, descriptor, and JNI type of the class's no-arg c'tor
- static const char * const member_name;
- static const char * const member_descriptor;
- typedef _jmethodID * memberID_t;
+ /**
+ * Name and descriptor of this class's no-argument constructor.
+ */
+ // XXX cleanup: use a template decl instead of a macro
+ JTIE_DEFINE_METHOD_MEMBER_INFO( ctor )
};
-// XXX static initialization <-> multiple compilation units <-> jtie_lib.hpp
-template< typename J >
-const char * const _jtie_ObjectMapper< J >::class_name
- = J::class_name; // XXX static initialization order dependency?
-
-template< typename J >
-const char * const _jtie_ObjectMapper< J >::member_name
- = "<init>";
-
-template< typename J >
-const char * const _jtie_ObjectMapper< J >::member_descriptor
- = "()V";
-
-// Design note:
-//
-// As of pre-C++0x, string literals cannot be used as template arguments
-// which must be integral constants with external linkage.
-//
-// So, we cannot declare:
-//
-// template< const char * >
-// struct _jtie_ClassNamedObject : _jtie_Object {
-// static const char * const java_internal_class_name;
-// };
-//
-// As a feasible workaround, we require the application to provide a
-// trait type for each class, e.g.
-//
-// struct _m_A : _jobject {
-// static const char * const java_internal_class_name;
-// };
-// const char * const _m_A::java_internal_class_name = "myjapi/A";
-//
-// and we retrieve the class name from there.
-
/**
* Defines the trait type aliases for the mapping of a
* user-defined Java class to a C++ class.
@@ -127,9 +86,7 @@ const char * const _jtie_ObjectMapper< J
* to be prepended with the C++ keyword "typename".
*/
#define JTIE_DEFINE_PEER_CLASS_MAPPING( C, T ) \
- struct T { \
- static const char * const class_name; \
- }; \
+ struct T {}; \
typedef ttrait< jobject, C, _jtie_ObjectMapper< T > * \
> ttrait_##T##_t; \
typedef ttrait< jobject, const C, _jtie_ObjectMapper< T > * \
@@ -220,18 +177,11 @@ const char * const _jtie_ObjectMapper< J
#endif // XXX cleanup this unsupported mapping
// XXX to document
-// XXX static initialization <-> multiple compilation units <-> jtie_lib.hpp
-// XXX replace
-// template struct MemberId< _jtie_ObjectMapper< T > >;
-// template struct MemberIdCache< _jtie_ObjectMapper< T > >;
-// with
-// JTIE_INSTANTIATE_CLASS_MEMBER_INFO_X(_jtie_ObjectMapper< T >,
-// JCN, "<init>", "()V")
-#define JTIE_INSTANTIATE_PEER_CLASS_MAPPING( T, JCN ) \
- const char * const T::class_name = JCN; \
- template struct _jtie_ObjectMapper< T >; \
- template struct MemberId< _jtie_ObjectMapper< T > >; \
- template struct MemberIdCache< _jtie_ObjectMapper< T > >;
+// XXX cleanup: symmetry with JTIE_DEFINE_METHOD_MEMBER_INFO( ctor ) above
+#define JTIE_INSTANTIATE_PEER_CLASS_MAPPING( T, JCN ) \
+ template struct _jtie_ObjectMapper< T >; \
+ JTIE_INSTANTIATE_CLASS_MEMBER_INFO_1(_jtie_ObjectMapper< T >::ctor, \
+ JCN, "<init>", "()V")
// ---------------------------------------------------------------------------
=== modified file 'storage/ndb/src/ndbjtie/jtie/jtie_tconv_object_impl.hpp'
--- a/storage/ndb/src/ndbjtie/jtie/jtie_tconv_object_impl.hpp 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/jtie_tconv_object_impl.hpp 2012-03-05 07:24:11 +0000
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -45,12 +45,14 @@ JTIE_DEFINE_FIELD_MEMBER_INFO(_Wrapper_c
typedef JniMemberId< WEAK_CACHING, _Wrapper_cdelegate > Wrapper_cdelegate;
//typedef JniMemberId< STRONG_CACHING, _Wrapper_cdelegate > Wrapper_cdelegate;
+// ---------------------------------------------------------------------------
+
// XXX consider changing
//template< typename C > struct ObjectParam< _jtie_Object *, C * > {
// to
//template< typename J, typename C > struct ObjectParam< J *, C * > {
-//
-// same for Target, Result
+// same for Target, Result; or conversly
+//template< typename J > struct ObjectResult< J *, void * > {
// Implements the mapping of jtie_Objects parameters.
template< typename J, typename C >
@@ -195,10 +197,10 @@ struct Target< _jtie_Object *, C > {
template< typename J, typename C >
struct ObjectResult< J *, C * > {
// Provides a (cached) access to the method Id of the constructor of J.
- //typedef JniMemberId< NO_CACHING, J > J_ctor;
- typedef JniMemberId< WEAK_CACHING, J > J_ctor;
- //typedef JniMemberId< STRONG_CACHING, J > J_ctor;
-
+ //typedef JniMemberId< NO_CACHING, typename J::ctor > J_ctor;
+ typedef JniMemberId< WEAK_CACHING, typename J::ctor > J_ctor;
+ //typedef JniMemberId< STRONG_CACHING, typename J::ctor > J_ctor;
+
static J *
convert(C * c, JNIEnv * env) {
TRACE("J * ObjectResult.convert(JNIEnv *, C *)");
=== modified file 'storage/ndb/src/ndbjtie/jtie/test/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/test/CMakeLists.txt 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/CMakeLists.txt 2012-03-05 07:24:11 +0000
@@ -1,5 +1,4 @@
-
-# Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +13,13 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ADD_SUBDIRECTORY(myapi)
ADD_SUBDIRECTORY(myjapi)
ADD_SUBDIRECTORY(unload)
+# ndb71@win32: compile issues with including <NdbTap.hpp>
+#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include/util
+# ${CMAKE_SOURCE_DIR}/unittest/mytap)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/unittest/mytap)
+ADD_EXECUTABLE(jtie_unit_tests-t jtie_unit_tests-t.cpp)
=== renamed file 'storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t' => 'storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.alt' (properties changed: +x to -x)
--- a/storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t 2011-02-02 09:52:33 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.alt 2012-03-05 04:19:09 +0000
@@ -1,6 +1,5 @@
#!/bin/sh
-
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,58 +14,58 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# see: The MySQL Test Framework :: 7 Creating and Executing Unit Tests
-# (MySQL Cluster Documentation)/mysqltest/en/unit-test.html
-# see: Test Anything Protocol (TAP)
+# This script runs a collection of unit-tests and reports their
+# status to stdout according to the Test Anything Protocol (TAP):
# http://testanything.org/wiki/index.php/Main_Page
# http://en.wikipedia.org/wiki/Test_Anything_Protocol
+# Any additional, non-TAP output by this script and the unit tests is
+# redirected to a local log file.
-# not sure which protocol version we're using
-#echo "TAP version 13"
-
-# test range
-echo "1..3"
-
-script_dir=`dirname $0`
-
-# log file for output from this script
-log="jtie_unit_tests-t.log"
+# TAP: report test plan
+plan="1..3"
+echo "$plan"
+
+this_dir="`dirname $0`"
+this_name="`basename $0`"
+
+# log file for non-TAP output from this script
+log="$this_dir/$this_name.log"
+echo "# detailed jtie test output in log file: '$log'"
rm -f "$log"
touch "$log"
+echo "running tests: $plan" >> "$log" 2>&1
test_counter=0
-#
-# Run a simpler shell script test, and report it as TAP
-#
-# Arguments:
-# shell script hame
-#
+# Runs a unit test script and report its status as TAP.
+# Arguments: unit test hame
run_test()
{
test_name=$1;
test_counter=`expr $test_counter + 1`
- script_name="$script_dir/$test_name/test_$test_name.sh"
-
- echo "running test '$script_name':" >> "$log" 2>&1
- if [ ! -x "$script_name" ]; then
- status="ok $test_counter # skip $test_name test file missing"
+ script_dir="$this_dir/$test_name"
+ script_name="test_$test_name.sh"
+ script_path="$script_dir/$script_name"
+
+ echo "\nrunning test '$script_path':" >> "$log" 2>&1
+ if [ ! -x "$script_path" ]; then
+ status="not ok $test_counter - $test_name # missing file '$script_path'"
else
- ./$script_name >> "$log" 2>&1
s=""
+ ( cd $script_dir ; ./$script_name ) >> "$log" 2>&1
if [ "$?" -ne "0" ]; then
s="not "
fi
- status="${s}ok $test_counter - $test_name"
+ status="${s}ok $test_counter - jtie test: $test_name"
fi;
echo "$status" >> "$log" 2>&1
- echo "" >> "$log" 2>&1
+
+ # TAP: report unit test status
echo "$status"
- cd ..
}
run_test "myapi"
run_test "myjapi"
run_test "unload"
-echo "done." >> "$log" 2>&1
+echo "\ndone." >> "$log" 2>&1
=== added file 'storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.cpp'
--- a/storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.cpp 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t.cpp 2012-03-05 04:19:09 +0000
@@ -0,0 +1,175 @@
+/*
+ Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+/*
+ * jtie_unit_tests-t.cpp
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+// ndb71@win32: unresolved compile errors ('VOID' : undeclared identifier)
+// in C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\dbghelp.h(931)
+// when including <NdbTap.hpp>; hence, using directly:
+#include <tap.h>
+#include <tap.c>
+
+// platform-specific functions and settings
+#ifdef _WIN32
+#define SNPRINTF _snprintf_s
+#define FILE_SEPARATOR '\\'
+#define SCRIPT_FILE_SUFFIX ".cmd"
+#define SCRIPT_COMMAND_SEPARATOR "&&"
+#else
+#define system system
+#define SNPRINTF snprintf
+#define FILE_SEPARATOR '/'
+#define SCRIPT_FILE_SUFFIX ".sh"
+#define SCRIPT_COMMAND_SEPARATOR ";"
+#endif
+
+/**
+ * Runs a test script located in subdirectory.
+ */
+void run_test_script(const char * this_dir,
+ const char * test_name)
+{
+ assert(this_dir);
+ assert(test_name);
+
+ // directory, name, path of test script to run
+ const int path_max = 1024; // FILENAME_MAX is ISO-C but may be huge
+ char script_dir[path_max];
+ char script_name[path_max];
+ char script_path[path_max];
+ SNPRINTF(script_dir, sizeof(script_dir), "%s%c%s",
+ this_dir, FILE_SEPARATOR, test_name);
+ SNPRINTF(script_name, sizeof(script_name), "test_%s" SCRIPT_FILE_SUFFIX,
+ test_name);
+ SNPRINTF(script_path, sizeof(script_path), "%s%c%s",
+ script_dir, FILE_SEPARATOR, script_name);
+ //printf("script_dir='%s'\n", script_dir);
+ //printf("script_name='%s'\n", script_name);
+ //printf("script_path='%s'\n", script_path);
+
+ // try to locate script; also try from this dir's parent dir as
+ // multi-config builds may place binaries in a config subdirectory
+ char parent_dir[path_max];
+ const char * bin_dir = "."; // subdir for binaries
+ FILE * script = fopen(script_path, "r");
+ if (!script) {
+ printf("\nnot found test script at '%s'\n", script_path);
+
+ // re-root script dir and path
+ SNPRINTF(parent_dir, sizeof(parent_dir), "%s", this_dir);
+ char * sep = strrchr(parent_dir, FILE_SEPARATOR);
+ if (sep != NULL) {
+ *sep = '\0';
+ bin_dir = sep+1;
+ }
+ SNPRINTF(script_dir, sizeof(script_dir), "%s%c%s",
+ parent_dir, FILE_SEPARATOR, test_name);
+ SNPRINTF(script_path, sizeof(script_path), "%s%c%s",
+ script_dir, FILE_SEPARATOR, script_name);
+ //printf("parent_dir='%s'\n", parent_dir);
+ //printf("script_dir='%s'\n", script_dir);
+ //printf("script_path='%s'\n", script_path);
+
+ // try re-rooted path
+ script = fopen(script_path, "r");
+ if (!script) {
+ printf("also not found test script at '%s'\n", script_path);
+ // TAP: skip tests (args: count, non-null format string)
+ skip(1, "missing script for subtest '%s'", test_name);
+ fflush(stdout);
+ fflush(stderr);
+ return;
+ }
+ }
+ fclose(script);
+ printf("\nfound test script at '%s'\n", script_path);
+ //printf("bin_dir='%s'\n", bin_dir);
+
+ // run the test script with exit status (using ISO-C's system() call)
+ printf("\nTEST: %s\n", test_name);
+ char script_cmd[3 * path_max];
+ SNPRINTF(script_cmd, sizeof(script_cmd), "cd %s %s .%c%s %s",
+ script_dir, SCRIPT_COMMAND_SEPARATOR,
+ FILE_SEPARATOR, script_name, bin_dir);
+ //printf("script_cmd='%s'\n", script_cmd);
+ printf(">>> running '%s'\n", script_cmd);
+ fflush(stdout); // system() requires all open streams to be flushed
+ fflush(stderr);
+ int status = system(script_cmd);
+ fflush(stdout);
+ fflush(stderr);
+ printf("<<< exit status == %d\n", status);
+ if (status) {
+ fprintf(stderr,
+ "------------------------------------------------------------\n"
+ "ERROR: failed subtest %s, exit status=%d\n"
+ "------------------------------------------------------------\n",
+ test_name, status);
+ }
+
+ // TAP: report test result (args: passed, non-null format string)
+ ok(status == 0, "jtie subtest: %s", test_name);
+ fflush(stdout);
+ fflush(stderr);
+}
+
+int main(int argc, char **argv)
+{
+ // extract the path and file name by which this program is being called
+ // to locate and run the platform test scripts in the subdirectories;
+ // convert any forward slashes as when called from perl (even on win).
+ for (char * c = *argv; *c != '\0'; c++)
+ if (*c == '/') *c = FILE_SEPARATOR;
+ const char * this_dir = *argv;
+ const char * this_name = *argv;
+ char * sep = strrchr(*argv, FILE_SEPARATOR);
+ if (sep == NULL) {
+ this_dir = ".";
+ } else {
+ *sep = '\0';
+ this_name = sep+1;
+ }
+ //printf("this_dir='%s'\n", this_dir);
+ //printf("this_name='%s'\n", this_name);
+ assert(this_dir);
+ assert(this_name);
+
+ // TAP: print number of tests to run
+ plan(3);
+
+ // run tests
+ run_test_script(this_dir, "myapi");
+ run_test_script(this_dir, "myjapi");
+ // TAP: configured by MYTAP_CONFIG environment var
+ // XXX for initial testing: run all
+ //if (skip_big_tests) {
+ if (false) {
+ printf("\n");
+ skip(1, "big subtest unload");
+ } else {
+ run_test_script(this_dir, "unload");
+ }
+
+ // TAP: print summary report and return exit status
+ return exit_status();
+}
=== added file 'storage/ndb/src/ndbjtie/jtie/test/myapi/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/test/myapi/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myapi/CMakeLists.txt 2012-03-05 07:24:11 +0000
@@ -0,0 +1,52 @@
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# neither wildcards (nor line breaks) for clean targets supported by cmake
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+ "test_myapi.sh.log;test_myapi.cmd.log")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/utils)
+
+# a C++ API
+ADD_CONVENIENCE_LIBRARY(libmyapi myapi.cpp)
+# trick: link against c++ lib to generate C++ runtime symbols for this lib,
+# which are missing when compiling with CXX=gcc, even though this unit test
+# library has no dependencies upon other files:
+TARGET_LINK_LIBRARIES(libmyapi ndbgeneral)
+# no luck with tricks like creating/linking dummy.cc file, neither with:
+#SET_TARGET_PROPERTIES(libmyapi PROPERTIES HAS_CXX TRUE)
+
+# a program testing the C++ API
+ADD_EXECUTABLE(myapi_test myapi_test.cpp)
+TARGET_LINK_LIBRARIES(myapi_test libmyapi)
+
+IF(WIN32)
+
+ # build the unit-test script for win
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_myapi.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_myapi.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+
+ELSE(WIN32)
+
+ # build the unit-test script for *nix
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_myapi.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_myapi.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_myapi ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_myapi.sh"
+ || echo "") # don't break the build if file was deleted)
+
+ENDIF(WIN32)
=== modified file 'storage/ndb/src/ndbjtie/jtie/test/myapi/myapi.cpp'
--- a/storage/ndb/src/ndbjtie/jtie/test/myapi/myapi.cpp 2011-02-02 09:52:33 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myapi/myapi.cpp 2012-03-05 04:19:09 +0000
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -193,110 +193,110 @@ void f0()
// ---------------------------------------------------------------------------
-static const char * ABC = "ABC";
-static char abc[4] = { 'a', 'b', 'c', '\0' };
+static const char * XYZ = "XYZ";
+static char xyz[4] = { 'x', 'y', 'z', '\0' };
const void * s010()
{
TRACE("const void * s010()");
- return ABC;
+ return XYZ;
}
const char * s012()
{
TRACE("const char * s012()");
- return ABC;
+ return XYZ;
}
void * s030()
{
TRACE("void * s030()");
- return abc;
+ return xyz;
}
char * s032()
{
TRACE("char * s032()");
- return abc;
+ return xyz;
}
const void * const s050()
{
TRACE("const void * const s050()");
- return ABC;
+ return XYZ;
}
const char * const s052()
{
TRACE("const char * const s052()");
- return ABC;
+ return XYZ;
}
void * const s070()
{
TRACE("void * const s070()");
- return abc;
+ return xyz;
}
char * const s072()
{
TRACE("char * const s072()");
- return abc;
+ return xyz;
}
void s110(const void * p0)
{
TRACE("void s110(const void *)");
- CHECK((strcmp((const char*)p0, abc) != 0 && strcmp((const char*)p0, ABC) != 0),
+ CHECK((strcmp((const char*)p0, xyz) != 0 && strcmp((const char*)p0, XYZ) != 0),
"void s110(const void *)");
}
void s112(const char * p0)
{
TRACE("void s112(const char *)");
- CHECK((strcmp(p0, abc) != 0 && strcmp(p0, ABC) != 0),
+ CHECK((strcmp(p0, xyz) != 0 && strcmp(p0, XYZ) != 0),
"void s112(const char *)");
}
void s130(void * p0)
{
TRACE("void s130(void *)");
- CHECK((strcmp((const char*)p0, abc) != 0 && strcmp((const char*)p0, ABC) != 0),
+ CHECK((strcmp((const char*)p0, xyz) != 0 && strcmp((const char*)p0, XYZ) != 0),
"void s130(void *)");
}
void s132(char * p0)
{
TRACE("void s132(char *)");
- CHECK((strcmp(p0, abc) != 0 && strcmp(p0, ABC) != 0),
+ CHECK((strcmp(p0, xyz) != 0 && strcmp(p0, XYZ) != 0),
"void s132(char *)");
}
void s150(const void * const p0)
{
TRACE("void s150(const void * const)");
- CHECK((strcmp((const char*)p0, abc) != 0 && strcmp((const char*)p0, ABC) != 0),
+ CHECK((strcmp((const char*)p0, xyz) != 0 && strcmp((const char*)p0, XYZ) != 0),
"void s150(const void * const)");
}
void s152(const char * const p0)
{
TRACE("void s152(const char * const)");
- CHECK((strcmp(p0, abc) != 0 && strcmp(p0, ABC) != 0),
+ CHECK((strcmp(p0, xyz) != 0 && strcmp(p0, XYZ) != 0),
"void s152(const char * const)");
}
void s170(void * const p0)
{
TRACE("void s170(void * const)");
- CHECK((strcmp((const char*)p0, abc) != 0 && strcmp((const char*)p0, ABC) != 0),
+ CHECK((strcmp((const char*)p0, xyz) != 0 && strcmp((const char*)p0, XYZ) != 0),
"void s170(void * const)");
}
void s172(char * const p0)
{
TRACE("void s172(char * const)");
- CHECK((strcmp(p0, abc) != 0 && strcmp(p0, ABC) != 0),
+ CHECK((strcmp(p0, xyz) != 0 && strcmp(p0, XYZ) != 0),
"void s172(char * const)");
}
@@ -2309,63 +2309,63 @@ const char * f612()
{
TRACE("const char * f612()");
static char _f612 = 1;
- return (((_f612 = (char)-_f612) != 1) ? NULL : &_f612);
+ return (((_f612 = (char)~_f612) != 1) ? NULL : &_f612);
}
const int8_t * f613()
{
TRACE("const int8_t * f613()");
static int8_t _f613 = 1;
- return (((_f613 = (int8_t)-_f613) != 1) ? NULL : &_f613);
+ return (((_f613 = (int8_t)~_f613) != 1) ? NULL : &_f613);
}
const uint8_t * f614()
{
TRACE("const uint8_t * f614()");
static uint8_t _f614 = 1;
- return (((_f614 = (uint8_t)-_f614) != 1) ? NULL : &_f614);
+ return (((_f614 = (uint8_t)~_f614) != 1) ? NULL : &_f614);
}
const int16_t * f615()
{
TRACE("const int16_t * f615()");
static int16_t _f615 = 1;
- return (((_f615 = (int16_t)-_f615) != 1) ? NULL : &_f615);
+ return (((_f615 = (int16_t)~_f615) != 1) ? NULL : &_f615);
}
const uint16_t * f616()
{
TRACE("const uint16_t * f616()");
static uint16_t _f616 = 1;
- return (((_f616 = (uint16_t)-_f616) != 1) ? NULL : &_f616);
+ return (((_f616 = (uint16_t)~_f616) != 1) ? NULL : &_f616);
}
const int32_t * f617()
{
TRACE("const int32_t * f617()");
static int32_t _f617 = 1;
- return (((_f617 = (int32_t)-_f617) != 1) ? NULL : &_f617);
+ return (((_f617 = (int32_t)~_f617) != 1) ? NULL : &_f617);
}
const uint32_t * f618()
{
TRACE("const uint32_t * f618()");
static uint32_t _f618 = 1;
- return (((_f618 = (uint32_t)-_f618) != 1) ? NULL : &_f618);
+ return (((_f618 = (uint32_t)~_f618) != 1) ? NULL : &_f618);
}
const int64_t * f621()
{
TRACE("const int64_t * f621()");
static int64_t _f621 = 1;
- return (((_f621 = (int64_t)-_f621) != 1) ? NULL : &_f621);
+ return (((_f621 = (int64_t)~_f621) != 1) ? NULL : &_f621);
}
const uint64_t * f622()
{
TRACE("const uint64_t * f622()");
static uint64_t _f622 = 1;
- return (((_f622 = (uint64_t)-_f622) != 1) ? NULL : &_f622);
+ return (((_f622 = (uint64_t)~_f622) != 1) ? NULL : &_f622);
}
const float * f623()
@@ -2393,63 +2393,63 @@ char * f632()
{
TRACE("char * f632()");
static char _f632 = 1;
- return (((_f632 = (char)-_f632) != 1) ? NULL : &_f632);
+ return (((_f632 = (char)~_f632) != 1) ? NULL : &_f632);
}
int8_t * f633()
{
TRACE("int8_t * f633()");
static int8_t _f633 = 1;
- return (((_f633 = (int8_t)-_f633) != 1) ? NULL : &_f633);
+ return (((_f633 = (int8_t)~_f633) != 1) ? NULL : &_f633);
}
uint8_t * f634()
{
TRACE("uint8_t * f634()");
static uint8_t _f634 = 1;
- return (((_f634 = (uint8_t)-_f634) != 1) ? NULL : &_f634);
+ return (((_f634 = (uint8_t)~_f634) != 1) ? NULL : &_f634);
}
int16_t * f635()
{
TRACE("int16_t * f635()");
static int16_t _f635 = 1;
- return (((_f635 = (int16_t)-_f635) != 1) ? NULL : &_f635);
+ return (((_f635 = (int16_t)~_f635) != 1) ? NULL : &_f635);
}
uint16_t * f636()
{
TRACE("uint16_t * f636()");
static uint16_t _f636 = 1;
- return (((_f636 = (uint16_t)-_f636) != 1) ? NULL : &_f636);
+ return (((_f636 = (uint16_t)~_f636) != 1) ? NULL : &_f636);
}
int32_t * f637()
{
TRACE("int32_t * f637()");
static int32_t _f637 = 1;
- return (((_f637 = (int32_t)-_f637) != 1) ? NULL : &_f637);
+ return (((_f637 = (int32_t)~_f637) != 1) ? NULL : &_f637);
}
uint32_t * f638()
{
TRACE("uint32_t * f638()");
static uint32_t _f638 = 1;
- return (((_f638 = (uint32_t)-_f638) != 1) ? NULL : &_f638);
+ return (((_f638 = (uint32_t)~_f638) != 1) ? NULL : &_f638);
}
int64_t * f641()
{
TRACE("int64_t * f641()");
static int64_t _f641 = 1;
- return (((_f641 = (int64_t)-_f641) != 1) ? NULL : &_f641);
+ return (((_f641 = (int64_t)~_f641) != 1) ? NULL : &_f641);
}
uint64_t * f642()
{
TRACE("uint64_t * f642()");
static uint64_t _f642 = 1;
- return (((_f642 = (uint64_t)-_f642) != 1) ? NULL : &_f642);
+ return (((_f642 = (uint64_t)~_f642) != 1) ? NULL : &_f642);
}
float * f643()
@@ -2477,63 +2477,63 @@ const char * const f652()
{
TRACE("const char * const f652()");
static char _f652 = 1;
- return (((_f652 = (char)-_f652) != 1) ? NULL : &_f652);
+ return (((_f652 = (char)~_f652) != 1) ? NULL : &_f652);
}
const int8_t * const f653()
{
TRACE("const int8_t * const f653()");
static int8_t _f653 = 1;
- return (((_f653 = (int8_t)-_f653) != 1) ? NULL : &_f653);
+ return (((_f653 = (int8_t)~_f653) != 1) ? NULL : &_f653);
}
const uint8_t * const f654()
{
TRACE("const uint8_t * const f654()");
static uint8_t _f654 = 1;
- return (((_f654 = (uint8_t)-_f654) != 1) ? NULL : &_f654);
+ return (((_f654 = (uint8_t)~_f654) != 1) ? NULL : &_f654);
}
const int16_t * const f655()
{
TRACE("const int16_t * const f655()");
static int16_t _f655 = 1;
- return (((_f655 = (int16_t)-_f655) != 1) ? NULL : &_f655);
+ return (((_f655 = (int16_t)~_f655) != 1) ? NULL : &_f655);
}
const uint16_t * const f656()
{
TRACE("const uint16_t * const f656()");
static uint16_t _f656 = 1;
- return (((_f656 = (uint16_t)-_f656) != 1) ? NULL : &_f656);
+ return (((_f656 = (uint16_t)~_f656) != 1) ? NULL : &_f656);
}
const int32_t * const f657()
{
TRACE("const int32_t * const f657()");
static int32_t _f657 = 1;
- return (((_f657 = (int32_t)-_f657) != 1) ? NULL : &_f657);
+ return (((_f657 = (int32_t)~_f657) != 1) ? NULL : &_f657);
}
const uint32_t * const f658()
{
TRACE("const uint32_t * const f658()");
static uint32_t _f658 = 1;
- return (((_f658 = (uint32_t)-_f658) != 1) ? NULL : &_f658);
+ return (((_f658 = (uint32_t)~_f658) != 1) ? NULL : &_f658);
}
const int64_t * const f661()
{
TRACE("const int64_t * const f661()");
static int64_t _f661 = 1;
- return (((_f661 = (int64_t)-_f661) != 1) ? NULL : &_f661);
+ return (((_f661 = (int64_t)~_f661) != 1) ? NULL : &_f661);
}
const uint64_t * const f662()
{
TRACE("const uint64_t * const f662()");
static uint64_t _f662 = 1;
- return (((_f662 = (uint64_t)-_f662) != 1) ? NULL : &_f662);
+ return (((_f662 = (uint64_t)~_f662) != 1) ? NULL : &_f662);
}
const float * const f663()
@@ -2561,63 +2561,63 @@ char * const f672()
{
TRACE("char * const f672()");
static char _f672 = 1;
- return (((_f672 = (char)-_f672) != 1) ? NULL : &_f672);
+ return (((_f672 = (char)~_f672) != 1) ? NULL : &_f672);
}
int8_t * const f673()
{
TRACE("int8_t * const f673()");
static int8_t _f673 = 1;
- return (((_f673 = (int8_t)-_f673) != 1) ? NULL : &_f673);
+ return (((_f673 = (int8_t)~_f673) != 1) ? NULL : &_f673);
}
uint8_t * const f674()
{
TRACE("uint8_t * const f674()");
static uint8_t _f674 = 1;
- return (((_f674 = (uint8_t)-_f674) != 1) ? NULL : &_f674);
+ return (((_f674 = (uint8_t)~_f674) != 1) ? NULL : &_f674);
}
int16_t * const f675()
{
TRACE("int16_t * const f675()");
static int16_t _f675 = 1;
- return (((_f675 = (int16_t)-_f675) != 1) ? NULL : &_f675);
+ return (((_f675 = (int16_t)~_f675) != 1) ? NULL : &_f675);
}
uint16_t * const f676()
{
TRACE("uint16_t * const f676()");
static uint16_t _f676 = 1;
- return (((_f676 = (uint16_t)-_f676) != 1) ? NULL : &_f676);
+ return (((_f676 = (uint16_t)~_f676) != 1) ? NULL : &_f676);
}
int32_t * const f677()
{
TRACE("int32_t * const f677()");
static int32_t _f677 = 1;
- return (((_f677 = (int32_t)-_f677) != 1) ? NULL : &_f677);
+ return (((_f677 = (int32_t)~_f677) != 1) ? NULL : &_f677);
}
uint32_t * const f678()
{
TRACE("uint32_t * const f678()");
static uint32_t _f678 = 1;
- return (((_f678 = (uint32_t)-_f678) != 1) ? NULL : &_f678);
+ return (((_f678 = (uint32_t)~_f678) != 1) ? NULL : &_f678);
}
int64_t * const f681()
{
TRACE("int64_t * const f681()");
static int64_t _f681 = 1;
- return (((_f681 = (int64_t)-_f681) != 1) ? NULL : &_f681);
+ return (((_f681 = (int64_t)~_f681) != 1) ? NULL : &_f681);
}
uint64_t * const f682()
{
TRACE("uint64_t * const f682()");
static uint64_t _f682 = 1;
- return (((_f682 = (uint64_t)-_f682) != 1) ? NULL : &_f682);
+ return (((_f682 = (uint64_t)~_f682) != 1) ? NULL : &_f682);
}
float * const f683()
@@ -2648,7 +2648,7 @@ void f712(const char * p0)
{
TRACE("void f712(const char *)");
static char _f712 = 1;
- CHECK((((_f712 = (char)-_f712) != 1) ^ (p0 == NULL)),
+ CHECK((((_f712 = (char)~_f712) != 1) ^ (p0 == NULL)),
"void f712(const char *)");
}
@@ -2656,7 +2656,7 @@ void f713(const int8_t * p0)
{
TRACE("void f713(const int8_t *)");
static int8_t _f713 = 1;
- CHECK((((_f713 = (int8_t)-_f713) != 1) ^ (p0 == NULL)),
+ CHECK((((_f713 = (int8_t)~_f713) != 1) ^ (p0 == NULL)),
"void f713(const int8_t *)");
}
@@ -2664,7 +2664,7 @@ void f714(const uint8_t * p0)
{
TRACE("void f714(const uint8_t *)");
static uint8_t _f714 = 1;
- CHECK((((_f714 = (uint8_t)-_f714) != 1) ^ (p0 == NULL)),
+ CHECK((((_f714 = (uint8_t)~_f714) != 1) ^ (p0 == NULL)),
"void f714(const uint8_t *)");
}
@@ -2672,7 +2672,7 @@ void f715(const int16_t * p0)
{
TRACE("void f715(const int16_t *)");
static int16_t _f715 = 1;
- CHECK((((_f715 = (int16_t)-_f715) != 1) ^ (p0 == NULL)),
+ CHECK((((_f715 = (int16_t)~_f715) != 1) ^ (p0 == NULL)),
"void f715(const int16_t *)");
}
@@ -2680,7 +2680,7 @@ void f716(const uint16_t * p0)
{
TRACE("void f716(const uint16_t *)");
static uint16_t _f716 = 1;
- CHECK((((_f716 = (uint16_t)-_f716) != 1) ^ (p0 == NULL)),
+ CHECK((((_f716 = (uint16_t)~_f716) != 1) ^ (p0 == NULL)),
"void f716(const uint16_t *)");
}
@@ -2688,7 +2688,7 @@ void f717(const int32_t * p0)
{
TRACE("void f717(const int32_t *)");
static int32_t _f717 = 1;
- CHECK((((_f717 = (int32_t)-_f717) != 1) ^ (p0 == NULL)),
+ CHECK((((_f717 = (int32_t)~_f717) != 1) ^ (p0 == NULL)),
"void f717(const int32_t *)");
}
@@ -2696,7 +2696,7 @@ void f718(const uint32_t * p0)
{
TRACE("void f718(const uint32_t *)");
static uint32_t _f718 = 1;
- CHECK((((_f718 = (uint32_t)-_f718) != 1) ^ (p0 == NULL)),
+ CHECK((((_f718 = (uint32_t)~_f718) != 1) ^ (p0 == NULL)),
"void f718(const uint32_t *)");
}
@@ -2704,7 +2704,7 @@ void f721(const int64_t * p0)
{
TRACE("void f721(const int64_t *)");
static int64_t _f721 = 1;
- CHECK((((_f721 = (int64_t)-_f721) != 1) ^ (p0 == NULL)),
+ CHECK((((_f721 = (int64_t)~_f721) != 1) ^ (p0 == NULL)),
"void f721(const int64_t *)");
}
@@ -2712,7 +2712,7 @@ void f722(const uint64_t * p0)
{
TRACE("void f722(const uint64_t *)");
static uint64_t _f722 = 1;
- CHECK((((_f722 = (uint64_t)-_f722) != 1) ^ (p0 == NULL)),
+ CHECK((((_f722 = (uint64_t)~_f722) != 1) ^ (p0 == NULL)),
"void f722(const uint64_t *)");
}
@@ -2744,7 +2744,7 @@ void f732(char * p0)
{
TRACE("void f732(char *)");
static char _f732 = 1;
- CHECK((((_f732 = (char)-_f732) != 1) ^ (p0 == NULL)),
+ CHECK((((_f732 = (char)~_f732) != 1) ^ (p0 == NULL)),
"void f732(char *)");
}
@@ -2752,7 +2752,7 @@ void f733(int8_t * p0)
{
TRACE("void f733(int8_t *)");
static int8_t _f733 = 1;
- CHECK((((_f733 = (int8_t)-_f733) != 1) ^ (p0 == NULL)),
+ CHECK((((_f733 = (int8_t)~_f733) != 1) ^ (p0 == NULL)),
"void f733(int8_t *)");
}
@@ -2760,7 +2760,7 @@ void f734(uint8_t * p0)
{
TRACE("void f734(uint8_t *)");
static uint8_t _f734 = 1;
- CHECK((((_f734 = (uint8_t)-_f734) != 1) ^ (p0 == NULL)),
+ CHECK((((_f734 = (uint8_t)~_f734) != 1) ^ (p0 == NULL)),
"void f734(uint8_t *)");
}
@@ -2768,7 +2768,7 @@ void f735(int16_t * p0)
{
TRACE("void f735(int16_t *)");
static int16_t _f735 = 1;
- CHECK((((_f735 = (int16_t)-_f735) != 1) ^ (p0 == NULL)),
+ CHECK((((_f735 = (int16_t)~_f735) != 1) ^ (p0 == NULL)),
"void f735(int16_t *)");
}
@@ -2776,7 +2776,7 @@ void f736(uint16_t * p0)
{
TRACE("void f736(uint16_t *)");
static uint16_t _f736 = 1;
- CHECK((((_f736 = (uint16_t)-_f736) != 1) ^ (p0 == NULL)),
+ CHECK((((_f736 = (uint16_t)~_f736) != 1) ^ (p0 == NULL)),
"void f736(uint16_t *)");
}
@@ -2784,7 +2784,7 @@ void f737(int32_t * p0)
{
TRACE("void f737(int32_t *)");
static int32_t _f737 = 1;
- CHECK((((_f737 = (int32_t)-_f737) != 1) ^ (p0 == NULL)),
+ CHECK((((_f737 = (int32_t)~_f737) != 1) ^ (p0 == NULL)),
"void f737(int32_t *)");
}
@@ -2792,7 +2792,7 @@ void f738(uint32_t * p0)
{
TRACE("void f738(uint32_t *)");
static uint32_t _f738 = 1;
- CHECK((((_f738 = (uint32_t)-_f738) != 1) ^ (p0 == NULL)),
+ CHECK((((_f738 = (uint32_t)~_f738) != 1) ^ (p0 == NULL)),
"void f738(uint32_t *)");
}
@@ -2800,7 +2800,7 @@ void f741(int64_t * p0)
{
TRACE("void f741(int64_t *)");
static int64_t _f741 = 1;
- CHECK((((_f741 = (int64_t)-_f741) != 1) ^ (p0 == NULL)),
+ CHECK((((_f741 = (int64_t)~_f741) != 1) ^ (p0 == NULL)),
"void f741(int64_t *)");
}
@@ -2808,7 +2808,7 @@ void f742(uint64_t * p0)
{
TRACE("void f742(uint64_t *)");
static uint64_t _f742 = 1;
- CHECK((((_f742 = (uint64_t)-_f742) != 1) ^ (p0 == NULL)),
+ CHECK((((_f742 = (uint64_t)~_f742) != 1) ^ (p0 == NULL)),
"void f742(uint64_t *)");
}
@@ -2840,7 +2840,7 @@ void f752(const char * const p0)
{
TRACE("void f752(const char * const)");
static char _f752 = 1;
- CHECK((((_f752 = (char)-_f752) != 1) ^ (p0 == NULL)),
+ CHECK((((_f752 = (char)~_f752) != 1) ^ (p0 == NULL)),
"void f752(const char * const)");
}
@@ -2848,7 +2848,7 @@ void f753(const int8_t * const p0)
{
TRACE("void f753(const int8_t * const)");
static int8_t _f753 = 1;
- CHECK((((_f753 = (int8_t)-_f753) != 1) ^ (p0 == NULL)),
+ CHECK((((_f753 = (int8_t)~_f753) != 1) ^ (p0 == NULL)),
"void f753(const int8_t * const)");
}
@@ -2856,7 +2856,7 @@ void f754(const uint8_t * const p0)
{
TRACE("void f754(const uint8_t * const)");
static uint8_t _f754 = 1;
- CHECK((((_f754 = (uint8_t)-_f754) != 1) ^ (p0 == NULL)),
+ CHECK((((_f754 = (uint8_t)~_f754) != 1) ^ (p0 == NULL)),
"void f754(const uint8_t * const)");
}
@@ -2864,7 +2864,7 @@ void f755(const int16_t * const p0)
{
TRACE("void f755(const int16_t * const)");
static int16_t _f755 = 1;
- CHECK((((_f755 = (int16_t)-_f755) != 1) ^ (p0 == NULL)),
+ CHECK((((_f755 = (int16_t)~_f755) != 1) ^ (p0 == NULL)),
"void f755(const int16_t * const)");
}
@@ -2872,7 +2872,7 @@ void f756(const uint16_t * const p0)
{
TRACE("void f756(const uint16_t * const)");
static uint16_t _f756 = 1;
- CHECK((((_f756 = (uint16_t)-_f756) != 1) ^ (p0 == NULL)),
+ CHECK((((_f756 = (uint16_t)~_f756) != 1) ^ (p0 == NULL)),
"void f756(const uint16_t * const)");
}
@@ -2880,7 +2880,7 @@ void f757(const int32_t * const p0)
{
TRACE("void f757(const int32_t * const)");
static int32_t _f757 = 1;
- CHECK((((_f757 = (int32_t)-_f757) != 1) ^ (p0 == NULL)),
+ CHECK((((_f757 = (int32_t)~_f757) != 1) ^ (p0 == NULL)),
"void f757(const int32_t * const)");
}
@@ -2888,7 +2888,7 @@ void f758(const uint32_t * const p0)
{
TRACE("void f758(const uint32_t * const)");
static uint32_t _f758 = 1;
- CHECK((((_f758 = (uint32_t)-_f758) != 1) ^ (p0 == NULL)),
+ CHECK((((_f758 = (uint32_t)~_f758) != 1) ^ (p0 == NULL)),
"void f758(const uint32_t * const)");
}
@@ -2896,7 +2896,7 @@ void f761(const int64_t * const p0)
{
TRACE("void f761(const int64_t * const)");
static int64_t _f761 = 1;
- CHECK((((_f761 = (int64_t)-_f761) != 1) ^ (p0 == NULL)),
+ CHECK((((_f761 = (int64_t)~_f761) != 1) ^ (p0 == NULL)),
"void f761(const int64_t * const)");
}
@@ -2904,7 +2904,7 @@ void f762(const uint64_t * const p0)
{
TRACE("void f762(const uint64_t * const)");
static uint64_t _f762 = 1;
- CHECK((((_f762 = (uint64_t)-_f762) != 1) ^ (p0 == NULL)),
+ CHECK((((_f762 = (uint64_t)~_f762) != 1) ^ (p0 == NULL)),
"void f762(const uint64_t * const)");
}
@@ -2936,7 +2936,7 @@ void f772(char * const p0)
{
TRACE("void f772(char * const)");
static char _f772 = 1;
- CHECK((((_f772 = (char)-_f772) != 1) ^ (p0 == NULL)),
+ CHECK((((_f772 = (char)~_f772) != 1) ^ (p0 == NULL)),
"void f772(char * const)");
}
@@ -2944,7 +2944,7 @@ void f773(int8_t * const p0)
{
TRACE("void f773(int8_t * const)");
static int8_t _f773 = 1;
- CHECK((((_f773 = (int8_t)-_f773) != 1) ^ (p0 == NULL)),
+ CHECK((((_f773 = (int8_t)~_f773) != 1) ^ (p0 == NULL)),
"void f773(int8_t * const)");
}
@@ -2952,7 +2952,7 @@ void f774(uint8_t * const p0)
{
TRACE("void f774(uint8_t * const)");
static uint8_t _f774 = 1;
- CHECK((((_f774 = (uint8_t)-_f774) != 1) ^ (p0 == NULL)),
+ CHECK((((_f774 = (uint8_t)~_f774) != 1) ^ (p0 == NULL)),
"void f774(uint8_t * const)");
}
@@ -2960,7 +2960,7 @@ void f775(int16_t * const p0)
{
TRACE("void f775(int16_t * const)");
static int16_t _f775 = 1;
- CHECK((((_f775 = (int16_t)-_f775) != 1) ^ (p0 == NULL)),
+ CHECK((((_f775 = (int16_t)~_f775) != 1) ^ (p0 == NULL)),
"void f775(int16_t * const)");
}
@@ -2968,7 +2968,7 @@ void f776(uint16_t * const p0)
{
TRACE("void f776(uint16_t * const)");
static uint16_t _f776 = 1;
- CHECK((((_f776 = (uint16_t)-_f776) != 1) ^ (p0 == NULL)),
+ CHECK((((_f776 = (uint16_t)~_f776) != 1) ^ (p0 == NULL)),
"void f776(uint16_t * const)");
}
@@ -2976,7 +2976,7 @@ void f777(int32_t * const p0)
{
TRACE("void f777(int32_t * const)");
static int32_t _f777 = 1;
- CHECK((((_f777 = (int32_t)-_f777) != 1) ^ (p0 == NULL)),
+ CHECK((((_f777 = (int32_t)~_f777) != 1) ^ (p0 == NULL)),
"void f777(int32_t * const)");
}
@@ -2984,7 +2984,7 @@ void f778(uint32_t * const p0)
{
TRACE("void f778(uint32_t * const)");
static uint32_t _f778 = 1;
- CHECK((((_f778 = (uint32_t)-_f778) != 1) ^ (p0 == NULL)),
+ CHECK((((_f778 = (uint32_t)~_f778) != 1) ^ (p0 == NULL)),
"void f778(uint32_t * const)");
}
@@ -2992,7 +2992,7 @@ void f781(int64_t * const p0)
{
TRACE("void f781(int64_t * const)");
static int64_t _f781 = 1;
- CHECK((((_f781 = (int64_t)-_f781) != 1) ^ (p0 == NULL)),
+ CHECK((((_f781 = (int64_t)~_f781) != 1) ^ (p0 == NULL)),
"void f781(int64_t * const)");
}
@@ -3000,7 +3000,7 @@ void f782(uint64_t * const p0)
{
TRACE("void f782(uint64_t * const)");
static uint64_t _f782 = 1;
- CHECK((((_f782 = (uint64_t)-_f782) != 1) ^ (p0 == NULL)),
+ CHECK((((_f782 = (uint64_t)~_f782) != 1) ^ (p0 == NULL)),
"void f782(uint64_t * const)");
}
=== added file 'storage/ndb/src/ndbjtie/jtie/test/myapi/test_myapi.cmd.in'
--- a/storage/ndb/src/ndbjtie/jtie/test/myapi/test_myapi.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myapi/test_myapi.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,55 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+set TEST="%BIN_DIR%\myapi_test"
+echo running %TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/jtie/test/myapi/test_myapi.sh.in'
--- a/storage/ndb/src/ndbjtie/jtie/test/myapi/test_myapi.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myapi/test_myapi.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+TEST="$BIN_DIR/myapi_test"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
=== modified file 'storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt 2011-07-31 10:04:20 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myjapi/CMakeLists.txt 2012-03-05 07:24:11 +0000
@@ -1,5 +1,4 @@
-
-# Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,10 +13,67 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-FILE(GLOB src1 ${CMAKE_CURRENT_SOURCE_DIR}/myjapi/*.java)
-FILE(GLOB src2 ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
+# neither wildcards (nor line breaks) for clean targets supported by cmake
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+ "test_myjapi.sh.log;test_myjapi.cmd.log")
+
+# the Java API wrapper and test
+SET(JAVA_SOURCE_DIRS
+ ${CMAKE_CURRENT_SOURCE_DIR}/myjapi
+ ${CMAKE_CURRENT_SOURCE_DIR}/test)
+
+SET(JAVA_SOURCES "")
+FOREACH(D ${JAVA_SOURCE_DIRS})
+ FILE(GLOB tmp ${D}/*.java)
+ LIST(APPEND JAVA_SOURCES ${tmp})
+ENDFOREACH()
+
+SET(CLASSPATH
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/test/myjapi/target/classes
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes)
-CREATE_JAR(jtie-test-myjapi ${src1} ${src2}
- CLASSPATH ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes
+SET(JARS
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/jtie.jar)
+
+CREATE_JAR(jtie-test-myjapi ${JAVA_SOURCES}
+ CLASSPATH ${CLASSPATH}
+ MERGE_JARS ${JARS}
DEPENDENCIES jtie.jar)
+IF(HAVE_JDK)
+
+ INCLUDE_DIRECTORIES(
+ ${JNI_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/utils
+ ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie
+ ${CMAKE_SOURCE_DIR}/storage/ndb/src/ndbjtie/jtie/test/myapi)
+
+ # enable safety behaviour, expected by a myjapi subtest
+ SET(CMAKE_CXX_FLAGS
+ "${CMAKE_CXX_FLAGS} -DJTIE_OBJECT_CLEAR_ADDRESS_UPON_DELETE")
+
+ # the Java API's JNI implementation
+ ADD_LIBRARY(libmyjapi SHARED myjapi_lib.cpp)
+ SET_TARGET_PROPERTIES(libmyjapi PROPERTIES OUTPUT_NAME "myjapi")
+ TARGET_LINK_LIBRARIES(libmyjapi libmyapi)
+
+ENDIF(HAVE_JDK)
+
+IF(WIN32)
+
+ # build the unit-test script for win
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_myjapi.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_myjapi.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+
+ELSE(WIN32)
+
+ # build the unit-test script for *nix
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_myjapi.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_myjapi.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_myjapi ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_myjapi.sh"
+ || echo "") # don't break the build if file was deleted
+
+ENDIF(WIN32)
=== modified file 'storage/ndb/src/ndbjtie/jtie/test/myjapi/MyApiWrapper.hpp'
--- a/storage/ndb/src/ndbjtie/jtie/test/myjapi/MyApiWrapper.hpp 2011-02-02 09:52:33 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myjapi/MyApiWrapper.hpp 2012-03-05 04:19:09 +0000
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -153,13 +153,13 @@ struct MyApiWrapper {
}
static void
- A__del( A & obj, B0 & b )
+ A__del__0( A & obj, B0 & b ) // disambiguate overloaded function for MSVC
{
obj.del(b);
}
static void
- A__del( A & obj, B1 & b )
+ A__del__1( A & obj, B1 & b ) // disambiguate overloaded function for MSVC
{
obj.del(b);
}
@@ -393,13 +393,13 @@ struct MyApiWrapper {
// ---------------------------------------------------------------------------
static C1 *
- C1__pass( C1 * c1 )
+ C1__pass__0( C1 * c1 ) // disambiguate overloaded function for MSVC
{
return C1::pass(c1);
}
static const C1 *
- C1__pass( const C1 * c1 )
+ C1__pass__1( const C1 * c1 ) // disambiguate overloaded function for MSVC
{
return C1::pass(c1);
}
=== modified file 'storage/ndb/src/ndbjtie/jtie/test/myjapi/myjapi_classes.hpp'
--- a/storage/ndb/src/ndbjtie/jtie/test/myjapi/myjapi_classes.hpp 2011-02-02 09:52:33 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myjapi/myjapi_classes.hpp 2012-03-05 04:19:09 +0000
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -218,7 +218,7 @@ Java_myjapi_A_del__Lmyjapi_B0_2(JNIEnv *
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
gcall_mfv< ttrait_myjapi_A_t, ttrait_myjapi_B0_r, &A::del >(env, obj, p0);
#else
- gcall_fv< ttrait_myjapi_A_r, ttrait_myjapi_B0_r, &MyApiWrapper::A__del >(env, NULL, obj, p0);
+ gcall_fv< ttrait_myjapi_A_r, ttrait_myjapi_B0_r, &MyApiWrapper::A__del__0 >(env, NULL, obj, p0);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -229,7 +229,7 @@ Java_myjapi_A_del__Lmyjapi_B1_2(JNIEnv *
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
gcall_mfv< ttrait_myjapi_A_t, ttrait_myjapi_B1_r, &A::del >(env, obj, p0);
#else
- gcall_fv< ttrait_myjapi_A_r, ttrait_myjapi_B1_r, &MyApiWrapper::A__del >(env, NULL, obj, p0);
+ gcall_fv< ttrait_myjapi_A_r, ttrait_myjapi_B1_r, &MyApiWrapper::A__del__1 >(env, NULL, obj, p0);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -978,7 +978,8 @@ Java_myjapi_CI_00024C1_pass__Lmyjapi_CI_
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
return gcall_fr< ttrait_myjapi_CI_C1Array_p, ttrait_myjapi_CI_C1Array_p, &C1::pass >(env, cls, p0);
#else
- return gcall_fr< ttrait_myjapi_CI_C1Array_p, ttrait_myjapi_CI_C1Array_p, &MyApiWrapper::C1__pass >(env, cls, p0);
+ return gcall_fr< ttrait_myjapi_CI_C1Array_p, ttrait_myjapi_CI_C1Array_p, &MyApiWrapper::C1__pass__0 >(env, cls, p0);
+ return 0;
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -989,7 +990,8 @@ Java_myjapi_CI_00024C1_pass__Lmyjapi_CI_
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
return gcall_fr< ttrait_myjapi_CI_C1Array_cp, ttrait_myjapi_CI_C1Array_cp, &C1::pass >(env, cls, p0);
#else
- return gcall_fr< ttrait_myjapi_CI_C1Array_cp, ttrait_myjapi_CI_C1Array_cp, &MyApiWrapper::C1__pass >(env, cls, p0);
+ return gcall_fr< ttrait_myjapi_CI_C1Array_cp, ttrait_myjapi_CI_C1Array_cp, &MyApiWrapper::C1__pass__1 >(env, cls, p0);
+ return 0;
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1155,9 +1157,9 @@ Java_myjapi_D0_f_1d0(JNIEnv * env, jobje
{
TRACE("jint Java_myjapi_D0_f_1d0(JNIEnv *, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- return gcall_mfr< ttrait_myjapi_D0_t, ttrait_int32, &D0::f_d0 >(env, obj);
+ return gcall_mfr< ttrait_myjapi_D0_t, ttrait_int, &D0::f_d0 >(env, obj);
#else
- return gcall_fr< ttrait_int32, ttrait_myjapi_D0_r, &MyApiWrapper::D0__f_d0 >(env, NULL, obj);
+ return gcall_fr< ttrait_int, ttrait_myjapi_D0_r, &MyApiWrapper::D0__f_d0 >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1166,9 +1168,9 @@ Java_myjapi_D0_f_1nv(JNIEnv * env, jclas
{
TRACE("jint Java_myjapi_D0_f_1nv(JNIEnv *, jclass, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- (void)cls; return gcall_mfr< ttrait_myjapi_D0_t, ttrait_int32, &D0::f_nv >(env, obj);
+ (void)cls; return gcall_mfr< ttrait_myjapi_D0_t, ttrait_int, &D0::f_nv >(env, obj);
#else
- (void)cls; return gcall_fr< ttrait_int32, ttrait_myjapi_D0_r, &MyApiWrapper::D0__f_nv >(env, NULL, obj);
+ (void)cls; return gcall_fr< ttrait_int, ttrait_myjapi_D0_r, &MyApiWrapper::D0__f_nv >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1177,9 +1179,9 @@ Java_myjapi_D0_f_1v(JNIEnv * env, jobjec
{
TRACE("jint Java_myjapi_D0_f_1v(JNIEnv *, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- return gcall_mfr< ttrait_myjapi_D0_t, ttrait_int32, &D0::f_v >(env, obj);
+ return gcall_mfr< ttrait_myjapi_D0_t, ttrait_int, &D0::f_v >(env, obj);
#else
- return gcall_fr< ttrait_int32, ttrait_myjapi_D0_r, &MyApiWrapper::D0__f_v >(env, NULL, obj);
+ return gcall_fr< ttrait_int, ttrait_myjapi_D0_r, &MyApiWrapper::D0__f_v >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1199,9 +1201,9 @@ Java_myjapi_D1_f_1d1(JNIEnv * env, jobje
{
TRACE("jint Java_myjapi_D1_f_1d1(JNIEnv *, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- return gcall_mfr< ttrait_myjapi_D1_t, ttrait_int32, &D1::f_d1 >(env, obj);
+ return gcall_mfr< ttrait_myjapi_D1_t, ttrait_int, &D1::f_d1 >(env, obj);
#else
- return gcall_fr< ttrait_int32, ttrait_myjapi_D1_r, &MyApiWrapper::D1__f_d1 >(env, NULL, obj);
+ return gcall_fr< ttrait_int, ttrait_myjapi_D1_r, &MyApiWrapper::D1__f_d1 >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1210,9 +1212,9 @@ Java_myjapi_D1_f_1nv(JNIEnv * env, jclas
{
TRACE("jint Java_myjapi_D1_f_1nv(JNIEnv *, jclass, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- (void)cls; return gcall_mfr< ttrait_myjapi_D1_t, ttrait_int32, &D1::f_nv >(env, obj);
+ (void)cls; return gcall_mfr< ttrait_myjapi_D1_t, ttrait_int, &D1::f_nv >(env, obj);
#else
- (void)cls; return gcall_fr< ttrait_int32, ttrait_myjapi_D1_r, &MyApiWrapper::D1__f_nv >(env, NULL, obj);
+ (void)cls; return gcall_fr< ttrait_int, ttrait_myjapi_D1_r, &MyApiWrapper::D1__f_nv >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1221,9 +1223,9 @@ Java_myjapi_D1_f_1v(JNIEnv * env, jobjec
{
TRACE("jint Java_myjapi_D1_f_1v(JNIEnv *, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- return gcall_mfr< ttrait_myjapi_D1_t, ttrait_int32, &D1::f_v >(env, obj);
+ return gcall_mfr< ttrait_myjapi_D1_t, ttrait_int, &D1::f_v >(env, obj);
#else
- return gcall_fr< ttrait_int32, ttrait_myjapi_D1_r, &MyApiWrapper::D1__f_v >(env, NULL, obj);
+ return gcall_fr< ttrait_int, ttrait_myjapi_D1_r, &MyApiWrapper::D1__f_v >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1243,9 +1245,9 @@ Java_myjapi_D2_f_1d2(JNIEnv * env, jobje
{
TRACE("jint Java_myjapi_D2_f_1d2(JNIEnv *, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- return gcall_mfr< ttrait_myjapi_D2_t, ttrait_int32, &D2::f_d2 >(env, obj);
+ return gcall_mfr< ttrait_myjapi_D2_t, ttrait_int, &D2::f_d2 >(env, obj);
#else
- return gcall_fr< ttrait_int32, ttrait_myjapi_D2_r, &MyApiWrapper::D2__f_d2 >(env, NULL, obj);
+ return gcall_fr< ttrait_int, ttrait_myjapi_D2_r, &MyApiWrapper::D2__f_d2 >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1254,9 +1256,9 @@ Java_myjapi_D2_f_1nv(JNIEnv * env, jclas
{
TRACE("jint Java_myjapi_D2_f_1nv(JNIEnv *, jclass, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- (void)cls; return gcall_mfr< ttrait_myjapi_D2_t, ttrait_int32, &D2::f_nv >(env, obj);
+ (void)cls; return gcall_mfr< ttrait_myjapi_D2_t, ttrait_int, &D2::f_nv >(env, obj);
#else
- (void)cls; return gcall_fr< ttrait_int32, ttrait_myjapi_D2_r, &MyApiWrapper::D2__f_nv >(env, NULL, obj);
+ (void)cls; return gcall_fr< ttrait_int, ttrait_myjapi_D2_r, &MyApiWrapper::D2__f_nv >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
@@ -1265,9 +1267,9 @@ Java_myjapi_D2_f_1v(JNIEnv * env, jobjec
{
TRACE("jint Java_myjapi_D2_f_1v(JNIEnv *, jobject)");
#ifndef JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
- return gcall_mfr< ttrait_myjapi_D2_t, ttrait_int32, &D2::f_v >(env, obj);
+ return gcall_mfr< ttrait_myjapi_D2_t, ttrait_int, &D2::f_v >(env, obj);
#else
- return gcall_fr< ttrait_int32, ttrait_myjapi_D2_r, &MyApiWrapper::D2__f_v >(env, NULL, obj);
+ return gcall_fr< ttrait_int, ttrait_myjapi_D2_r, &MyApiWrapper::D2__f_v >(env, NULL, obj);
#endif // JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
}
=== modified file 'storage/ndb/src/ndbjtie/jtie/test/myjapi/test/MyJapiTest.java'
--- a/storage/ndb/src/ndbjtie/jtie/test/myjapi/test/MyJapiTest.java 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myjapi/test/MyJapiTest.java 2012-03-05 07:24:11 +0000
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2487,6 +2487,8 @@ public class MyJapiTest {
out.println("\ncalling A.print()...");
try {
A.print(a);
+ // test for exception when passing an object after its deletion
+ // requires compile flag -DJTIE_OBJECT_CLEAR_ADDRESS_UPON_DELETE
throw new RuntimeException("Expected exception not thrown.");
} catch (AssertionError e) {
out.println("... successfully caught: " + e);
=== added file 'storage/ndb/src/ndbjtie/jtie/test/myjapi/test_myjapi.cmd.in'
--- a/storage/ndb/src/ndbjtie/jtie/test/myjapi/test_myjapi.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myjapi/test_myjapi.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,78 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+rem jvm
+set JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+set JAVA_FLAGS=-ea -Xcheck:jni
+set JAVA_ARCH=@Java_JAVA_ARCH_OPT@
+echo checking if JVM arch option %JAVA_ARCH% supported...
+%JAVA% %JAVA_ARCH% -version >nul 2>&1 || set JAVA_ARCH=
+echo.
+
+rem this test
+set JAVA_CLASSPATH=-classpath ".\jtie-test-myjapi-@JAVA_NDB_VERSION@.jar"
+set JAVA_LIBPATH=-Djava.library.path="%BIN_DIR%"
+set JAVA_DEFS=
+set JAVA_CLASS=test.MyJapiTest
+
+echo running
+echo. %JAVA%
+echo. %JAVA_ARCH% %JAVA_FLAGS%
+echo. %JAVA_CLASSPATH%
+echo. %JAVA_LIBPATH%
+echo. %JAVA_DEFS%
+echo. %JAVA_CLASS%
+
+set TEST=%JAVA% %JAVA_ARCH% %JAVA_FLAGS% ^
+ %JAVA_CLASSPATH% %JAVA_LIBPATH% %JAVA_DEFS% %JAVA_CLASS%
+rem echo TEST=%TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/jtie/test/myjapi/test_myjapi.sh.in'
--- a/storage/ndb/src/ndbjtie/jtie/test/myjapi/test_myjapi.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/myjapi/test_myjapi.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,50 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+# jvm
+JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+JAVA_ARCH="@Java_JAVA_ARCH_OPT@"
+JAVA_FLAGS="-ea -Xcheck:jni"
+
+# this test
+JAVA_CLASSPATH="-classpath ./jtie-test-myjapi-@JAVA_NDB_VERSION@.jar"
+JAVA_LIBPATH="-Djava.library.path=$BIN_DIR"
+JAVA_DEFS=""
+JAVA_CLASS="test.MyJapiTest"
+
+TEST="
+ $JAVA
+ $JAVA_ARCH $JAVA_FLAGS
+ $JAVA_CLASSPATH
+ $JAVA_LIBPATH
+ $JAVA_DEFS
+ $JAVA_CLASS"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
=== modified file 'storage/ndb/src/ndbjtie/jtie/test/unload/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/jtie/test/unload/CMakeLists.txt 2011-07-31 10:04:20 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/unload/CMakeLists.txt 2012-03-05 07:24:11 +0000
@@ -1,5 +1,4 @@
-
-# Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,9 +13,34 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-FILE(GLOB src ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
+# neither wildcards (nor line breaks) for clean targets supported by cmake
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+ "test_unload.sh.log;test_unload.cmd.log")
+
+FILE(GLOB JAVA_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
+
+SET(CLASSPATH
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/test/unload/target/classes)
+
+CREATE_JAR(jtie-test-unload ${JAVA_SOURCES}
+ CLASSPATH ${CLASSPATH})
+
+IF(WIN32)
+
+ # build the unit-test script for win
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_unload.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_unload.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+
+ELSE(WIN32)
-CREATE_JAR(jtie-test-unload ${src}
- CLASSPATH ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes
- DEPENDENCIES jtie.jar)
+ # build the unit-test script for *nix
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_unload.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_unload.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_unload ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_unload.sh"
+ || echo "") # don't break the build if file was deleted)
+ENDIF(WIN32)
=== modified file 'storage/ndb/src/ndbjtie/jtie/test/unload/test/MyLoadUnloadTest.java'
--- a/storage/ndb/src/ndbjtie/jtie/test/unload/test/MyLoadUnloadTest.java 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/unload/test/MyLoadUnloadTest.java 2012-03-05 07:24:11 +0000
@@ -461,7 +461,7 @@ public class MyLoadUnloadTest {
// run test
out.println();
out.println(" load class ...");
- Class cls = ucl.loadClass(cname);
+ Class<?> cls = ucl.loadClass(cname);
out.println(" ... loaded " + cls
+ " <" + cls.getClassLoader() + ">");
=== added file 'storage/ndb/src/ndbjtie/jtie/test/unload/test_unload.cmd.in'
--- a/storage/ndb/src/ndbjtie/jtie/test/unload/test_unload.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/unload/test_unload.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,83 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+rem jvm
+set JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+set JAVA_FLAGS=-ea -Xcheck:jni
+set JAVA_ARCH=@Java_JAVA_ARCH_OPT@
+echo checking if JVM arch option %JAVA_ARCH% supported...
+%JAVA% %JAVA_ARCH% -version >nul 2>&1 || set JAVA_ARCH=
+echo.
+
+rem this test
+set JAVA_CLASS=test.MyJapiTest
+set UNLOAD_TEST_JAR=.\jtie-test-unload-@JAVA_NDB_VERSION@.jar
+
+rem dependencies
+set MYJAPI=..\myjapi
+set MYJAPI_JAR=%MYJAPI%\jtie-test-myjapi-@JAVA_NDB_VERSION@.jar
+set JAVA_CLASSPATH=-classpath "%UNLOAD_TEST_JAR%;%MYJAPI_JAR%"
+set JAVA_LIBPATH=-Djava.library.path="%MYJAPI%\%BIN_DIR%"
+set JAVA_DEFS=-Dcom.mysql.jtie.test.MyLoadUnloadTest.target_package_prefixes=test.,myjapi. -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_class_name=test.MyJapiTest -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_method_name=test
+
+echo running
+echo. %JAVA%
+echo. %JAVA_ARCH% %JAVA_FLAGS%
+echo. %JAVA_CLASSPATH%
+echo. %JAVA_LIBPATH%
+echo. %JAVA_DEFS%
+echo. %JAVA_CLASS%
+
+set TEST=%JAVA% %JAVA_ARCH% %JAVA_FLAGS% ^
+ %JAVA_CLASSPATH% %JAVA_LIBPATH% %JAVA_DEFS% %JAVA_CLASS%
+rem echo TEST=%TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/jtie/test/unload/test_unload.sh.in'
--- a/storage/ndb/src/ndbjtie/jtie/test/unload/test_unload.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/jtie/test/unload/test_unload.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,58 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+# jvm
+JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+JAVA_ARCH="@Java_JAVA_ARCH_OPT@"
+JAVA_FLAGS="-ea -Xcheck:jni"
+
+# this test
+JAVA_CLASS="test.MyLoadUnloadTest"
+UNLOAD_TEST_JAR="jtie-test-unload-@JAVA_NDB_VERSION@.jar"
+
+# dependencies
+MYJAPI="../myjapi"
+MYJAPI_JAR="$MYJAPI/jtie-test-myjapi-@JAVA_NDB_VERSION@.jar"
+JAVA_CLASSPATH="-classpath $UNLOAD_TEST_JAR:$MYJAPI_JAR"
+JAVA_LIBPATH="-Djava.library.path=$MYJAPI/$BIN_DIR"
+JAVA_DEFS\
+="-Dcom.mysql.jtie.test.MyLoadUnloadTest.target_package_prefixes=test.,myjapi.
+ -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_class_name=test.MyJapiTest
+ -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_method_name=test"
+
+TEST="
+ $JAVA
+ $JAVA_ARCH $JAVA_FLAGS
+ $JAVA_CLASSPATH
+ $JAVA_LIBPATH
+ $JAVA_DEFS
+ $JAVA_CLASS"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
=== modified file 'storage/ndb/src/ndbjtie/test/CMakeLists.txt'
--- a/storage/ndb/src/ndbjtie/test/CMakeLists.txt 2011-07-31 10:04:20 +0000
+++ b/storage/ndb/src/ndbjtie/test/CMakeLists.txt 2012-03-05 07:24:11 +0000
@@ -1,4 +1,4 @@
-# Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,14 +13,91 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-FILE(GLOB JAVA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
+# neither wildcards (nor line breaks) for clean targets supported by cmake
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+ "test_mutils.sh.log;test_mutils.cmd.log;test_ndbjtie_multilib.sh.log;test_ndbjtie_multilib.cmd.log;test_ndbjtie_smoke.sh.log;test_ndbjtie_smoke.cmd.log;test_unload_mutils.sh.log;test_unload_mutils.cmd.log;test_unload_ndbjtie_multilib.sh.log;test_unload_ndbjtie_multilib.cmd.log;test_unload_ndbjtie_smoke.sh.log;test_unload_ndbjtie_smoke.cmd.log;")
-SET ( CLASSPATH
+# the test classes
+FILE(GLOB JAVA_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/test/*.java)
+
+SET(CLASSPATH
+ ${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/test/target/classes
${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/target/classes
${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/target/classes
${CMAKE_BINARY_DIR}/storage/ndb/src/ndbjtie/jtie/test/myjapi/target/classes)
-CREATE_JAR(ndbjtie-test ${JAVA_SOURCES}
- CLASSPATH ${CLASSPATH}
- DEPENDENCIES ndbjtie.jar jtie-test-myjapi.jar)
+CREATE_JAR(ndbjtie-test ${JAVA_SOURCES}
+ CLASSPATH ${CLASSPATH}
+ DEPENDENCIES ndbjtie.jar jtie.jar jtie-test-myjapi.jar)
+
+# ndb71@win32: compile issues with including <NdbTap.hpp>
+#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include/util
+# ${CMAKE_SOURCE_DIR}/unittest/mytap)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/unittest/mytap)
+
+ADD_EXECUTABLE(ndbjtie_unit_tests-t ndbjtie_unit_tests-t.cpp)
+
+IF(WIN32)
+
+ # build the unit-test scripts for win
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_mutils.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_mutils.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_ndbjtie_multilib.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_ndbjtie_multilib.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_ndbjtie_smoke.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_ndbjtie_smoke.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_unload_mutils.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_unload_mutils.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_unload_ndbjtie_multilib.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_unload_ndbjtie_multilib.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_unload_ndbjtie_smoke.cmd.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_unload_ndbjtie_smoke.cmd
+ @ONLY NEWLINE_STYLE WIN32)
+
+ELSE(WIN32)
+
+ # build the unit-test scripts for *nix
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_mutils.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_mutils.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_mutils ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_mutils.sh"
+ || echo "") # don't break the build if file was deleted)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_ndbjtie_multilib.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_ndbjtie_multilib.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_ndbjtie_multilib ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_ndbjtie_multilib.sh"
+ || echo "") # don't break the build if file was deleted)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_ndbjtie_smoke.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_ndbjtie_smoke.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_ndbjtie_smoke ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_ndbjtie_smoke.sh"
+ || echo "") # don't break the build if file was deleted)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_unload_mutils.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_unload_mutils.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_unload_mutils ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_unload_mutils.sh"
+ || echo "") # don't break the build if file was deleted)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_unload_ndbjtie_multilib.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_unload_ndbjtie_multilib.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_unload_ndbjtie_multilib ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_unload_ndbjtie_multilib.sh"
+ || echo "") # don't break the build if file was deleted)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_unload_ndbjtie_smoke.sh.in
+ ${CMAKE_CURRENT_BINARY_DIR}/test_unload_ndbjtie_smoke.sh
+ @ONLY NEWLINE_STYLE UNIX)
+ ADD_CUSTOM_TARGET(chmod_x_unload_ndbjtie_smoke ALL
+ chmod a+x "${CMAKE_CURRENT_BINARY_DIR}/test_unload_ndbjtie_smoke.sh"
+ || echo "") # don't break the build if file was deleted)
+ENDIF(WIN32)
=== renamed file 'storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t' => 'storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.alt' (properties changed: +x to -x)
--- a/storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t 2011-02-02 09:52:33 +0000
+++ b/storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.alt 2012-03-05 04:19:09 +0000
@@ -1,6 +1,5 @@
#!/bin/sh
-
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,61 +14,61 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# see: The MySQL Test Framework :: 7 Creating and Executing Unit Tests
-# (MySQL Cluster Documentation)/mysqltest/en/unit-test.html
-# see: Test Anything Protocol (TAP)
+# This script runs a collection of unit-tests and reports their
+# status to stdout according to the Test Anything Protocol (TAP):
# http://testanything.org/wiki/index.php/Main_Page
# http://en.wikipedia.org/wiki/Test_Anything_Protocol
+# Any additional, non-TAP output by this script and the unit tests is
+# redirected to a local log file.
-# not sure which protocol version we're using
-#echo "TAP version 13"
-
-# test range
-echo "1..6"
-
-script_dir=`dirname $0`
-
-# log file for output from this script
-log="ndbjtie_unit_tests-t.log"
+# TAP: report test plan
+plan="1..6"
+echo "$plan"
+
+this_dir="`dirname $0`"
+this_name="`basename $0`"
+
+# log file for non-TAP output from this script
+log="$this_dir/$this_name.log"
+echo "# detailed ndbjtie test output in log file: '$log'"
rm -f "$log"
touch "$log"
+echo "running tests: $plan" >> "$log" 2>&1
test_counter=0
-#
-# Run a simpler shell script test, and report it as TAP
-#
-# Arguments:
-# shell script hame
-#
+# Runs a unit test script and report its status as TAP.
+# Arguments: unit test hame
run_test()
{
test_name=$1;
test_counter=`expr $test_counter + 1`
- script_name="$script_dir/$test_name.sh"
-
- echo "running test '$script_name':" >> "$log" 2>&1
- if [ ! -x "$script_name" ];
- then
- status="ok $test_counter # skip $test_name due to missing test file"
+ script_dir="$this_dir"
+ script_name="test_$test_name.sh"
+ script_path="$script_dir/$script_name"
+
+ echo "\nrunning test '$script_path':" >> "$log" 2>&1
+ if [ ! -x "$script_path" ]; then
+ status="not ok $test_counter - $test_name # missing file '$script_path'"
else
- ./$script_name >> "$log" 2>&1
s=""
+ ( cd $script_dir ; ./$script_name ) >> "$log" 2>&1
if [ "$?" -ne "0" ]; then
s="not "
fi
- status="${s}ok $test_counter - $test_name"
+ status="${s}ok $test_counter - ndbjtie test: $test_name"
fi;
echo "$status" >> "$log" 2>&1
- echo "" >> "$log" 2>&1
+
+ # TAP: report unit test status
echo "$status"
}
-run_test "test_mutils_decimal"
-run_test "test_mutils_charsetmap"
-run_test "test_ndbjtie_library"
-run_test "test_unload_mutils_decimal"
-run_test "test_unload_mutils_charsetmap"
-run_test "test_unload_ndbjtie_library"
+run_test "mutils"
+run_test "ndbjtie_multilib"
+run_test "ndbjtie_smoke"
+run_test "unload_mutils"
+run_test "unload_ndbjtie_multilib"
+run_test "unload_ndbjtie_smoke"
-echo "done." >> "$log" 2>&1
+echo "\ndone." >> "$log" 2>&1
=== added file 'storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp'
--- a/storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.cpp 2012-03-05 04:19:09 +0000
@@ -0,0 +1,175 @@
+/*
+ Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+/*
+ * ndbjtie_unit_tests-t.cpp
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+// ndb71@win32: unresolved compile errors ('VOID' : undeclared identifier)
+// in C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\dbghelp.h(931)
+// when including <NdbTap.hpp>; hence, using directly:
+#include <tap.h>
+#include <tap.c>
+
+// platform-specific functions and settings
+#ifdef _WIN32
+#define SNPRINTF _snprintf_s
+#define FILE_SEPARATOR '\\'
+#define SCRIPT_FILE_SUFFIX ".cmd"
+#define SCRIPT_COMMAND_SEPARATOR "&&"
+#else
+#define system system
+#define SNPRINTF snprintf
+#define FILE_SEPARATOR '/'
+#define SCRIPT_FILE_SUFFIX ".sh"
+#define SCRIPT_COMMAND_SEPARATOR ";"
+#endif
+
+/**
+ * Runs a test script located in subdirectory.
+ */
+void run_test_script(const char * this_dir,
+ const char * test_name)
+{
+ assert(this_dir);
+ assert(test_name);
+
+ // directory, name, path of test script to run
+ const int path_max = 1024; // FILENAME_MAX is ISO-C but may be huge
+ char script_dir[path_max];
+ char script_name[path_max];
+ char script_path[path_max];
+ SNPRINTF(script_dir, sizeof(script_dir), "%s",
+ this_dir);
+ SNPRINTF(script_name, sizeof(script_name), "test_%s" SCRIPT_FILE_SUFFIX,
+ test_name);
+ SNPRINTF(script_path, sizeof(script_path), "%s%c%s",
+ script_dir, FILE_SEPARATOR, script_name);
+ //printf("script_dir='%s'\n", script_dir);
+ //printf("script_name='%s'\n", script_name);
+ //printf("script_path='%s'\n", script_path);
+
+ // try to locate script; also try from parent dir as multi-config builds
+ // may place binaries in a config subdirectory
+ FILE * script = fopen(script_path, "r");
+ const char * bin_dir = "."; // subdir for binaries
+ if (!script) {
+ printf("\nnot found test script at '%s'\n", script_path);
+
+ // re-root script dir and path
+ char * sep = strrchr(script_dir, FILE_SEPARATOR);
+ if (sep != NULL) {
+ *sep = '\0';
+ bin_dir = sep+1;
+ }
+ SNPRINTF(script_path, sizeof(script_path), "%s%c%s",
+ script_dir, FILE_SEPARATOR, script_name);
+ //printf("script_dir='%s'\n", script_dir);
+ //printf("script_path='%s'\n", script_path);
+
+ // try re-rooted path
+ script = fopen(script_path, "r");
+ if (!script) {
+ printf("also not found test script at '%s'\n", script_path);
+ // TAP: skip tests (args: count, non-null format string)
+ skip(1, "missing script for subtest '%s'", test_name);
+ fflush(stdout);
+ fflush(stderr);
+ return;
+ }
+ }
+ fclose(script);
+ printf("\nfound test script at '%s'\n", script_path);
+ //printf("bin_dir='%s'\n", bin_dir);
+
+ // run the test script with exit status (using ISO-C's system() call)
+ printf("\nTEST: %s\n", test_name);
+ char script_cmd[3 * path_max];
+ SNPRINTF(script_cmd, sizeof(script_cmd), "cd %s %s .%c%s %s",
+ script_dir, SCRIPT_COMMAND_SEPARATOR,
+ FILE_SEPARATOR, script_name, bin_dir);
+ //printf("script_cmd='%s'\n", script_cmd);
+ printf(">>> running '%s'\n", script_cmd);
+ fflush(stdout); // system() requires all open streams to be flushed
+ fflush(stderr);
+ int status = system(script_cmd);
+ fflush(stdout);
+ fflush(stderr);
+ printf("<<< exit status == %d\n", status);
+ if (status) {
+ fprintf(stderr,
+ "------------------------------------------------------------\n"
+ "ERROR: failed subtest %s, exit status=%d\n"
+ "------------------------------------------------------------\n",
+ test_name, status);
+ }
+
+ // TAP: report test result (args: passed, non-null format string)
+ ok(status == 0, "subtest: %s", test_name);
+ fflush(stdout);
+ fflush(stderr);
+}
+
+int main(int argc, char **argv)
+{
+ // extract the path and file name by which this program is being called
+ // to locate and run the platform test scripts in the subdirectories;
+ // convert any forward slashes as when called from perl (even on win).
+ for (char * c = *argv; *c != '\0'; c++)
+ if (*c == '/') *c = FILE_SEPARATOR;
+ const char * this_dir = *argv;
+ const char * this_name = *argv;
+ char * sep = strrchr(*argv, FILE_SEPARATOR);
+ if (sep == NULL) {
+ this_dir = ".";
+ } else {
+ *sep = '\0';
+ this_name = sep+1;
+ }
+ //printf("this_dir='%s'\n", this_dir);
+ //printf("this_name='%s'\n", this_name);
+ assert(this_dir);
+ assert(this_name);
+
+ // TAP: print number of tests to run
+ plan(6);
+
+ // run tests
+ run_test_script(this_dir, "mutils");
+ run_test_script(this_dir, "ndbjtie_multilib");
+ run_test_script(this_dir, "ndbjtie_smoke");
+ // TAP: configured by MYTAP_CONFIG environment var
+ // XXX for initial testing: run all
+ //if (skip_big_tests) {
+ if (false) {
+ printf("\n");
+ skip(1, "big subtest unload_mutils");
+ skip(1, "big subtest unload_ndbjtie_multilib");
+ skip(1, "big subtest unload_ndbjtie_smoke");
+ } else {
+ run_test_script(this_dir, "unload_mutils");
+ run_test_script(this_dir, "unload_ndbjtie_multilib");
+ run_test_script(this_dir, "unload_ndbjtie_smoke");
+ }
+
+ // TAP: print summary report and return exit status
+ return exit_status();
+}
=== modified file 'storage/ndb/src/ndbjtie/test/test/JTieTestBase.java'
--- a/storage/ndb/src/ndbjtie/test/test/JTieTestBase.java 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/test/test/JTieTestBase.java 2012-03-05 07:24:11 +0000
@@ -1,6 +1,5 @@
/*
- Copyright 2010 Sun Microsystems, Inc.
- All rights reserved. Use is subject to license terms.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,19 +28,16 @@ import java.io.PrintWriter;
public abstract class JTieTestBase {
static protected final PrintWriter out = new PrintWriter(System.out, true);
-
static protected final PrintWriter err = new PrintWriter(System.err, true);
/**
- * Loads a dynamically linked system library and reports any failures.
+ * Loads a dynamically linked library.
*/
static protected void loadSystemLibrary(String name) {
out.println("--> JTieTestBase.loadSystemLibrary(String)");
final Class cls = JTieTestBase.class;
out.println(" " + cls + " <" + cls.getClassLoader() + ">");
-
- out.println();
out.println(" loading libary " + name + " ...");
try {
System.loadLibrary(name);
@@ -62,7 +58,6 @@ public abstract class JTieTestBase {
}
out.println(" ... loaded " + name);
- out.println();
out.println("<-- JTieTestBase.loadSystemLibrary(String)");
}
=== removed file 'storage/ndb/src/ndbjtie/test/test/MySqlUtilsDecimalTest.java'
--- a/storage/ndb/src/ndbjtie/test/test/MySqlUtilsDecimalTest.java 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/test/test/MySqlUtilsDecimalTest.java 1970-01-01 00:00:00 +0000
@@ -1,125 +0,0 @@
-/*
- Copyright 2010 Sun Microsystems, Inc.
- All rights reserved. Use is subject to license terms.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-/*
- * MySqlUtilsDecimalTest.java
- */
-
-package test;
-
-import java.io.PrintWriter;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-
-import com.mysql.ndbjtie.mysql.Utils;
-
-/**
- * Tests the basic functioning of the NdbJTie libary: mysql decimal utils
- * for string-binary conversions.
- */
-public class MySqlUtilsDecimalTest extends JTieTestBase {
-
- public void test_s2b2s(String s, int prec, int scale) {
- out.print(" [" + prec + "/" + scale + "] '" + s + "' => ");
- out.flush();
-
- // write string buffer
- final ByteBuffer sbuf = ByteBuffer.allocateDirect(128);
- final byte[] b;
- try {
- b = s.getBytes("US-ASCII");
- } catch (java.io.UnsupportedEncodingException ex) {
- throw new RuntimeException(ex);
- }
- assert (s.equals(new String(b)));
- assert (b.length < sbuf.capacity());
- sbuf.put(b);
- assert (b.length == sbuf.position());
- sbuf.flip();
- assert (b.length == sbuf.limit());
-
- // clear binary buffer
- final ByteBuffer bbuf = ByteBuffer.allocateDirect(128);
- bbuf.clear();
- for (int i = 0; i < bbuf.capacity(); i++) bbuf.put((byte)0);
- bbuf.rewind();
-
- // string->binary
- assert (sbuf.position() == 0);
- assert (bbuf.position() == 0);
- final int r1 = Utils.decimal_str2bin(sbuf, sbuf.capacity(),
- prec, scale,
- bbuf, bbuf.capacity());
- if (r1 != Utils.E_DEC_OK) {
- out.println("decimal_str2bin() returned: " + r1);
- return;
- }
-
- // clear string buffer
- sbuf.clear();
- for (int i = 0; i < sbuf.capacity(); i++) sbuf.put((byte)0);
- sbuf.rewind();
-
- // binary->string
- assert (bbuf.position() == 0);
- assert (sbuf.position() == 0);
- final int r2 = Utils.decimal_bin2str(bbuf, bbuf.capacity(),
- prec, scale,
- sbuf, sbuf.capacity());
- if (r2 != Utils.E_DEC_OK) {
- out.println("decimal_bin2str() returned: " + r2);
- return;
- }
-
- // read string buffer
- assert (sbuf.position() == 0);
- sbuf.limit(prec);
- final String t = Charset.forName("US-ASCII").decode(sbuf).toString();
-
- out.println("'" + t + "'");
- }
-
- public void test() {
- out.println("--> MySqlUtilsDecimalTest.test()");
-
- // load native library
- loadSystemLibrary("ndbclient");
-
- test_s2b2s("3.3", 2, 1);
- test_s2b2s("124.000", 20, 4);
- test_s2b2s("-11", 14, 1);
- test_s2b2s("1.123456000000000", 20, 16);
- test_s2b2s("0", 20, 10);
- test_s2b2s("1 ", 20, 10);
- test_s2b2s("1,35", 20, 10);
- test_s2b2s("text",20, 10);
-
- out.println();
- out.println("<-- MySqlUtilsDecimalTest.test()");
- };
-
- static public void main(String[] args) throws Exception {
- out.println("--> MySqlUtilsDecimalTest.main()");
-
- out.println();
- MySqlUtilsDecimalTest test = new MySqlUtilsDecimalTest();
- test.test();
-
- out.println();
- out.println("<-- MySqlUtilsDecimalTest.main()");
- }
-}
=== renamed file 'storage/ndb/src/ndbjtie/test/test/MySqlUtilsCharsetMapTest.java' => 'storage/ndb/src/ndbjtie/test/test/MySqlUtilsTest.java'
--- a/storage/ndb/src/ndbjtie/test/test/MySqlUtilsCharsetMapTest.java 2011-09-30 15:21:28 +0000
+++ b/storage/ndb/src/ndbjtie/test/test/MySqlUtilsTest.java 2012-03-05 04:19:09 +0000
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
- * MySqlUtilsCharsetMapTest.java
+ * MySqlUtilsTest.java
*/
package test;
@@ -25,34 +25,34 @@ import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.util.Arrays;
+import com.mysql.ndbjtie.mysql.Utils;
import com.mysql.ndbjtie.mysql.CharsetMap;
import com.mysql.ndbjtie.mysql.CharsetMapConst;
/**
- * Tests the basic functioning of the NdbJTie libary: mysql CharsetMap utils
- * for character set conversions.
+ * Tests NdbJTie's mysql utilities: CharsetMap utils for character set
+ * conversions, decimal utils for string-binary conversions.
*/
-public class MySqlUtilsCharsetMapTest extends JTieTestBase {
+public class MySqlUtilsTest extends JTieTestBase {
- static public ByteBuffer char2bb(char[] c) {
+ static public ByteBuffer char2bb(char[] c) {
int len = c.length;
ByteBuffer bb = ByteBuffer.allocateDirect(len);
- for(int i = 0 ; i < len ; i++)
- bb.put((byte) c[i]);
+ for(int i = 0 ; i < len ; i++)
+ bb.put((byte) c[i]);
bb.rewind();
return bb;
}
- String bbdump (ByteBuffer sbb) {
+ static String bbdump (ByteBuffer sbb) {
ByteBuffer bb = sbb.asReadOnlyBuffer();
byte[] bytes = new byte[bb.capacity()];
bb.get(bytes);
bb.rewind();
return Arrays.toString(bytes);
}
-
-
- int bbcmp(ByteBuffer sbb1, ByteBuffer sbb2) {
+
+ static int bbcmp(ByteBuffer sbb1, ByteBuffer sbb2) {
ByteBuffer bb1 = sbb1.asReadOnlyBuffer();
ByteBuffer bb2 = sbb2.asReadOnlyBuffer();
Byte b1, b2;
@@ -62,11 +62,11 @@ public class MySqlUtilsCharsetMapTest ex
if(b1 > b2) return 1;
if(b1 < b2) return -1;
} while((b1 != 0) && (b2 != 0));
-
- return 0;
+
+ return 0;
}
-
- int bbncmp(ByteBuffer sbb1, ByteBuffer sbb2, int n) {
+
+ static int bbncmp(ByteBuffer sbb1, ByteBuffer sbb2, int n) {
ByteBuffer bb1 = sbb1.asReadOnlyBuffer();
ByteBuffer bb2 = sbb2.asReadOnlyBuffer();
Byte b1, b2;
@@ -77,93 +77,95 @@ public class MySqlUtilsCharsetMapTest ex
if(b1 > b2) return 1;
if(b1 < b2) return -1;
} while (i++ < n);
-
+
return 0;
}
-
+
+ // ----------------------------------------------------------------------
+
public void printRecodeResult(int rcode, int lengths[], ByteBuffer b1,
ByteBuffer b2)
{
- out.println(" Return code: " + rcode + " Len0: "
+ out.println(" Return code: " + rcode + " Len0: "
+ lengths[0] + " Len1: " + lengths[1] + "\n"
- + " " + bbdump(b1) + " => " + bbdump(b2)
+ + " " + bbdump(b1) + " => " + bbdump(b2)
);
}
-
-
- public void test() {
+
+
+ public void testCharsetMap() {
int latin1_num, utf8_num, utf16_num;
- out.println("--> MySqlUtilsCharsetMapTest.test()");
+ out.println("--> MySqlUtilsTest.testCharsetMap()");
// load native library
loadSystemLibrary("ndbclient");
CharsetMap csmap = CharsetMap.create();
-
- out.println(" --> Test that mysql includes UTF-8 and 16-bit Unicode");
+
+ out.println("--> Test that mysql includes UTF-8 and 16-bit Unicode");
utf8_num = csmap.getUTF8CharsetNumber();
utf16_num = csmap.getUTF16CharsetNumber();
- out.println(" UTF-8 charset num: " + utf8_num +
- " UTF-16 or UCS-2 charset num: " + utf16_num);
+ out.println(" UTF-8 charset num: " + utf8_num +
+ " UTF-16 or UCS-2 charset num: " + utf16_num);
assert( ! ((utf8_num == 0) || (utf16_num == 0)));
- out.println(" <-- Test that mysql includes UTF-8 and 16-bit Unicode");
-
-
- out.println(" --> Test CharsetMap::getName()");
+ out.println("<-- Test that mysql includes UTF-8 and 16-bit Unicode");
+
+
+ out.println("--> Test CharsetMap::getName()");
String utf8_name = csmap.getName(utf8_num);
String utf16 = csmap.getMysqlName(csmap.getUTF16CharsetNumber());
assert(utf8_name.compareTo("UTF-8") == 0);
/* MySQL 5.1 and earlier will have UCS-2 but later versions may have true
UTF-16. For information, print whether UTF-16 or UCS-2 is being used. */
- out.println(" Using mysql \"" + utf16 + "\" for UTF-16.");
- out.println(" <-- Test CharsetMap::getName()");
-
- /* Now we're going to recode.
+ out.println(" Using mysql \"" + utf16 + "\" for UTF-16.");
+ out.println("<-- Test CharsetMap::getName()");
+
+ /* Now we're going to recode.
We test with a string that begins with the character
LATIN SMALL LETTER U WITH DIARESIS - unicode code point U+00FC.
In the latin1 encoding this is a literal 0xFC,
but in the UTF-8 representation it is 0xC3 0xBC.
*/
-
- final char[] cmy_word_latin1 = new char[] { 0xFC, 'l', 'k', 'e', 'r', 0 };
- final char[] cmy_word_utf8 = new char[] { 0xC3, 0xBC, 'l', 'k', 'e', 'r', 0 };
+
+ final char[] cmy_word_latin1 = new char[] { 0xFC, 'l', 'k', 'e', 'r', 0 };
+ final char[] cmy_word_utf8 = new char[] { 0xC3, 0xBC, 'l', 'k', 'e', 'r', 0 };
final char[] cmy_word_truncated = new char[] { 0xC3, 0xBC, 'l', 'k', 0 };
final char[] cmy_bad_utf8 = new char[] { 'l' , 0xBC, 'a', 'd', 0 };
-
-
- out.println(" --> CharsetMap::recode() Tests");
- {
+
+ out.println("--> CharsetMap::recode() Tests");
+
+ {
ByteBuffer my_word_latin1 = char2bb(cmy_word_latin1);
ByteBuffer my_word_utf8 = char2bb(cmy_word_utf8);
- out.println(" --> Test that latin1 is available.");
- latin1_num = csmap.getCharsetNumber("latin1");
- out.println(" latin1 charset number: " + latin1_num +
+ out.println("--> Test that latin1 is available.");
+ latin1_num = csmap.getCharsetNumber("latin1");
+ out.println(" latin1 charset number: " + latin1_num +
" standard name: " + csmap.getName(latin1_num));
assert(latin1_num != 0);
- assert(csmap.getName(latin1_num).compareTo("windows-1252") == 0);
- out.println(" Latin1 source string: " + bbdump(my_word_latin1) + "\n" +
- " UTF8 source string: " + bbdump(my_word_utf8));
- out.println(" <-- Test that latin1 is available.");
+ assert(csmap.getName(latin1_num).compareTo("windows-1252") == 0);
+ out.println(" Latin1 source string: " + bbdump(my_word_latin1) + "\n" +
+ " UTF8 source string: " + bbdump(my_word_utf8));
+ out.println("<-- Test that latin1 is available.");
}
-
+
{
- out.println(" --> RECODE TEST 1: recode from UTF-8 to Latin 1");
+ out.println("--> RECODE TEST 1: recode from UTF-8 to Latin 1");
ByteBuffer my_word_utf8 = char2bb(cmy_word_utf8);
ByteBuffer result_buff = ByteBuffer.allocateDirect(16);
int[] lengths = new int[] { 7 , 16 };
-
- int rr1 = csmap.recode(lengths, utf8_num, latin1_num,
+
+ int rr1 = csmap.recode(lengths, utf8_num, latin1_num,
my_word_utf8, result_buff);
printRecodeResult(rr1, lengths, my_word_utf8, result_buff);
assert(rr1 == CharsetMapConst.RecodeStatus.RECODE_OK);
assert(lengths[0] == 7);
assert(lengths[1] == 6);
assert(bbcmp(char2bb(cmy_word_latin1), result_buff) == 0);
- out.println(" <-- RECODE TEST 1");
- }
-
+ out.println("<-- RECODE TEST 1");
+ }
+
{
- out.println(" --> RECODE TEST 2: recode from Latin1 to to UTF-8");
+ out.println("--> RECODE TEST 2: recode from Latin1 to to UTF-8");
ByteBuffer my_word_latin1 = char2bb(cmy_word_latin1);
ByteBuffer result_buff = ByteBuffer.allocateDirect(16);
int[] lengths = new int[] { 6 , 16 };
@@ -175,16 +177,16 @@ public class MySqlUtilsCharsetMapTest ex
assert(lengths[0] == 6);
assert(lengths[1] == 7);
assert(bbcmp(result_buff, char2bb(cmy_word_utf8)) == 0);
- out.println(" <-- RECODE TEST 2");
+ out.println("<-- RECODE TEST 2");
}
{
- out.println(" --> RECODE TEST 3: too-small result buffer");
+ out.println("--> RECODE TEST 3: too-small result buffer");
ByteBuffer my_word_latin1 = char2bb(cmy_word_latin1);
ByteBuffer result_buff = ByteBuffer.allocateDirect(16);
ByteBuffer my_word_truncated = char2bb(cmy_word_truncated);
int[] lengths = new int[] { 6 , 4 }; // 4 is too small
-
+
int rr3 = csmap.recode(lengths, latin1_num, utf8_num,
my_word_latin1, result_buff);
printRecodeResult(rr3, lengths, my_word_latin1, result_buff);
@@ -193,55 +195,55 @@ public class MySqlUtilsCharsetMapTest ex
assert(lengths[1] == 4);
/* Confirm that the first four characters were indeed recoded: */
assert(bbncmp(result_buff, char2bb(cmy_word_truncated), 4) == 0);
- out.println(" <-- RECODE TEST 3");
+ out.println("<-- RECODE TEST 3");
}
{
- out.println(" --> RECODE TEST 4: invalid character set");
+ out.println("--> RECODE TEST 4: invalid character set");
ByteBuffer my_word_latin1 = char2bb(cmy_word_latin1);
ByteBuffer result_buff = ByteBuffer.allocateDirect(16);
- int[] lengths = new int[] { 6 , 16 };
+ int[] lengths = new int[] { 6 , 16 };
int rr4 = csmap.recode(lengths, 0, 999, my_word_latin1, result_buff);
- out.println(" Return code: " + rr4);
+ out.println(" Return code: " + rr4);
assert(rr4 == CharsetMapConst.RecodeStatus.RECODE_BAD_CHARSET);
- out.println(" <-- RECODE TEST 4");
+ out.println("<-- RECODE TEST 4");
}
-
+
{
- out.println(" --> RECODE TEST 5: source string is ill-formed UTF-8");
+ out.println("--> RECODE TEST 5: source string is ill-formed UTF-8");
ByteBuffer my_bad_utf8 = char2bb(cmy_bad_utf8);
ByteBuffer result_buff = ByteBuffer.allocateDirect(16);
- int[] lengths = new int[] { 5 , 16 };
- int rr5 = csmap.recode(lengths, utf8_num, latin1_num,
+ int[] lengths = new int[] { 5 , 16 };
+ int rr5 = csmap.recode(lengths, utf8_num, latin1_num,
my_bad_utf8, result_buff);
- out.println(" Return code: " + rr5);
+ out.println(" Return code: " + rr5);
assert(rr5 == CharsetMapConst.RecodeStatus.RECODE_BAD_SRC);
- out.println(" <-- RECODE TEST 5");
+ out.println("<-- RECODE TEST 5");
}
-
+
{
- out.println(" --> RECODE TEST 6: convert an actual java string to UTF-8");
+ out.println("--> RECODE TEST 6: convert an actual java string to UTF-8");
// Load the string into a ByteBuffer
ByteBuffer str_bb = ByteBuffer.allocateDirect(16);
CharBuffer cb = str_bb.asCharBuffer();
cb.append("\u00FClker");
cb.rewind();
- ByteBuffer result_buff = ByteBuffer.allocateDirect(16);
+ ByteBuffer result_buff = ByteBuffer.allocateDirect(16);
int[] lengths = new int[] { 12 , 16 };
- int rr6 = csmap.recode(lengths, utf16_num, utf8_num,
+ int rr6 = csmap.recode(lengths, utf16_num, utf8_num,
str_bb, result_buff);
- printRecodeResult(rr6, lengths, str_bb, result_buff);
+ printRecodeResult(rr6, lengths, str_bb, result_buff);
assert(lengths[0]) == 12;
assert(lengths[1]) == 7;
- assert(bbncmp(result_buff, char2bb(cmy_word_utf8), 6) == 0);
- out.println(" <-- RECODE TEST 6");
+ assert(bbncmp(result_buff, char2bb(cmy_word_utf8), 6) == 0);
+ out.println("<-- RECODE TEST 6");
}
-
+
out.println();
-
+
{
- out.println(" --> IS MULTIBYTE TEST");
+ out.println("--> IS MULTIBYTE TEST");
boolean[] result = csmap.isMultibyte(latin1_num);
assert(!result[0]);
result = csmap.isMultibyte(utf16_num);
@@ -257,26 +259,118 @@ public class MySqlUtilsCharsetMapTest ex
else nSingle++;
}
}
- out.println(" Unused: " + nNull +
+ out.println(" Unused: " + nNull +
" single-byte: " +nSingle + " multi-byte: " + nMulti );
assert(nNull > 0);
assert(nSingle > 0);
assert(nMulti > 0);
- out.println(" <-- IS MULTIBYTE TEST");
- }
- out.println("<-- MySqlUtilsCharsetMapTest.test()");
+ out.println("<-- IS MULTIBYTE TEST");
+ }
+ out.println("<-- MySqlUtilsTest.testCharsetMap()");
+ };
+
+ // ----------------------------------------------------------------------
+
+ public void test_s2b2s(String s, int prec, int scale) {
+ out.print(" [" + prec + "/" + scale + "] '" + s + "' => ");
+ out.flush();
+
+ // write string buffer
+ final ByteBuffer sbuf = ByteBuffer.allocateDirect(128);
+ final byte[] b;
+ try {
+ b = s.getBytes("US-ASCII");
+ } catch (java.io.UnsupportedEncodingException ex) {
+ throw new RuntimeException(ex);
+ }
+ assert (s.equals(new String(b)));
+ assert (b.length < sbuf.capacity());
+ sbuf.put(b);
+ assert (b.length == sbuf.position());
+ sbuf.flip();
+ assert (b.length == sbuf.limit());
+
+ // clear binary buffer
+ final ByteBuffer bbuf = ByteBuffer.allocateDirect(128);
+ bbuf.clear();
+ for (int i = 0; i < bbuf.capacity(); i++) bbuf.put((byte)0);
+ bbuf.rewind();
+
+ // string->binary
+ assert (sbuf.position() == 0);
+ assert (bbuf.position() == 0);
+ final int r1 = Utils.decimal_str2bin(sbuf, sbuf.capacity(),
+ prec, scale,
+ bbuf, bbuf.capacity());
+ if (r1 != Utils.E_DEC_OK) {
+ out.println("decimal_str2bin() returned: " + r1);
+ return;
+ }
+
+ // clear string buffer
+ sbuf.clear();
+ for (int i = 0; i < sbuf.capacity(); i++) sbuf.put((byte)0);
+ sbuf.rewind();
+
+ // binary->string
+ assert (bbuf.position() == 0);
+ assert (sbuf.position() == 0);
+ final int r2 = Utils.decimal_bin2str(bbuf, bbuf.capacity(),
+ prec, scale,
+ sbuf, sbuf.capacity());
+ if (r2 != Utils.E_DEC_OK) {
+ out.println("decimal_bin2str() returned: " + r2);
+ return;
+ }
+
+ // read string buffer
+ assert (sbuf.position() == 0);
+ sbuf.limit(prec);
+ final String t = Charset.forName("US-ASCII").decode(sbuf).toString();
+
+ out.println("'" + t + "'");
+ }
+
+ public void testDecimalConv() {
+ out.println("--> MySqlUtilsTest.testDecimalConv()");
+
+ // load native library
+ loadSystemLibrary("ndbclient");
+
+ test_s2b2s("3.3", 2, 1);
+ test_s2b2s("124.000", 20, 4);
+ test_s2b2s("-11", 14, 1);
+ test_s2b2s("1.123456000000000", 20, 16);
+ test_s2b2s("0", 20, 10);
+ test_s2b2s("1 ", 20, 10);
+ test_s2b2s("1,35", 20, 10);
+ test_s2b2s("text",20, 10);
+
+ out.println();
+ out.println("<-- MySqlUtilsTest.testDecimalConv()");
};
+ // ----------------------------------------------------------------------
+
+ public void test() {
+ out.println("--> MySqlUtilsTest.test()");
+
+ testCharsetMap();
+ testDecimalConv();
+
+ out.println();
+ out.println("<-- MySqlUtilsTest.test()");
+ };
static public void main(String[] args) throws Exception {
- out.println("--> MySqlUtilsCharsetMapTest.main()");
+ out.println("--> MySqlUtilsTest.main()");
out.println();
- MySqlUtilsCharsetMapTest test = new MySqlUtilsCharsetMapTest();
+ MySqlUtilsTest test = new MySqlUtilsTest();
test.test();
out.println();
- out.println("<-- MySqlUtilsCharsetMapTest.main()");
+ out.println("<-- MySqlUtilsTest.main()");
}
}
=== renamed file 'storage/ndb/src/ndbjtie/test/test/NdbJTieLibraryLoadingTest.java' => 'storage/ndb/src/ndbjtie/test/test/NdbJTieMultiLibTest.java'
--- a/storage/ndb/src/ndbjtie/test/test/NdbJTieLibraryLoadingTest.java 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/test/test/NdbJTieMultiLibTest.java 2012-03-05 07:24:11 +0000
@@ -1,6 +1,5 @@
/*
- Copyright 2010 Sun Microsystems, Inc.
- All rights reserved. Use is subject to license terms.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,7 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
- * NdbJTieLibraryLoadingTest.java
+ * NdbJTieMultiLibTest.java
*/
package test;
@@ -27,10 +26,10 @@ import com.mysql.ndbjtie.ndbapi.NDBAPI;
/**
* Tests the loading of the NdbJTie libary in presence of other native libs.
*/
-public class NdbJTieLibraryLoadingTest extends JTieTestBase {
+public class NdbJTieMultiLibTest extends JTieTestBase {
public void test() {
- out.println("--> NdbJTieLibraryLoadingTest.test()");
+ out.println("--> NdbJTieMultiLibTest.test()");
// load native library and class #1
out.println();
@@ -45,17 +44,17 @@ public class NdbJTieLibraryLoadingTest e
out.println(" loaded: " + NDBAPI.class);
out.println();
- out.println("<-- NdbJTieLibraryLoadingTest.test()");
+ out.println("<-- NdbJTieMultiLibTest.test()");
};
-
+
static public void main(String[] args) throws Exception {
- out.println("--> NdbJTieLibraryLoadingTest.main()");
+ out.println("--> NdbJTieMultiLibTest.main()");
out.println();
- NdbJTieLibraryLoadingTest test = new NdbJTieLibraryLoadingTest();
+ NdbJTieMultiLibTest test = new NdbJTieMultiLibTest();
test.test();
-
+
out.println();
- out.println("<-- NdbJTieLibraryLoadingTest.main()");
+ out.println("<-- NdbJTieMultiLibTest.main()");
}
}
=== modified file 'storage/ndb/src/ndbjtie/test/test/NdbJTieSmokeTest.java'
--- a/storage/ndb/src/ndbjtie/test/test/NdbJTieSmokeTest.java 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/ndbjtie/test/test/NdbJTieSmokeTest.java 2012-03-05 07:24:11 +0000
@@ -1,6 +1,5 @@
/*
- Copyright 2010 Sun Microsystems, Inc.
- All rights reserved. Use is subject to license terms.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,66 +33,56 @@ import com.mysql.ndbjtie.ndbapi.NdbError
public class NdbJTieSmokeTest extends JTieTestBase {
private String mgmdConnect = "localhost";
- private String catalog = "crunddb";
+ private String catalog = "db";
private String schema = "def";
private Ndb_cluster_connection mgmd;
private Ndb ndb;
- protected void init() {
+ protected int init() {
// load native library
loadSystemLibrary("ndbclient");
- // Get system variable for other connect string
- mgmdConnect = System.getProperty("jtie.unit.ndb.connectstring", mgmdConnect);
+ // get system variable for connect string
+ mgmdConnect
+ = System.getProperty("jtie.unit.ndb.connectstring", mgmdConnect);
- // instantiate NDB cluster singleton
+ // instantiate cluster singleton
out.println();
- out.println("creating cluster conn...");
+ out.println(" creating mgmd conn...");
mgmd = Ndb_cluster_connection.create(mgmdConnect);
assert mgmd != null;
- out.println("... [ok, mgmd=" + mgmd + "]");
+ out.println(" ... [ok, mgmd=" + mgmd + "]");
- // connect to cluster management node (ndb_mgmd)
+ // try to connect to cluster management node (ndb_mgmd)
out.println();
- out.println("connecting to mgmd ...");
+ out.println(" connecting to mgmd ...");
final int retries = 0; // retries (< 0 = indefinitely)
final int delay = 0; // seconds to wait after retry
- final int verbose = 1; // print report of progess
+ final int verbose = 0; // print report of progess
// 0 = success, 1 = recoverable error, -1 = non-recoverable error
- //if (Ndb_cluster_connection.connect(mgmd, retries, delay, verbose) != 0) {
- if (mgmd.connect(retries, delay, verbose) != 0) {
- final String msg = ("mgmd@" + mgmdConnect
- + " was not ready within "
- + (retries * delay) + "s.");
- out.println(msg);
- throw new RuntimeException(msg);
- }
- out.println("... [ok: " + mgmdConnect + "]");
+ final int status = mgmd.connect(retries, delay, verbose);
+ out.println(" ... [" + (status == 0 ? "" : "NOT ")
+ + "connected to mgmd@" + mgmdConnect
+ + " within " + (retries * delay) + "s]");
+ return status;
}
protected void close() {
+ assert mgmd != null;
out.println();
- out.println("closing mgmd conn ...");
- if (mgmd != null)
- Ndb_cluster_connection.delete(mgmd);
- out.println("... [ok, mgmd=" + mgmd + "]");
+ out.println(" closing mgmd conn ...");
+ Ndb_cluster_connection.delete(mgmd);
+ out.println(" ... [ok, mgmd=" + mgmd + "]");
mgmd = null;
-
-/*
- cout << "closing NDBAPI ... " << flush;
- // ndb_close must be called last
- ndb_end(0);
- cout << " [ok]" << endl;
-*/
}
protected void initConnection(String catalog, String schema) {
- // optionally, connect and wait for reaching the data nodes (ndbds)
+ // connect and wait for reaching the data nodes (ndbds)
out.println();
- out.println("waiting until ready...");
- final int initial_wait = 10; // seconds to wait until first node detected
- final int final_wait = 0; // seconds to wait after first node detected
+ out.println(" waiting until ready...");
+ final int initial_wait = 10; // secs to wait until first node detected
+ final int final_wait = 0; // secs to wait after first node detected
// returns: 0 all nodes live, > 0 at least one node live, < 0 error
if (mgmd.wait_until_ready(initial_wait, final_wait) < 0) {
final String msg = ("data nodes were not ready within "
@@ -101,35 +90,38 @@ public class NdbJTieSmokeTest extends JT
out.println(msg);
throw new RuntimeException(msg);
}
- out.println("... [ok]");
+ out.println(" ... [ok]");
// connect to database
out.println();
- out.println("connecting to database...");
+ out.println(" connecting to database...");
ndb = Ndb.create(mgmd, catalog, schema);
+ assert ndb != null;
final int max_no_tx = 10; // maximum number of parallel tx (<=1024)
// note each scan or index scan operation uses one extra transaction
if (ndb.init(max_no_tx) != 0) {
String msg = "Error caught: " + ndb.getNdbError().message();
throw new RuntimeException(msg);
}
- out.println("... [ok]");
+ out.println(" ... [ok]");
}
protected void closeConnection() {
+ assert ndb != null;
out.println();
- out.println("closing database conn ...");
+ out.println(" closing database conn ...");
Ndb.delete(ndb);
ndb = null;
- out.println("... [ok]");
+ out.println(" ... [ok]");
}
public void test() {
out.println("--> NdbJTieSmokeTest.test()");
- init();
- initConnection(catalog, schema);
- closeConnection();
+ if (init() == 0) {
+ initConnection(catalog, schema);
+ closeConnection();
+ }
close();
out.println();
=== added file 'storage/ndb/src/ndbjtie/test/test_mutils.cmd.in'
--- a/storage/ndb/src/ndbjtie/test/test_mutils.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_mutils.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,84 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+rem jvm
+set JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+set JAVA_FLAGS=-ea -Xcheck:jni
+set JAVA_ARCH=@Java_JAVA_ARCH_OPT@
+echo checking if JVM arch option %JAVA_ARCH% supported...
+%JAVA% %JAVA_ARCH% -version >nul 2>&1 || set JAVA_ARCH=
+echo.
+
+rem this test
+set JAVA_CLASS=test.MySqlUtilsTest
+set TEST_JAR=ndbjtie-test-@JAVA_NDB_VERSION@.jar
+
+rem dependencies
+set NDBJTIE=..
+set NDBCLIENT=..\..
+set NDBJTIE_JAR=%NDBJTIE%\ndbjtie-@JAVA_NDB_VERSION@.jar
+set JAVA_CLASSPATH=-classpath "%TEST_JAR%;%NDBJTIE_JAR%"
+set JAVA_LIBPATH=-Djava.library.path="%NDBCLIENT%\%BIN_DIR%"
+set JAVA_DEFS=
+
+echo running
+echo. %JAVA%
+echo. %JAVA_ARCH% %JAVA_FLAGS%
+echo. %JAVA_CLASSPATH%
+echo. %JAVA_LIBPATH%
+echo. %JAVA_DEFS%
+echo. %JAVA_CLASS%
+
+set TEST=%JAVA% %JAVA_ARCH% %JAVA_FLAGS% ^
+ %JAVA_CLASSPATH% %JAVA_LIBPATH% %JAVA_DEFS% %JAVA_CLASS%
+rem echo TEST=%TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/test/test_mutils.sh.in'
--- a/storage/ndb/src/ndbjtie/test/test_mutils.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_mutils.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+# jvm
+JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+JAVA_ARCH="@Java_JAVA_ARCH_OPT@"
+JAVA_FLAGS="-ea -Xcheck:jni"
+
+# this test
+JAVA_CLASS="test.MySqlUtilsTest"
+TEST_JAR="ndbjtie-test-@JAVA_NDB_VERSION@.jar"
+
+# dependencies
+NDBJTIE=".."
+NDBCLIENT="../.."
+NDBJTIE_JAR="$NDBJTIE/ndbjtie-@JAVA_NDB_VERSION@.jar"
+JAVA_CLASSPATH="-classpath $TEST_JAR:$NDBJTIE_JAR"
+JAVA_LIBPATH="-Djava.library.path=$NDBCLIENT/$BIN_DIR"
+JAVA_DEFS=""
+
+TEST="
+ $JAVA
+ $JAVA_ARCH $JAVA_FLAGS
+ $JAVA_CLASSPATH
+ $JAVA_LIBPATH
+ $JAVA_DEFS
+ $JAVA_CLASS"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
=== added file 'storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.cmd.in'
--- a/storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,86 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+rem jvm
+set JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+set JAVA_FLAGS=-ea -Xcheck:jni
+set JAVA_ARCH=@Java_JAVA_ARCH_OPT@
+echo checking if JVM arch option %JAVA_ARCH% supported...
+%JAVA% %JAVA_ARCH% -version >nul 2>&1 || set JAVA_ARCH=
+echo.
+
+rem this test
+set JAVA_CLASS=test.NdbJTieMultiLibTest
+set TEST_JAR=ndbjtie-test-@JAVA_NDB_VERSION@.jar
+
+rem dependencies
+set NDBJTIE=..
+set NDBCLIENT=..\..
+set MYJAPI=..\jtie\test\myjapi
+set NDBJTIE_JAR=%NDBJTIE%\ndbjtie-@JAVA_NDB_VERSION@.jar
+set MYJAPI_JAR=%MYJAPI%\jtie-test-myjapi-@JAVA_NDB_VERSION@.jar
+set JAVA_CLASSPATH=-classpath "%TEST_JAR%;%MYJAPI_JAR%;%NDBJTIE_JAR%"
+set JAVA_LIBPATH=-Djava.library.path="%MYJAPI%\%BIN_DIR%;%NDBCLIENT%\%BIN_DIR%"
+set JAVA_DEFS=
+
+echo running
+echo. %JAVA%
+echo. %JAVA_ARCH% %JAVA_FLAGS%
+echo. %JAVA_CLASSPATH%
+echo. %JAVA_LIBPATH%
+echo. %JAVA_DEFS%
+echo. %JAVA_CLASS%
+
+set TEST=%JAVA% %JAVA_ARCH% %JAVA_FLAGS% ^
+ %JAVA_CLASSPATH% %JAVA_LIBPATH% %JAVA_DEFS% %JAVA_CLASS%
+rem echo TEST=%TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.sh.in'
--- a/storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_ndbjtie_multilib.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,58 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+# jvm
+JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+JAVA_ARCH="@Java_JAVA_ARCH_OPT@"
+JAVA_FLAGS="-ea -Xcheck:jni"
+
+# this test
+JAVA_CLASS="test.NdbJTieMultiLibTest"
+TEST_JAR="ndbjtie-test-@JAVA_NDB_VERSION@.jar"
+
+# dependencies
+NDBJTIE=".."
+NDBCLIENT="../.."
+MYJAPI="../jtie/test/myjapi"
+NDBJTIE_JAR="$NDBJTIE/ndbjtie-@JAVA_NDB_VERSION@.jar"
+MYJAPI_JAR="$MYJAPI/jtie-test-myjapi-@JAVA_NDB_VERSION@.jar"
+JAVA_CLASSPATH="-classpath $TEST_JAR:$MYJAPI_JAR:$NDBJTIE_JAR"
+JAVA_LIBPATH="-Djava.library.path=$MYJAPI/$BIN_DIR:$NDBCLIENT/$BIN_DIR"
+JAVA_DEFS=""
+
+TEST="
+ $JAVA
+ $JAVA_ARCH $JAVA_FLAGS
+ $JAVA_CLASSPATH
+ $JAVA_LIBPATH
+ $JAVA_DEFS
+ $JAVA_CLASS"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
=== added file 'storage/ndb/src/ndbjtie/test/test_ndbjtie_smoke.cmd.in'
--- a/storage/ndb/src/ndbjtie/test/test_ndbjtie_smoke.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_ndbjtie_smoke.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,84 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+rem jvm
+set JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+set JAVA_FLAGS=-ea -Xcheck:jni
+set JAVA_ARCH=@Java_JAVA_ARCH_OPT@
+echo checking if JVM arch option %JAVA_ARCH% supported...
+%JAVA% %JAVA_ARCH% -version >nul 2>&1 || set JAVA_ARCH=
+echo.
+
+rem this test
+set JAVA_CLASS=test.NdbJTieSmokeTest
+set TEST_JAR=ndbjtie-test-@JAVA_NDB_VERSION@.jar
+
+rem dependencies
+set NDBJTIE=..
+set NDBCLIENT=..\..
+set NDBJTIE_JAR=%NDBJTIE%\ndbjtie-@JAVA_NDB_VERSION@.jar
+set JAVA_CLASSPATH=-classpath "%TEST_JAR%;%NDBJTIE_JAR%"
+set JAVA_LIBPATH=-Djava.library.path="%NDBCLIENT%\%BIN_DIR%"
+set JAVA_DEFS=
+
+echo running
+echo. %JAVA%
+echo. %JAVA_ARCH% %JAVA_FLAGS%
+echo. %JAVA_CLASSPATH%
+echo. %JAVA_LIBPATH%
+echo. %JAVA_DEFS%
+echo. %JAVA_CLASS%
+
+set TEST=%JAVA% %JAVA_ARCH% %JAVA_FLAGS% ^
+ %JAVA_CLASSPATH% %JAVA_LIBPATH% %JAVA_DEFS% %JAVA_CLASS%
+rem echo TEST=%TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/test/test_ndbjtie_smoke.sh.in'
--- a/storage/ndb/src/ndbjtie/test/test_ndbjtie_smoke.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_ndbjtie_smoke.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+# jvm
+JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+JAVA_ARCH="@Java_JAVA_ARCH_OPT@"
+JAVA_FLAGS="-ea -Xcheck:jni"
+
+# this test
+JAVA_CLASS="test.NdbJTieSmokeTest"
+TEST_JAR="ndbjtie-test-@JAVA_NDB_VERSION@.jar"
+
+# dependencies
+NDBJTIE=".."
+NDBCLIENT="../.."
+NDBJTIE_JAR="$NDBJTIE/ndbjtie-@JAVA_NDB_VERSION@.jar"
+JAVA_CLASSPATH="-classpath $TEST_JAR:$NDBJTIE_JAR"
+JAVA_LIBPATH="-Djava.library.path=$NDBCLIENT/$BIN_DIR"
+JAVA_DEFS=""
+
+TEST="
+ $JAVA
+ $JAVA_ARCH $JAVA_FLAGS
+ $JAVA_CLASSPATH
+ $JAVA_LIBPATH
+ $JAVA_DEFS
+ $JAVA_CLASS"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
=== added file 'storage/ndb/src/ndbjtie/test/test_unload_mutils.cmd.in'
--- a/storage/ndb/src/ndbjtie/test/test_unload_mutils.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_unload_mutils.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,85 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+rem jvm
+set JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+set JAVA_FLAGS=-ea -Xcheck:jni
+set JAVA_ARCH=@Java_JAVA_ARCH_OPT@
+echo checking if JVM arch option %JAVA_ARCH% supported...
+%JAVA% %JAVA_ARCH% -version >nul 2>&1 || set JAVA_ARCH=
+echo.
+
+rem this test
+set JAVA_CLASS=test.MyLoadUnloadTest
+set UNLOAD_TEST_JAR=..\jtie\test\unload\jtie-test-unload-@JAVA_NDB_VERSION@.jar
+
+rem dependencies
+set NDBJTIE=..
+set NDBCLIENT=..\..
+set NDBJTIE_JAR=%NDBJTIE%\ndbjtie-@JAVA_NDB_VERSION@.jar
+set NDBJTIE_TEST_JAR=ndbjtie-test-@JAVA_NDB_VERSION@.jar
+set JAVA_CLASSPATH=-classpath "%UNLOAD_TEST_JAR%;%NDBJTIE_TEST_JAR%;%NDBJTIE_JAR%"
+set JAVA_LIBPATH=-Djava.library.path="%NDBCLIENT%\%BIN_DIR%"
+set JAVA_DEFS=-Dcom.mysql.jtie.test.MyLoadUnloadTest.target_package_prefixes=test.,com.mysql.ndbjtie. -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_class_name=test.MySqlUtilsTest -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_method_name=test
+
+echo running
+echo. %JAVA%
+echo. %JAVA_ARCH% %JAVA_FLAGS%
+echo. %JAVA_CLASSPATH%
+echo. %JAVA_LIBPATH%
+echo. %JAVA_DEFS%
+echo. %JAVA_CLASS%
+
+set TEST=%JAVA% %JAVA_ARCH% %JAVA_FLAGS% ^
+ %JAVA_CLASSPATH% %JAVA_LIBPATH% %JAVA_DEFS% %JAVA_CLASS%
+rem echo TEST=%TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/test/test_unload_mutils.sh.in'
--- a/storage/ndb/src/ndbjtie/test/test_unload_mutils.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_unload_mutils.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,57 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+# jvm
+JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+JAVA_ARCH="@Java_JAVA_ARCH_OPT@"
+JAVA_FLAGS="-ea -Xcheck:jni"
+
+# this test
+JAVA_CLASS="test.MyLoadUnloadTest"
+UNLOAD_TEST_JAR="../jtie/test/unload/jtie-test-unload-@JAVA_NDB_VERSION@.jar"
+
+# dependencies
+NDBJTIE=".."
+NDBCLIENT="../.."
+NDBJTIE_JAR="$NDBJTIE/ndbjtie-@JAVA_NDB_VERSION@.jar"
+NDBJTIE_TEST_JAR="ndbjtie-test-@JAVA_NDB_VERSION@.jar"
+JAVA_CLASSPATH="-classpath $UNLOAD_TEST_JAR:$NDBJTIE_TEST_JAR:$NDBJTIE_JAR"
+JAVA_LIBPATH="-Djava.library.path=$NDBCLIENT/$BIN_DIR"
+JAVA_DEFS="-Dcom.mysql.jtie.test.MyLoadUnloadTest.target_package_prefixes=test.,com.mysql.ndbjtie. -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_class_name=test.MySqlUtilsTest -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_method_name=test"
+
+TEST="
+ $JAVA
+ $JAVA_ARCH $JAVA_FLAGS
+ $JAVA_CLASSPATH
+ $JAVA_LIBPATH
+ $JAVA_DEFS
+ $JAVA_CLASS"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
=== added file 'storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.cmd.in'
--- a/storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,87 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+rem jvm
+set JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+set JAVA_FLAGS=-ea -Xcheck:jni
+set JAVA_ARCH=@Java_JAVA_ARCH_OPT@
+echo checking if JVM arch option %JAVA_ARCH% supported...
+%JAVA% %JAVA_ARCH% -version >nul 2>&1 || set JAVA_ARCH=
+echo.
+
+rem this test
+set JAVA_CLASS=test.MyLoadUnloadTest
+set UNLOAD_TEST_JAR=..\jtie\test\unload\jtie-test-unload-@JAVA_NDB_VERSION@.jar
+
+rem dependencies
+set NDBJTIE=..
+set NDBCLIENT=..\..
+set MYJAPI=..\jtie\test\myjapi
+set NDBJTIE_JAR=%NDBJTIE%\ndbjtie-@JAVA_NDB_VERSION@.jar
+set MYJAPI_JAR=%MYJAPI%\jtie-test-myjapi-@JAVA_NDB_VERSION@.jar
+set NDBJTIE_TEST_JAR=ndbjtie-test-@JAVA_NDB_VERSION@.jar
+set JAVA_CLASSPATH=-classpath "%UNLOAD_TEST_JAR%;%NDBJTIE_TEST_JAR%;%MYJAPI_JAR%;%NDBJTIE_JAR%"
+set JAVA_LIBPATH=-Djava.library.path="%MYJAPI%\%BIN_DIR%;%NDBCLIENT%\%BIN_DIR%"
+set JAVA_DEFS=-Dcom.mysql.jtie.test.MyLoadUnloadTest.target_package_prefixes=test.,myjapi.,com.mysql.ndbjtie. -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_class_name=test.NdbJTieMultiLibTest -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_method_name=test
+
+echo running
+echo. %JAVA%
+echo. %JAVA_ARCH% %JAVA_FLAGS%
+echo. %JAVA_CLASSPATH%
+echo. %JAVA_LIBPATH%
+echo. %JAVA_DEFS%
+echo. %JAVA_CLASS%
+
+set TEST=%JAVA% %JAVA_ARCH% %JAVA_FLAGS% ^
+ %JAVA_CLASSPATH% %JAVA_LIBPATH% %JAVA_DEFS% %JAVA_CLASS%
+rem echo TEST=%TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.sh.in'
--- a/storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_multilib.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,59 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+# jvm
+JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+JAVA_ARCH="@Java_JAVA_ARCH_OPT@"
+JAVA_FLAGS="-ea -Xcheck:jni"
+
+# this test
+JAVA_CLASS="test.MyLoadUnloadTest"
+UNLOAD_TEST_JAR="../jtie/test/unload/jtie-test-unload-@JAVA_NDB_VERSION@.jar"
+
+# dependencies
+NDBJTIE=".."
+NDBCLIENT="../.."
+MYJAPI="../jtie/test/myjapi"
+NDBJTIE_JAR="$NDBJTIE/ndbjtie-@JAVA_NDB_VERSION@.jar"
+MYJAPI_JAR="$MYJAPI/jtie-test-myjapi-@JAVA_NDB_VERSION@.jar"
+NDBJTIE_TEST_JAR="ndbjtie-test-@JAVA_NDB_VERSION@.jar"
+JAVA_CLASSPATH="-classpath $UNLOAD_TEST_JAR:$NDBJTIE_TEST_JAR:$MYJAPI_JAR:$NDBJTIE_JAR"
+JAVA_LIBPATH="-Djava.library.path=$MYJAPI/$BIN_DIR:$NDBCLIENT/$BIN_DIR"
+JAVA_DEFS="-Dcom.mysql.jtie.test.MyLoadUnloadTest.target_package_prefixes=test.,myjapi.,com.mysql.ndbjtie. -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_class_name=test.NdbJTieMultiLibTest -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_method_name=test"
+
+TEST="
+ $JAVA
+ $JAVA_ARCH $JAVA_FLAGS
+ $JAVA_CLASSPATH
+ $JAVA_LIBPATH
+ $JAVA_DEFS
+ $JAVA_CLASS"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
=== added file 'storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_smoke.cmd.in'
--- a/storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_smoke.cmd.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_smoke.cmd.in 2012-03-05 04:19:09 +0000
@@ -0,0 +1,85 @@
+@echo off
+setlocal
+rem Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+rem
+rem This program is free software; you can redistribute it and/or modify
+rem it under the terms of the GNU General Public License as published by
+rem the Free Software Foundation; version 2 of the License.
+rem
+rem This program is distributed in the hope that it will be useful,
+rem but WITHOUT ANY WARRANTY; without even the implied warranty of
+rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+rem GNU General Public License for more details.
+rem
+rem You should have received a copy of the GNU General Public License
+rem along with this program; if not, write to the Free Software
+rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+rem redirect all output to logfile
+set LOGFILE=%0.log
+echo running test... output in file: %CD%\%LOGFILE%
+call :doit %1 > %LOGFILE%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+goto :lastCommand
+
+:doit
+rem echo --^> %0
+
+rem some build configs place binaries in subdirectories
+set BIN_DIR=%1
+if not defined BIN_DIR set BIN_DIR=.
+echo all binaries assumed in subdirectory '%BIN_DIR%'
+
+rem jvm
+set JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+set JAVA_FLAGS=-ea -Xcheck:jni
+set JAVA_ARCH=@Java_JAVA_ARCH_OPT@
+echo checking if JVM arch option %JAVA_ARCH% supported...
+%JAVA% %JAVA_ARCH% -version >nul 2>&1 || set JAVA_ARCH=
+echo.
+
+rem this test
+set JAVA_CLASS=test.MyLoadUnloadTest
+set UNLOAD_TEST_JAR=..\jtie\test\unload\jtie-test-unload-@JAVA_NDB_VERSION@.jar
+
+rem dependencies
+set NDBJTIE=..
+set NDBCLIENT=..\..
+set NDBJTIE_JAR=%NDBJTIE%\ndbjtie-@JAVA_NDB_VERSION@.jar
+set NDBJTIE_TEST_JAR=ndbjtie-test-@JAVA_NDB_VERSION@.jar
+set JAVA_CLASSPATH=-classpath "%UNLOAD_TEST_JAR%;%NDBJTIE_TEST_JAR%;%NDBJTIE_JAR%"
+set JAVA_LIBPATH=-Djava.library.path="%NDBCLIENT%\%BIN_DIR%"
+set JAVA_DEFS=-Dcom.mysql.jtie.test.MyLoadUnloadTest.target_package_prefixes=test.,com.mysql.ndbjtie. -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_class_name=test.NdbJTieSmokeTest -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_method_name=test
+
+echo running
+echo. %JAVA%
+echo. %JAVA_ARCH% %JAVA_FLAGS%
+echo. %JAVA_CLASSPATH%
+echo. %JAVA_LIBPATH%
+echo. %JAVA_DEFS%
+echo. %JAVA_CLASS%
+
+set TEST=%JAVA% %JAVA_ARCH% %JAVA_FLAGS% ^
+ %JAVA_CLASSPATH% %JAVA_LIBPATH% %JAVA_DEFS% %JAVA_CLASS%
+rem echo TEST=%TEST%
+
+rem retain test's exit status when discarding local settings
+@echo on
+%TEST%
+@endlocal & set EXIT_STATUS=%errorlevel%
+@echo off
+
+echo.
+echo exit status: %EXIT_STATUS%
+rem echo ^<-- %0
+rem goto :lastCommand
+
+:returnWithStatus
+exit /b %EXIT_STATUS%
+
+rem calling exit directly will not pass status arg back to calling program;
+rem workaround is for literally last command in script be a call to exit
+:lastCommand
+call :returnWithStatus
=== added file 'storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_smoke.sh.in'
--- a/storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_smoke.sh.in 1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/ndbjtie/test/test_unload_ndbjtie_smoke.sh.in 2012-03-05 08:14:47 +0000
@@ -0,0 +1,57 @@
+#!/bin/sh
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+LOGFILE="$0.log"
+echo "running test... output in file: `pwd`/$LOGFILE"
+exec > "$LOGFILE"
+
+# some build configs place binaries in subdirectories
+BIN_DIR=${1:-"."}
+echo "all binaries assumed in subdirectory \'$BIN_DIR\'"
+
+# jvm
+JAVA="@Java_JAVA_EXECUTABLE_PATH@"
+JAVA_ARCH="@Java_JAVA_ARCH_OPT@"
+JAVA_FLAGS="-ea -Xcheck:jni"
+
+# this test
+JAVA_CLASS="test.MyLoadUnloadTest"
+UNLOAD_TEST_JAR="../jtie/test/unload/jtie-test-unload-@JAVA_NDB_VERSION@.jar"
+
+# dependencies
+NDBJTIE=".."
+NDBCLIENT="../.."
+NDBJTIE_JAR="$NDBJTIE/ndbjtie-@JAVA_NDB_VERSION@.jar"
+NDBJTIE_TEST_JAR="ndbjtie-test-@JAVA_NDB_VERSION@.jar"
+JAVA_CLASSPATH="-classpath $UNLOAD_TEST_JAR:$NDBJTIE_TEST_JAR:$NDBJTIE_JAR"
+JAVA_LIBPATH="-Djava.library.path=$NDBCLIENT/$BIN_DIR"
+JAVA_DEFS="-Dcom.mysql.jtie.test.MyLoadUnloadTest.target_package_prefixes=test.,com.mysql.ndbjtie. -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_class_name=test.NdbJTieSmokeTest -Dcom.mysql.jtie.test.MyLoadUnloadTest.target_method_name=test"
+
+TEST="
+ $JAVA
+ $JAVA_ARCH $JAVA_FLAGS
+ $JAVA_CLASSPATH
+ $JAVA_LIBPATH
+ $JAVA_DEFS
+ $JAVA_CLASS"
+
+echo "running $TEST"
+echo
+$TEST
+STATUS=$?
+echo
+echo "exit status: $STATUS"
+exit "$STATUS"
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-5.5-cluster-7.2 branch (martin.zaun:3833 to 3836) | Martin Zaun | 8 Mar |