Remove Bool_To_I64 and Bool_To_F64 Now that these methods aren't "virtual", they aren't very useful.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/4118fbd2 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/4118fbd2 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/4118fbd2 Branch: refs/heads/master Commit: 4118fbd2040a4fbb77060d55c57ad3626951b764 Parents: 0bbfcfc Author: Nick Wellnhofer <[email protected]> Authored: Fri Nov 20 15:16:47 2015 +0100 Committer: Nick Wellnhofer <[email protected]> Committed: Wed Jan 6 16:05:44 2016 +0100 ---------------------------------------------------------------------- runtime/core/Clownfish/Boolean.c | 10 ---------- runtime/core/Clownfish/Boolean.cfh | 6 ------ runtime/core/Clownfish/Test/TestBoolean.c | 8 +------- runtime/go/clownfish/boolean_test.go | 22 ---------------------- runtime/perl/t/binding/031-num.t | 3 +-- 5 files changed, 2 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4118fbd2/runtime/core/Clownfish/Boolean.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/Boolean.c b/runtime/core/Clownfish/Boolean.c index 55fcdbd..fd7c6d9 100644 --- a/runtime/core/Clownfish/Boolean.c +++ b/runtime/core/Clownfish/Boolean.c @@ -53,16 +53,6 @@ Bool_Get_Value_IMP(Boolean *self) { return self->value; } -double -Bool_To_F64_IMP(Boolean *self) { - return (double)self->value; -} - -int64_t -Bool_To_I64_IMP(Boolean *self) { - return self->value; -} - Boolean* Bool_Clone_IMP(Boolean *self) { return self; http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4118fbd2/runtime/core/Clownfish/Boolean.cfh ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/Boolean.cfh b/runtime/core/Clownfish/Boolean.cfh index 19eacc7..29b5f12 100644 --- a/runtime/core/Clownfish/Boolean.cfh +++ b/runtime/core/Clownfish/Boolean.cfh @@ -47,12 +47,6 @@ public final class Clownfish::Boolean nickname Bool { public bool Get_Value(Boolean *self); - public int64_t - To_I64(Boolean *self); - - public double - To_F64(Boolean *self); - /* Returns self. */ public incremented Boolean* Clone(Boolean *self); http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4118fbd2/runtime/core/Clownfish/Test/TestBoolean.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/Test/TestBoolean.c b/runtime/core/Clownfish/Test/TestBoolean.c index d455210..70c1257 100644 --- a/runtime/core/Clownfish/Test/TestBoolean.c +++ b/runtime/core/Clownfish/Test/TestBoolean.c @@ -51,12 +51,6 @@ test_accessors(TestBatchRunner *runner) { "Bool_Get_Value [true]"); TEST_INT_EQ(runner, Bool_Get_Value(CFISH_FALSE), false, "Bool_Get_Value [false]"); - TEST_INT_EQ(runner, Bool_To_I64(CFISH_TRUE), 1, "Bool_To_I64 [true]"); - TEST_INT_EQ(runner, Bool_To_I64(CFISH_FALSE), 0, "Bool_To_I64 [false]"); - TEST_TRUE(runner, Bool_To_F64(CFISH_TRUE) == 1.0, - "Bool_To_F64 [true]"); - TEST_TRUE(runner, Bool_To_F64(CFISH_FALSE) == 0.0, - "Bool_To_F64 [false]"); } static void @@ -81,7 +75,7 @@ test_Clone(TestBatchRunner *runner) { void TestBoolean_Run_IMP(TestBoolean *self, TestBatchRunner *runner) { - TestBatchRunner_Plan(runner, (TestBatch*)self, 14); + TestBatchRunner_Plan(runner, (TestBatch*)self, 10); test_To_String(runner); test_accessors(runner); test_Equals_and_Compare_To(runner); http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4118fbd2/runtime/go/clownfish/boolean_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/boolean_test.go b/runtime/go/clownfish/boolean_test.go index 5078b28..cfc22b2 100644 --- a/runtime/go/clownfish/boolean_test.go +++ b/runtime/go/clownfish/boolean_test.go @@ -29,28 +29,6 @@ func TestBooleanGetValue(t *testing.T) { } } -func TestBooleanToF64(t *testing.T) { - myTrue := NewBoolean(true) - myFalse := NewBoolean(false) - if got := myTrue.ToF64(); got != 1.0 { - t.Errorf("Expected 1.0, got %v", got) - } - if got := myFalse.ToF64(); got != 0.0 { - t.Errorf("Expected 0.0, got %v", got) - } -} - -func TestBooleanToI64(t *testing.T) { - myTrue := NewBoolean(true) - myFalse := NewBoolean(false) - if got := myTrue.ToI64(); got != 1 { - t.Errorf("Expected 1, got %v", got) - } - if got := myFalse.ToI64(); got != 0 { - t.Errorf("Expected 0, got %v", got) - } -} - func TestBooleanToString(t *testing.T) { myTrue := NewBoolean(true) myFalse := NewBoolean(false) http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4118fbd2/runtime/perl/t/binding/031-num.t ---------------------------------------------------------------------- diff --git a/runtime/perl/t/binding/031-num.t b/runtime/perl/t/binding/031-num.t index 1a2e936..b91c667 100644 --- a/runtime/perl/t/binding/031-num.t +++ b/runtime/perl/t/binding/031-num.t @@ -17,7 +17,7 @@ use strict; use warnings; use lib 'buildlib'; -use Test::More tests => 26; +use Test::More tests => 25; use Clownfish; use Clownfish::Boolean qw( $true_singleton $false_singleton ); @@ -55,7 +55,6 @@ isa_ok( $bool, 'Clownfish::Boolean' ); ok ( $bool->get_value, 'Boolean get_value true' ); ok ( !$false_singleton->get_value, 'Boolean get_value false' ); -is ( $bool->to_i64, 1, 'Boolean to_i64' ); is ( $bool->to_string, 'true', 'Boolean to_string' ); ok ( $bool->equals($true_singleton), 'Boolean equals true' ); ok ( !$bool->equals($false_singleton), 'Boolean equals false' );
