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 2012/04/17 02:52:36 UTC
[lucy-commits] svn commit: r1326851 - in /lucy/trunk: core/Lucy/Test/Object/TestErr.c
core/Lucy/Test/Object/TestErr.cfh perl/buildlib/Lucy/Build/Binding/Misc.pm
perl/t/core/020-err.t
Author: marvin
Date: Tue Apr 17 00:52:36 2012
New Revision: 1326851
URL: http://svn.apache.org/viewvc?rev=1326851&view=rev
Log:
Start core tests for Err.
Added:
lucy/trunk/core/Lucy/Test/Object/TestErr.c (with props)
lucy/trunk/core/Lucy/Test/Object/TestErr.cfh (with props)
lucy/trunk/perl/t/core/020-err.t (with props)
Modified:
lucy/trunk/perl/buildlib/Lucy/Build/Binding/Misc.pm
Added: lucy/trunk/core/Lucy/Test/Object/TestErr.c
URL: http://svn.apache.org/viewvc/lucy/trunk/core/Lucy/Test/Object/TestErr.c?rev=1326851&view=auto
==============================================================================
--- lucy/trunk/core/Lucy/Test/Object/TestErr.c (added)
+++ lucy/trunk/core/Lucy/Test/Object/TestErr.c Tue Apr 17 00:52:36 2012
@@ -0,0 +1,45 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#include "Lucy/Util/ToolSet.h"
+
+#include "Lucy/Test.h"
+#include "Lucy/Test/TestUtils.h"
+#include "Lucy/Test/Object/TestErr.h"
+#include "Lucy/Object/Err.h"
+
+static void
+test_To_String(TestBatch *batch) {
+ CharBuf *message = CB_newf("oops");
+ Err *error = Err_new(message);
+ CharBuf *string = Err_To_String(error);
+ TEST_TRUE(batch, CB_Equals(message, (Obj*)string),
+ "Stringifies as message");
+ DECREF(string);
+ DECREF(error);
+}
+
+void
+TestErr_run_tests() {
+ TestBatch *batch = TestBatch_new(1);
+
+ TestBatch_Plan(batch);
+ test_To_String(batch);
+
+ DECREF(batch);
+}
+
+
Propchange: lucy/trunk/core/Lucy/Test/Object/TestErr.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: lucy/trunk/core/Lucy/Test/Object/TestErr.cfh
URL: http://svn.apache.org/viewvc/lucy/trunk/core/Lucy/Test/Object/TestErr.cfh?rev=1326851&view=auto
==============================================================================
--- lucy/trunk/core/Lucy/Test/Object/TestErr.cfh (added)
+++ lucy/trunk/core/Lucy/Test/Object/TestErr.cfh Tue Apr 17 00:52:36 2012
@@ -0,0 +1,23 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+parcel Lucy;
+
+inert class Lucy::Test::Object::TestErr {
+ inert void
+ run_tests();
+}
+
Propchange: lucy/trunk/core/Lucy/Test/Object/TestErr.cfh
------------------------------------------------------------------------------
svn:eol-style = native
Modified: lucy/trunk/perl/buildlib/Lucy/Build/Binding/Misc.pm
URL: http://svn.apache.org/viewvc/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Misc.pm?rev=1326851&r1=1326850&r2=1326851&view=diff
==============================================================================
--- lucy/trunk/perl/buildlib/Lucy/Build/Binding/Misc.pm (original)
+++ lucy/trunk/perl/buildlib/Lucy/Build/Binding/Misc.pm Tue Apr 17 00:52:36 2012
@@ -114,6 +114,9 @@ PPCODE:
lucy_TestStandardTokenizer_run_tests();
}
// Lucy::Object
+ else if (strEQ(package, "TestErr")) {
+ lucy_TestErr_run_tests();
+ }
else if (strEQ(package, "TestObj")) {
lucy_TestObj_run_tests();
}
Added: lucy/trunk/perl/t/core/020-err.t
URL: http://svn.apache.org/viewvc/lucy/trunk/perl/t/core/020-err.t?rev=1326851&view=auto
==============================================================================
--- lucy/trunk/perl/t/core/020-err.t (added)
+++ lucy/trunk/perl/t/core/020-err.t Tue Apr 17 00:52:36 2012
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+use strict;
+use warnings;
+
+use Lucy::Test;
+Lucy::Test::run_tests("TestErr");
+
Propchange: lucy/trunk/perl/t/core/020-err.t
------------------------------------------------------------------------------
svn:eol-style = native