public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: tthomas@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Tests for logicalNegation, getLogicalValue on int types added.
Date: Fri, 09 Nov 2007 20:22:00 -0000	[thread overview]
Message-ID: <20071109202224.21319.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  fd94985768aaab064cb3fdae15087ace1fa7b188 (commit)
      from  7f1af8e43becb1579889c0764a96e37e4efe52b1 (commit)

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

- Log -----------------------------------------------------------------
commit fd94985768aaab064cb3fdae15087ace1fa7b188
Author: Teresa Thomas <tthomas@redhat.com>
Date:   Fri Nov 9 15:21:16 2007 -0500

    Tests for logicalNegation, getLogicalValue on int types added.
    
    frysk-core/frysk/value/ChangeLog
    2007-11-09  Teresa Thomas  <tthomas@redhat.com>
    
    	* TestValue.java (testIntOps): Test for logicalNegation,
    	getLogicalValue added.
    	* IntegerUnit.java (logicalNegation): Simplify.

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

Summary of changes:
 frysk-core/frysk/value/ChangeLog        |    6 ++++++
 frysk-core/frysk/value/IntegerUnit.java |    2 +-
 frysk-core/frysk/value/TestValue.java   |    5 +++++
 3 files changed, 12 insertions(+), 1 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/value/ChangeLog b/frysk-core/frysk/value/ChangeLog
index db39231..f89f379 100644
--- a/frysk-core/frysk/value/ChangeLog
+++ b/frysk-core/frysk/value/ChangeLog
@@ -1,5 +1,11 @@
 2007-11-09  Teresa Thomas  <tthomas@redhat.com>
 
+	* TestValue.java (testIntOps): Test for logicalNegation,
+	getLogicalValue added.
+	* IntegerUnit.java (logicalNegation): Simplify.
+
+2007-11-09  Teresa Thomas  <tthomas@redhat.com>
+
 	* FloatingPointUnit.java (lessThan): New.
 	(greaterThan): New.
 	(greaterThanOrEqualTo): New.
diff --git a/frysk-core/frysk/value/IntegerUnit.java b/frysk-core/frysk/value/IntegerUnit.java
index 655920e..7178356 100644
--- a/frysk-core/frysk/value/IntegerUnit.java
+++ b/frysk-core/frysk/value/IntegerUnit.java
@@ -136,7 +136,7 @@ public class IntegerUnit
     }  
     public Value logicalNegation(Value v1) {
 	return retType.createValue
-                       ((v1.asBigInteger().longValue() == 0 ? true : false) ? 1 : 0);
+                       (v1.asBigInteger().longValue() == 0 ? 1 : 0);
     }    
     public boolean getLogicalValue (Value v1) {
 	return ((v1.asBigInteger().longValue() == 0) ? false : true);
diff --git a/frysk-core/frysk/value/TestValue.java b/frysk-core/frysk/value/TestValue.java
index 10b087d..13f6142 100644
--- a/frysk-core/frysk/value/TestValue.java
+++ b/frysk-core/frysk/value/TestValue.java
@@ -102,6 +102,7 @@ public class TestValue
     {
 	Value v1 = intType.createValue(4);
 	Value v2 = shortType.createValue(9);
+	boolean bool = false;
 	// Give bogus word size values.
 	Value v3 = v1.getType().getALU(v2.getType(), 0).add(v1, v2);
 	assertEquals ("4 + 9", 4 + 9, v3.asLong());	
@@ -139,6 +140,10 @@ public class TestValue
 	assertEquals ("9 & 4", 1, v3.asLong());
 	v3 = v1.getType().getALU(v2.getType(), 0).logicalOr(v2, v1);
 	assertEquals ("9 | 4", 1, v3.asLong());	
+	v3 = v1.getType().getALU(v1.getType(), 0).logicalNegation(v1);
+	assertEquals ("!4", 0, v3.asLong());		
+	bool = v2.getType().getALU(v2.getType(), 0).getLogicalValue(v2);
+	assertEquals ("bool(9)", true, bool);		
 	v3 = v3.assign(v1);	
 	assertEquals ("v3 = 4", 4, v3.asLong());
 	v3 = v3.getType().getALU(v1.getType(), 0).plusEqual(v3, v1);


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


                 reply	other threads:[~2007-11-09 20:22 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=20071109202224.21319.qmail@sourceware.org \
    --to=tthomas@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).