public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: cagney@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Fix enum ordering; test.
Date: Fri, 08 Feb 2008 21:25:00 -0000	[thread overview]
Message-ID: <20080208212544.22878.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  7e1623d0b3e268b77e3eae2ca402bf6d6568fc26 (commit)
      from  828ec80c296d95e06dfcabbcb77f7065f95611b8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 7e1623d0b3e268b77e3eae2ca402bf6d6568fc26
Author: Andrew Cagney <cagney@redhat.com>
Date:   Fri Feb 8 16:24:53 2008 -0500

    Fix enum ordering; test.
    
    frysk-common/ChangeLog
    2008-02-08  Andrew Cagney  <cagney@redhat.com>
    
    	* mkenum.sh (compareTo(Object)): Fix ordering.
    
    frysk-sys/frysk/rsl/ChangeLog
    2008-02-08  Andrew Cagney  <cagney@redhat.com>
    
    	* TestLog.java (testLevelComparison()): New.
    	* Log.java (set(Level)): Fix compareTo(Object) call.
    	* Node.java (get(Class)): Fix compareTo(Object) call.

-----------------------------------------------------------------------

Summary of changes:
 frysk-common/ChangeLog           |    4 ++++
 frysk-common/mkenum.sh           |    2 +-
 frysk-sys/frysk/rsl/ChangeLog    |    4 ++++
 frysk-sys/frysk/rsl/Log.java     |    2 +-
 frysk-sys/frysk/rsl/Node.java    |    4 ++--
 frysk-sys/frysk/rsl/TestLog.java |    8 +++++++-
 6 files changed, 19 insertions(+), 5 deletions(-)

First 500 lines of diff:
diff --git a/frysk-common/ChangeLog b/frysk-common/ChangeLog
index 81f910b..944c715 100644
--- a/frysk-common/ChangeLog
+++ b/frysk-common/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-08  Andrew Cagney  <cagney@redhat.com>
+
+	* mkenum.sh (compareTo(Object)): Fix ordering.
+
 2008-01-21  Andrew Cagney  <cagney@redhat.com>
 
 	* Makefile.rules (SUFFIXES): Fix typos. cxx-sh to .cxx-sh, ..c-in
diff --git a/frysk-common/mkenum.sh b/frysk-common/mkenum.sh
index 201c56f..d250c7b 100644
--- a/frysk-common/mkenum.sh
+++ b/frysk-common/mkenum.sh
@@ -169,7 +169,7 @@ ${sp}  }
 ${sp}  public int compareTo (Object o)
 ${sp}  {
 ${sp}    ${class} rhs = (${class}) o; // Can throw - ok.
-${sp}    return rhs.enumValue - this.enumValue;
+${sp}    return this.enumValue - rhs.enumValue;
 ${sp}  }
 EOF
     while get_token ; do
diff --git a/frysk-sys/frysk/rsl/ChangeLog b/frysk-sys/frysk/rsl/ChangeLog
index d1ba3af..af7279b 100644
--- a/frysk-sys/frysk/rsl/ChangeLog
+++ b/frysk-sys/frysk/rsl/ChangeLog
@@ -1,5 +1,9 @@
 2008-02-08  Andrew Cagney  <cagney@redhat.com>
 
+	* TestLog.java (testLevelComparison()): New.
+	* Log.java (set(Level)): Fix compareTo(Object) call.
+	* Node.java (get(Class)): Fix compareTo(Object) call.
+	
 	* Node.java (get(String,Level)): Delete.
 	(get(Class)): New.
 	(extensions): New.
diff --git a/frysk-sys/frysk/rsl/Log.java b/frysk-sys/frysk/rsl/Log.java
index d78fd7d..bf317df 100644
--- a/frysk-sys/frysk/rsl/Log.java
+++ b/frysk-sys/frysk/rsl/Log.java
@@ -89,7 +89,7 @@ public final class Log {
      * Enable logging; package private.
      */
     Log set(Level level) {
-	this.logging = this.level.compareTo(level) >= 0;
+	this.logging = level.compareTo(this.level) >= 0;
 	return this;
     }
 
diff --git a/frysk-sys/frysk/rsl/Node.java b/frysk-sys/frysk/rsl/Node.java
index bc9a281..e6e1ff5 100644
--- a/frysk-sys/frysk/rsl/Node.java
+++ b/frysk-sys/frysk/rsl/Node.java
@@ -145,8 +145,8 @@ public final class Node {
 		    parentNode.extensions.put(childNode.path, childNode);
 		    // .. make certain that the child's logging level
 		    // is at least equal to the parent's logging
-		    // level.  XXX: This compareTo() is backwards!
-		    if (childNode.level.compareTo(parentNode.level) > 0)
+		    // level.
+		    if (childNode.level.compareTo(parentNode.level) < 0)
 			childNode.set(parentNode.level);
 		}
 	    }
diff --git a/frysk-sys/frysk/rsl/TestLog.java b/frysk-sys/frysk/rsl/TestLog.java
index 19a9af8..c7c3354 100644
--- a/frysk-sys/frysk/rsl/TestLog.java
+++ b/frysk-sys/frysk/rsl/TestLog.java
@@ -1,6 +1,6 @@
 // This file is part of the program FRYSK.
 // 
-// Copyright 2007, Red Hat Inc.
+// Copyright 2007, 2008, Red Hat Inc.
 // 
 // FRYSK is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by
@@ -216,4 +216,10 @@ public class TestLog extends TestCase {
 	checkLevel("rhs", Level.FINEST);
 
     }
+
+    public void testLevelComparison() {
+	assertTrue("NONE < FINE", Level.NONE.compareTo(Level.FINE) < 0);
+	assertTrue("FINE > NONE", Level.FINE.compareTo(Level.NONE) > 0);
+	assertTrue("NONE == NONE", Level.NONE.compareTo(Level.NONE) == 0);
+    }
 }


hooks/post-receive
--
frysk system monitor/debugger


                 reply	other threads:[~2008-02-08 21:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080208212544.22878.qmail@sourceware.org \
    --to=cagney@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).