From d93f00359cf60a80df495b9a96b010daa53938f8 Mon Sep 17 00:00:00 2001
From: Tony Farrell <tony.farrell@mq.edu.au>
Date: Wed, 25 Oct 2006 19:45:39 +1000
Subject: [PATCH] Reflect recent DITS changes

    Reflect changes to DITS_ARG_<xxx> series of constants and ensure
		ValidateConsts() is invoked by testlink.
---
 DramaTask.java | 22 +++++++++++++++++-----
 DramaUtil.C    | 14 +++++++++-----
 dmakefile      |  2 +-
 testlink.C     |  4 ++--
 4 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/DramaTask.java b/DramaTask.java
index 11a249b..37a29e9 100644
--- a/DramaTask.java
+++ b/DramaTask.java
@@ -1012,10 +1012,9 @@ public class DramaTask {
 
     /**
      * A flag supplied to RequestExit()/RequestEnd() which indicates
-     * the argument should be copied immediately and deleted by DRAMA
-     * when appropiate.
+     * the argument should not be deleted and not be copied.
      */
-    public static final int ARG_COPY     = 0;
+    public static final int ARG_NODELETE = 0;
     /**
      * A flag supplied to RequestExit()/RequestEnd() which indicates
      * the argument should be deleted by DRAMA when appropiate.
@@ -1023,9 +1022,22 @@ public class DramaTask {
     public static final int ARG_DELETE   = 1;
     /**
      * A flag supplied to RequestExit()/RequestEnd() which indicates
-     * the argument should not be deleted and not be copied.
+     * the argument should be copied immediately and deleted by DRAMA
+     * when appropiate.
      */
-    public static final int ARG_NODELETE = 2;
+    public static final int ARG_COPY     = 2;
+    /**
+     * A flag supplied to RequestExit()/RequestEnd() which indicates
+     * the argument (and SDS id) should be free-ed by DRAMA when appropiate.
+     */
+    public static final int ARG_FREEID   = 3;
+    /**
+     * A flag supplied to RequestExit()/RequestEnd() which indicates
+     * the argument is an SDS id obtained by reading an SDS file and
+     * should be cleaned-up appropiately by DRAMA when appropiate.
+     */
+    public static final int ARG_READFREE  = 4;
+
 
     //Calls equivalent to DitsPutRequest
     private native void RequestEnd(boolean exit, int Arg, int ArgFlag)
diff --git a/DramaUtil.C b/DramaUtil.C
index 617441e..357dd6c 100644
--- a/DramaUtil.C
+++ b/DramaUtil.C
@@ -54,6 +54,9 @@
                            (Errors were an internal JNI error (invalid class) and
                             an assertion failure in DramaCheckAndThrow() due to the
                             new exception object creation failing)
+     25-Oct-2006 - TJF - Reflect changes to DITS_ARG_<xxx> series of enums.
+                         Make ValidateConsts() extern so it can be called
+                           by testlink.  Rename to DJAVA_ValidateConsts().
  */ 
 
 
@@ -120,7 +123,7 @@ extern void _DAssert(const char * const file, const unsigned line)
  * Of course there is now way of ensuring I check all the defined values.
  *
  */
-static void ValidateConsts()
+extern void DJAVA_ValidateConsts()
 {
 /*
  *  From the SdsID class
@@ -173,8 +176,11 @@ static void ValidateConsts()
     DASSERT(au_gov_aao_drama_DramaTask_CTX_KICKED      ==  DITS_CTX_KICKED);
     DASSERT(au_gov_aao_drama_DramaTask_CTX_UFACE       ==  DITS_CTX_UFACE);
 	
-    DASSERT(au_gov_aao_drama_DramaTask_ARG_COPY        ==  DITS_ARG_COPY);
+    DASSERT(au_gov_aao_drama_DramaTask_ARG_NODELETE    ==  DITS_ARG_NODELETE);
     DASSERT(au_gov_aao_drama_DramaTask_ARG_DELETE      ==  DITS_ARG_DELETE);
+    DASSERT(au_gov_aao_drama_DramaTask_ARG_COPY        ==  DITS_ARG_COPY);
+    DASSERT(au_gov_aao_drama_DramaTask_ARG_FREEID      ==  DITS_ARG_FREEID);
+    DASSERT(au_gov_aao_drama_DramaTask_ARG_READFREE    ==  DITS_ARG_READFREE);
 
 
     DASSERT(au_gov_aao_drama_DramaTask_LOG_OFF       ==  DITS_LOG_OFF);
@@ -250,9 +256,7 @@ extern "C" jint JNICALL JNI_OnLoad(
  *  ValidateConsts is called to ensure JAVA has the correct values for
  *  various constants defined by DRAMA.
  */
-#ifdef MYDEBUG
-    ValidateConsts();
-#endif
+    DJAVA_ValidateConsts();
 /*
  *  Save the virtual machine.
  */
diff --git a/dmakefile b/dmakefile
index 6507e71..ee8df16 100644
--- a/dmakefile
+++ b/dmakefile
@@ -4,7 +4,7 @@
 
 #BeginConfig
 #DramaSystem                    /* Indicates we are part of drama itself */
-ACMM_RELEASE=3_41$(ACMMBUILDVER)
+ACMM_RELEASE=3_42$(ACMMBUILDVER)
 RELEASE=r$(ACMM_RELEASE)
 SYSTEM=djava                    /* System name (for release     */
 
diff --git a/testlink.C b/testlink.C
index 8247453..d0fa6f7 100644
--- a/testlink.C
+++ b/testlink.C
@@ -64,7 +64,7 @@ JNIEXPORT void JNICALL Java_au_gov_aao_drama_DramaTask_PutKickHandler__Lau_gov_a
   (JNIEnv *, jobject, jobject);
 } /* extern "C" */
 
-
+extern void DJAVA_ValidateConsts();
 
 int main(int argc, char *argv[])
 {
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
     jobjectArray objectArray;
     jbyteArray aByteArray;
 
-
+    DJAVA_ValidateConsts();
     /*
      * This test is only to try to trick the compiler into thinking we might
      * want to execute the rest of the code, and so compiling and linking it.
-- 
GitLab