lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r467426 - in /lucene/lucy/trunk/charmonizer: charm_test.c src/Charmonizer/Test/UnusedVars.charm
Date Tue, 24 Oct 2006 18:11:56 GMT
Author: marvin
Date: Tue Oct 24 11:11:55 2006
New Revision: 467426

URL: http://svn.apache.org/viewvc?view=rev&rev=467426
Log:
Add test for UnusedVars module.

Added:
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm
Modified:
    lucene/lucy/trunk/charmonizer/charm_test.c

Modified: lucene/lucy/trunk/charmonizer/charm_test.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/charm_test.c?view=diff&rev=467426&r1=467425&r2=467426
==============================================================================
--- lucene/lucy/trunk/charmonizer/charm_test.c (original)
+++ lucene/lucy/trunk/charmonizer/charm_test.c Tue Oct 24 11:11:55 2006
@@ -13,6 +13,7 @@
 TestGroup tests[] = {
     { "FuncMacro", chaz_TestHand_test_FuncMacro },
     { "Integers", chaz_TestHand_test_Integers },
+    { "UnusedVars", chaz_TestHand_test_UnusedVars },
     { NULL, NULL }
 };
 

Added: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm?view=auto&rev=467426
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm (added)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm Tue Oct 24 11:11:55
2006
@@ -0,0 +1,45 @@
+#define CHAZ_USE_SHORT_NAMES
+
+#include "_charm_test.h"
+#include "Charmonizer/Test/TestHandler.h"
+
+void 
+chaz_TestHand_test_UnusedVars(int *num_tests, int *num_passed, 
+                              int *num_failed, int *num_skipped)
+{
+    int test_num  = 0;
+    *num_tests    = 2;
+    *num_passed   = 0;
+    *num_failed   = 0;
+    *num_skipped  = *num_tests;
+
+    chaz_bool_t unused_var_is_defined = false;
+    chaz_bool_t unreach_is_defined = false;
+
+#ifdef Unused_Var
+    unused_var_is_defined = true;
+#endif
+#ifdef Unreachable_Return
+    unreach_is_defined = true;
+#endif
+
+    Assert_True(unused_var_is_defined, "Unused_Var macro is defined");
+    Assert_True(unreach_is_defined, "Unreachable_Return macro is defined");
+}
+
+/**
+ * Copyright 2006 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.
+ */
+



Mime
View raw message