You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2009/09/23 11:33:53 UTC
svn commit: r818016 - in /lucene/lucy/trunk: core/Lucy/Object/Num.bp
core/Lucy/Object/Num.c core/Lucy/Test/Object/TestNum.bp
core/Lucy/Test/Object/TestNum.c core/Lucy/Util/ToolSet.h
perl/lib/Lucy/Test.pm perl/t/core/031-num.t
Author: marvin
Date: Wed Sep 23 09:33:48 2009
New Revision: 818016
URL: http://svn.apache.org/viewvc?rev=818016&view=rev
Log:
Commit LUCY-53, adding Integer32, Integer64, Float32, and Float64.
Added:
lucene/lucy/trunk/core/Lucy/Object/Num.bp (with props)
lucene/lucy/trunk/core/Lucy/Object/Num.c (with props)
lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.bp (with props)
lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c (with props)
lucene/lucy/trunk/perl/t/core/031-num.t (with props)
Modified:
lucene/lucy/trunk/core/Lucy/Util/ToolSet.h
lucene/lucy/trunk/perl/lib/Lucy/Test.pm
Added: lucene/lucy/trunk/core/Lucy/Object/Num.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/Num.bp?rev=818016&view=auto
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/Num.bp (added)
+++ lucene/lucy/trunk/core/Lucy/Object/Num.bp Wed Sep 23 09:33:48 2009
@@ -0,0 +1,197 @@
+parcel Lucy;
+
+/** Abstract base class for numbers.
+ */
+abstract class Lucy::Object::Num extends Lucy::Object::Obj {
+
+ inert Num*
+ init(Num *self);
+
+ public bool_t
+ Equals(Num *self, Obj *other);
+
+ public i32_t
+ Compare_To(Num *self, Obj *other);
+}
+
+/** Abstract base class for floating point numbers.
+ */
+abstract class Lucy::Object::FloatNum extends Lucy::Object::Num {
+
+ inert FloatNum*
+ init(FloatNum *self);
+
+ public incremented CharBuf*
+ To_String(FloatNum *self);
+}
+
+
+/** Abstract base class for Integers.
+ */
+abstract class Lucy::Object::IntNum extends Lucy::Object::Num {
+
+ inert IntNum*
+ init(IntNum *self);
+
+ public incremented CharBuf*
+ To_String(IntNum *self);
+}
+
+
+/** Single precision floating point number.
+ */
+class Lucy::Object::Float32 extends Lucy::Object::FloatNum {
+
+ float value;
+
+ /**
+ * @param value Initial value.
+ */
+ inert Float32*
+ init(Float32* self, float value);
+
+ inert Float32*
+ new(float value);
+
+ void
+ Set_Value(Float32 *self, float value);
+
+ float
+ Get_Value(Float32 *self);
+
+ public i64_t
+ To_I64(Float32 *self);
+
+ public double
+ To_F64(Float32 *self);
+
+ public i32_t
+ Hash_Code(Float32 *self);
+
+ public incremented Float32*
+ Clone(Float32 *self);
+}
+
+/** Double precision floating point number.
+ */
+class Lucy::Object::Float64 extends Lucy::Object::FloatNum {
+
+ double value;
+
+ /**
+ * @param value Initial value.
+ */
+ inert Float64*
+ init(Float64* self, double value);
+
+ inert Float64*
+ new(double value);
+
+ void
+ Set_Value(Float64 *self, double value);
+
+ double
+ Get_Value(Float64 *self);
+
+ public i64_t
+ To_I64(Float64 *self);
+
+ public double
+ To_F64(Float64 *self);
+
+ public i32_t
+ Hash_Code(Float64 *self);
+
+ public incremented Float64*
+ Clone(Float64 *self);
+}
+
+/** 32-bit signed integer.
+ */
+class Lucy::Object::Integer32 cnick Int32
+ extends Lucy::Object::IntNum {
+
+ i32_t value;
+
+ /**
+ * @param value Initial value.
+ */
+ inert Integer32*
+ init(Integer32* self, i32_t value);
+
+ inert Integer32*
+ new(i32_t value);
+
+ void
+ Set_Value(Integer32 *self, i32_t value);
+
+ i32_t
+ Get_Value(Integer32 *self);
+
+ public i64_t
+ To_I64(Integer32 *self);
+
+ public double
+ To_F64(Integer32 *self);
+
+ public i32_t
+ Hash_Code(Integer32 *self);
+
+ public incremented Integer32*
+ Clone(Integer32 *self);
+}
+
+/**
+ * 64-bit signed integer.
+ */
+class Lucy::Object::Integer64 cnick Int64
+ extends Lucy::Object::IntNum {
+
+ i64_t value;
+
+ /**
+ * @param value Initial value.
+ */
+ inert Integer64*
+ init(Integer64* self, i64_t value);
+
+ inert Integer64*
+ new(i64_t value);
+
+ void
+ Set_Value(Integer64 *self, i64_t value);
+
+ i64_t
+ Get_Value(Integer64 *self);
+
+ public i64_t
+ To_I64(Integer64 *self);
+
+ public double
+ To_F64(Integer64 *self);
+
+ public i32_t
+ Hash_Code(Integer64 *self);
+
+ public bool_t
+ Equals(Integer64 *self, Obj *other);
+
+ public incremented Integer64*
+ Clone(Integer64 *self);
+}
+
+/* Copyright 2009 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
Propchange: lucene/lucy/trunk/core/Lucy/Object/Num.bp
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/lucy/trunk/core/Lucy/Object/Num.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/Num.c?rev=818016&view=auto
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/Num.c (added)
+++ lucene/lucy/trunk/core/Lucy/Object/Num.c Wed Sep 23 09:33:48 2009
@@ -0,0 +1,297 @@
+#define C_LUCY_NUM
+#define C_LUCY_INTNUM
+#define C_LUCY_FLOATNUM
+#define C_LUCY_INTEGER32
+#define C_LUCY_INTEGER64
+#define C_LUCY_FLOAT32
+#define C_LUCY_FLOAT64
+#define LUCY_USE_SHORT_NAMES
+#define CHY_USE_SHORT_NAMES
+
+#include "Lucy/Object/Num.h"
+#include "Lucy/Object/CharBuf.h"
+#include "Lucy/Object/Err.h"
+#include "Lucy/Object/VTable.h"
+
+Num*
+Num_init(Num *self)
+{
+ ABSTRACT_CLASS_CHECK(self, NUM);
+ return self;
+}
+
+bool_t
+Num_equals(Num *self, Obj *other)
+{
+ Num *evil_twin = (Num*)other;
+ if (evil_twin == self) { return true; }
+ if (!Obj_Is_A(evil_twin, NUM)) { return false; }
+ if (Num_To_F64(self) != Num_To_F64(evil_twin)) { return false; }
+ if (Num_To_I64(self) != Num_To_I64(evil_twin)) { return false; }
+ return true;
+}
+
+i32_t
+Num_compare_to(Num *self, Obj *other)
+{
+ Num *evil_twin = (Num*)ASSERT_IS_A(other, NUM);
+ double f64_diff = Num_To_F64(self) - Num_To_F64(evil_twin);
+ if (f64_diff) {
+ if (f64_diff < 0) { return -1; }
+ else if (f64_diff > 0) { return 1; }
+ }
+ else {
+ i64_t i64_diff = Num_To_I64(self) - Num_To_I64(evil_twin);
+ if (i64_diff) {
+ if (i64_diff < 0) { return -1; }
+ else if (i64_diff > 0) { return 1; }
+ }
+ }
+ return 0;
+}
+
+/***************************************************************************/
+
+FloatNum*
+FloatNum_init(FloatNum *self)
+{
+ ABSTRACT_CLASS_CHECK(self, FLOATNUM);
+ return (FloatNum*)Num_init((Num*)self);
+}
+
+CharBuf*
+FloatNum_to_string(FloatNum *self)
+{
+ return CB_newf("%f64", FloatNum_To_F64(self));
+}
+
+/***************************************************************************/
+
+IntNum*
+IntNum_init(IntNum *self)
+{
+ ABSTRACT_CLASS_CHECK(self, INTNUM);
+ return (IntNum*)Num_init((Num*)self);
+}
+
+CharBuf*
+IntNum_to_string(IntNum *self)
+{
+ return CB_newf("%i64", IntNum_To_I64(self));
+}
+
+/***************************************************************************/
+
+Float32*
+Float32_new(float value)
+{
+ Float32 *self = (Float32*)VTable_Make_Obj(FLOAT32);
+ return Float32_init(self, value);
+}
+
+Float32*
+Float32_init(Float32 *self, float value)
+{
+ self->value = value;
+ return (Float32*)FloatNum_init((FloatNum*)self);
+}
+
+float
+Float32_get_value(Float32 *self) { return self->value; }
+void
+Float32_set_value(Float32 *self, float value) { self->value = value; }
+
+double
+Float32_to_f64(Float32 *self)
+{
+ return self->value;
+}
+
+i64_t
+Float32_to_i64(Float32 *self)
+{
+ return (i64_t)self->value;
+}
+
+i32_t
+Float32_hash_code(Float32 *self)
+{
+ return *(i32_t*)&self->value;
+}
+
+Float32*
+Float32_clone(Float32 *self)
+{
+ return Float32_new(self->value);
+}
+
+/***************************************************************************/
+
+Float64*
+Float64_new(double value)
+{
+ Float64 *self = (Float64*)VTable_Make_Obj(FLOAT64);
+ return Float64_init(self, value);
+}
+
+Float64*
+Float64_init(Float64 *self, double value)
+{
+ self->value = value;
+ return (Float64*)FloatNum_init((FloatNum*)self);
+}
+
+double
+Float64_get_value(Float64 *self) { return self->value; }
+void
+Float64_set_value(Float64 *self, double value) { self->value = value; }
+
+double
+Float64_to_f64(Float64 *self)
+{
+ return self->value;
+}
+
+i64_t
+Float64_to_i64(Float64 *self)
+{
+ return (i64_t)self->value;
+}
+
+Float64*
+Float64_clone(Float64 *self)
+{
+ return Float64_new(self->value);
+}
+
+i32_t
+Float64_hash_code(Float64 *self)
+{
+ i32_t *ints = (i32_t*)&self->value;
+ return ints[0] ^ ints[1];
+}
+
+/***************************************************************************/
+
+Integer32*
+Int32_new(i32_t value)
+{
+ Integer32 *self = (Integer32*)VTable_Make_Obj(INTEGER32);
+ return Int32_init(self, value);
+}
+
+Integer32*
+Int32_init(Integer32 *self, i32_t value)
+{
+ self->value = value;
+ return (Integer32*)IntNum_init((IntNum*)self);
+}
+
+i32_t
+Int32_get_value(Integer32 *self) { return self->value; }
+void
+Int32_set_value(Integer32 *self, i32_t value) { self->value = value; }
+
+double
+Int32_to_f64(Integer32 *self)
+{
+ return self->value;
+}
+
+i64_t
+Int32_to_i64(Integer32 *self)
+{
+ return self->value;
+}
+
+Integer32*
+Int32_clone(Integer32 *self)
+{
+ return Int32_new(self->value);
+}
+
+i32_t
+Int32_hash_code(Integer32 *self)
+{
+ return self->value;
+}
+
+/***************************************************************************/
+
+Integer64*
+Int64_new(i64_t value)
+{
+ Integer64 *self = (Integer64*)VTable_Make_Obj(INTEGER64);
+ return Int64_init(self, value);
+}
+
+Integer64*
+Int64_init(Integer64 *self, i64_t value)
+{
+ self->value = value;
+ return (Integer64*)FloatNum_init((FloatNum*)self);
+}
+
+i64_t
+Int64_get_value(Integer64 *self) { return self->value; }
+void
+Int64_set_value(Integer64 *self, i64_t value) { self->value = value; }
+
+double
+Int64_to_f64(Integer64 *self)
+{
+ return (double)self->value;
+}
+
+i64_t
+Int64_to_i64(Integer64 *self)
+{
+ return self->value;
+}
+
+Integer64*
+Int64_clone(Integer64 *self)
+{
+ return Int64_new(self->value);
+}
+
+i32_t
+Int64_hash_code(Integer64 *self)
+{
+ i32_t *ints = (i32_t*)&self->value;
+ return ints[0] ^ ints[1];
+}
+
+bool_t
+Int64_equals(Integer64 *self, Obj *other)
+{
+ Num *evil_twin = (Num*)other;
+ if (evil_twin == (Num*)self) { return true; }
+ if (!Obj_Is_A(evil_twin, NUM)) { return false; }
+ if (Obj_Is_A(evil_twin, FLOATNUM)) {
+ double floating_val = Num_To_F64(evil_twin);
+ i64_t int_val = (i64_t)floating_val;
+ if ((double)int_val != floating_val) { return false; }
+ if (int_val != self->value) { return false; }
+ }
+ else {
+ if (self->value != Num_To_I64(evil_twin)) { return false; }
+ }
+ return true;
+}
+
+/* Copyright 2009 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
Propchange: lucene/lucy/trunk/core/Lucy/Object/Num.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.bp?rev=818016&view=auto
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.bp (added)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.bp Wed Sep 23 09:33:48 2009
@@ -0,0 +1,22 @@
+parcel Lucy;
+
+inert class Lucy::Test::Object::TestNum {
+ inert void
+ run_tests();
+}
+
+/* Copyright 2009 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
Propchange: lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.bp
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c?rev=818016&view=auto
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c (added)
+++ lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c Wed Sep 23 09:33:48 2009
@@ -0,0 +1,198 @@
+#define C_LUCY_TESTNUM
+#include "Lucy/Util/ToolSet.h"
+
+#include "Lucy/Test.h"
+#include "Lucy/Test/Object/TestNum.h"
+
+static void
+test_To_String(TestBatch *batch)
+{
+ Float32 *f32 = Float32_new(1.33f);
+ Float64 *f64 = Float64_new(1.33);
+ Integer32 *i32 = Int32_new(I32_MAX);
+ Integer64 *i64 = Int64_new(I64_MAX);
+ CharBuf *f32_string = Float32_To_String(f32);
+ CharBuf *f64_string = Float64_To_String(f64);
+ CharBuf *i32_string = Int32_To_String(i32);
+ CharBuf *i64_string = Int64_To_String(i64);
+
+ ASSERT_TRUE(batch, CB_Starts_With_Str(f32_string, "1.3", 3),
+ "Float32_To_String");
+ ASSERT_TRUE(batch, CB_Starts_With_Str(f64_string, "1.3", 3),
+ "Float64_To_String");
+ ASSERT_TRUE(batch, CB_Equals_Str(i32_string, "2147483647", 10),
+ "Int32_To_String");
+ ASSERT_TRUE(batch, CB_Equals_Str(i64_string, "9223372036854775807", 19),
+ "Int64_To_String");
+
+ DECREF(i64_string);
+ DECREF(i32_string);
+ DECREF(f64_string);
+ DECREF(f32_string);
+ DECREF(i64);
+ DECREF(i32);
+ DECREF(f64);
+ DECREF(f32);
+}
+
+static void
+test_accessors(TestBatch *batch)
+{
+ Float32 *f32 = Float32_new(1.0);
+ Float64 *f64 = Float64_new(1.0);
+ Integer32 *i32 = Int32_new(1);
+ Integer64 *i64 = Int64_new(1);
+
+ Float32_Set_Value(f32, 1.33f);
+ ASSERT_FLOAT_EQ(batch, Float32_Get_Value(f32), 1.33f,
+ "F32 Set_Value Get_Value");
+
+ Float64_Set_Value(f64, 1.33);
+ ASSERT_TRUE(batch, Float64_Get_Value(f64) == 1.33,
+ "F64 Set_Value Get_Value");
+
+ ASSERT_TRUE(batch, Float32_To_I64(f32) == 1, "Float32_To_I64");
+ ASSERT_TRUE(batch, Float64_To_I64(f64) == 1, "Float64_To_I64");
+
+ ASSERT_TRUE(batch, Float32_To_F64(f32) == 1.33f, "Float32_To_F64");
+ ASSERT_TRUE(batch, Float64_To_F64(f64) == 1.33, "Float64_To_F64");
+
+ Int32_Set_Value(i32, I32_MIN);
+ ASSERT_INT_EQ(batch, Int32_Get_Value(i32), I32_MIN,
+ "I32 Set_Value Get_Value");
+
+ Int64_Set_Value(i64, I64_MIN);
+ ASSERT_TRUE(batch, Int64_Get_Value(i64) == I64_MIN,
+ "I64 Set_Value Get_Value");
+
+ Int32_Set_Value(i32, -1);
+ Int64_Set_Value(i64, -1);
+ ASSERT_TRUE(batch, Int32_To_F64(i32) == -1, "Int32_To_F64");
+ ASSERT_TRUE(batch, Int64_To_F64(i64) == -1, "Int64_To_F64");
+
+ DECREF(i64);
+ DECREF(i32);
+ DECREF(f64);
+ DECREF(f32);
+}
+
+static void
+test_Equals_and_Compare_To(TestBatch *batch)
+{
+ Float32 *f32 = Float32_new(1.0);
+ Float64 *f64 = Float64_new(1.0);
+ Integer32 *i32 = Int32_new(I32_MAX);
+ Integer64 *i64 = Int64_new(I64_MAX);
+
+ ASSERT_TRUE(batch, Float32_Compare_To(f32, (Obj*)f64) == 0,
+ "F32_Compare_To equal");
+ ASSERT_TRUE(batch, Float32_Equals(f32, (Obj*)f64),
+ "F32_Equals equal");
+
+ Float64_Set_Value(f64, 2.0);
+ ASSERT_TRUE(batch, Float32_Compare_To(f32, (Obj*)f64) < 0,
+ "F32_Compare_To less than");
+ ASSERT_FALSE(batch, Float32_Equals(f32, (Obj*)f64),
+ "F32_Equals less than");
+
+ Float64_Set_Value(f64, 0.0);
+ ASSERT_TRUE(batch, Float32_Compare_To(f32, (Obj*)f64) > 0,
+ "F32_Compare_To greater than");
+ ASSERT_FALSE(batch, Float32_Equals(f32, (Obj*)f64),
+ "F32_Equals greater than");
+
+ Float64_Set_Value(f64, 1.0);
+ Float32_Set_Value(f32, 1.0);
+ ASSERT_TRUE(batch, Float64_Compare_To(f64, (Obj*)f32) == 0,
+ "F64_Compare_To equal");
+ ASSERT_TRUE(batch, Float64_Equals(f64, (Obj*)f32),
+ "F64_Equals equal");
+
+ Float32_Set_Value(f32, 2.0);
+ ASSERT_TRUE(batch, Float64_Compare_To(f64, (Obj*)f32) < 0,
+ "F64_Compare_To less than");
+ ASSERT_FALSE(batch, Float64_Equals(f64, (Obj*)f32),
+ "F64_Equals less than");
+
+ Float32_Set_Value(f32, 0.0);
+ ASSERT_TRUE(batch, Float64_Compare_To(f64, (Obj*)f32) > 0,
+ "F64_Compare_To greater than");
+ ASSERT_FALSE(batch, Float64_Equals(f64, (Obj*)f32),
+ "F64_Equals greater than");
+
+ Float64_Set_Value(f64, I64_MAX * 2.0);
+ ASSERT_TRUE(batch, Float64_Compare_To(f64, (Obj*)i64) > 0,
+ "Float64 comparison to Integer64");
+ ASSERT_TRUE(batch, Int64_Compare_To(i64, (Obj*)f64) < 0,
+ "Integer64 comparison to Float64");
+
+ Float32_Set_Value(f32, I32_MAX * 2.0f);
+ ASSERT_TRUE(batch, Float32_Compare_To(f32, (Obj*)i32) > 0,
+ "Float32 comparison to Integer32");
+ ASSERT_TRUE(batch, Int32_Compare_To(i32, (Obj*)f32) < 0,
+ "Integer32 comparison to Float32");
+
+ DECREF(i64);
+ DECREF(i32);
+ DECREF(f64);
+ DECREF(f32);
+}
+
+static void
+test_Clone(TestBatch *batch)
+{
+ Float32 *f32 = Float32_new(1.33f);
+ Float64 *f64 = Float64_new(1.33);
+ Integer32 *i32 = Int32_new(I32_MAX);
+ Integer64 *i64 = Int64_new(I64_MAX);
+ Float32 *f32_dupe = Float32_Clone(f32);
+ Float64 *f64_dupe = Float64_Clone(f64);
+ Integer32 *i32_dupe = Int32_Clone(i32);
+ Integer64 *i64_dupe = Int64_Clone(i64);
+ ASSERT_TRUE(batch, Float32_Equals(f32, (Obj*)f32_dupe),
+ "Float32 Clone");
+ ASSERT_TRUE(batch, Float64_Equals(f64, (Obj*)f64_dupe),
+ "Float64 Clone");
+ ASSERT_TRUE(batch, Int32_Equals(i32, (Obj*)i32_dupe),
+ "Integer32 Clone");
+ ASSERT_TRUE(batch, Int64_Equals(i64, (Obj*)i64_dupe),
+ "Integer64 Clone");
+ DECREF(i64_dupe);
+ DECREF(i32_dupe);
+ DECREF(f64_dupe);
+ DECREF(f32_dupe);
+ DECREF(i64);
+ DECREF(i32);
+ DECREF(f64);
+ DECREF(f32);
+}
+
+void
+TestNum_run_tests()
+{
+ TestBatch *batch = Test_new_batch("TestNum", 34, NULL);
+ PLAN(batch);
+
+ test_To_String(batch);
+ test_accessors(batch);
+ test_Equals_and_Compare_To(batch);
+ test_Clone(batch);
+
+ batch->destroy(batch);
+}
+
+/* Copyright 2009 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
Propchange: lucene/lucy/trunk/core/Lucy/Test/Object/TestNum.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: lucene/lucy/trunk/core/Lucy/Util/ToolSet.h
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Util/ToolSet.h?rev=818016&r1=818015&r2=818016&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Util/ToolSet.h (original)
+++ lucene/lucy/trunk/core/Lucy/Util/ToolSet.h Wed Sep 23 09:33:48 2009
@@ -24,7 +24,7 @@
#include "Lucy/Object/CharBuf.h"
#include "Lucy/Object/Err.h"
#include "Lucy/Object/Hash.h"
-/* #include "Lucy/Object/Num.h" */
+#include "Lucy/Object/Num.h"
#include "Lucy/Object/Undefined.h"
#include "Lucy/Object/VArray.h"
#include "Lucy/Object/VTable.h"
Modified: lucene/lucy/trunk/perl/lib/Lucy/Test.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/lib/Lucy/Test.pm?rev=818016&r1=818015&r2=818016&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/lib/Lucy/Test.pm (original)
+++ lucene/lucy/trunk/perl/lib/Lucy/Test.pm Wed Sep 23 09:33:48 2009
@@ -27,15 +27,19 @@
else if (strEQ(package, "TestHash")) {
lucy_TestHash_run_tests();
}
+ else if (strEQ(package, "TestNum")) {
+ lucy_TestNum_run_tests();
+ }
+ else if (strEQ(package, "TestVArray")) {
+ lucy_TestVArray_run_tests();
+ }
+ /* Lucy::Util */
else if (strEQ(package, "TestNumberUtils")) {
lucy_TestNumUtil_run_tests();
}
else if (strEQ(package, "TestStringHelper")) {
lucy_TestStrHelp_run_tests();
}
- else if (strEQ(package, "TestVArray")) {
- lucy_TestVArray_run_tests();
- }
else {
THROW(LUCY_ERR, "Unknown test id: %s", package);
}
Added: lucene/lucy/trunk/perl/t/core/031-num.t
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/t/core/031-num.t?rev=818016&view=auto
==============================================================================
--- lucene/lucy/trunk/perl/t/core/031-num.t (added)
+++ lucene/lucy/trunk/perl/t/core/031-num.t Wed Sep 23 09:33:48 2009
@@ -0,0 +1,6 @@
+use strict;
+use warnings;
+
+use Lucy::Test;
+Lucy::Test::run_tests("TestNum");
+
Propchange: lucene/lucy/trunk/perl/t/core/031-num.t
------------------------------------------------------------------------------
svn:eol-style = native