[Groonga-commit] groonga/groonga at 8d618d6 [master] test: add tests for grn_operator_exec_not_equal()

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Mar 10 15:30:53 JST 2015


Kouhei Sutou	2015-03-10 15:30:53 +0900 (Tue, 10 Mar 2015)

  New Revision: 8d618d619b93899495c7ceb514d705b6c50bef7e
  https://github.com/groonga/groonga/commit/8d618d619b93899495c7ceb514d705b6c50bef7e

  Message:
    test: add tests for grn_operator_exec_not_equal()

  Modified files:
    test/unit/core/test-operator.c

  Modified: test/unit/core/test-operator.c (+66 -0)
===================================================================
--- test/unit/core/test-operator.c    2015-03-10 15:27:09 +0900 (800a714)
+++ test/unit/core/test-operator.c    2015-03-10 15:30:53 +0900 (5d77c0d)
@@ -29,6 +29,10 @@ void data_exec_equal_true(void);
 void test_exec_equal_true(gconstpointer data);
 void data_exec_equal_false(void);
 void test_exec_equal_false(gconstpointer data);
+void data_exec_not_equal_true(void);
+void test_exec_not_equal_true(gconstpointer data);
+void data_exec_not_equal_false(void);
+void test_exec_not_equal_false(gconstpointer data);
 
 static gchar *tmp_directory;
 
@@ -174,3 +178,65 @@ test_exec_equal_false(gconstpointer data)
 
   cut_assert_false(grn_operator_exec_equal(context, &lhs, &rhs));
 }
+
+void
+data_exec_not_equal_true(void)
+{
+#define ADD_DATA(lhs_type, rhs_type)                            \
+  gcut_add_datum(lhs_type " != " rhs_type,                      \
+                 "lhs_type", G_TYPE_STRING, lhs_type,           \
+                 "rhs_type", G_TYPE_STRING, rhs_type,           \
+                 NULL)
+
+  ADD_DATA("text", "text");
+  ADD_DATA("text", "int32");
+  ADD_DATA("int32", "text");
+
+#undef ADD_DATA
+}
+
+void
+test_exec_not_equal_true(gconstpointer data)
+{
+  const gchar *lhs_type;
+  const gchar *rhs_type;
+
+  lhs_type = gcut_data_get_string(data, "lhs_type");
+  rhs_type = gcut_data_get_string(data, "rhs_type");
+
+  set_one(&lhs, lhs_type);
+  set_two(&rhs, rhs_type);
+
+  cut_assert_true(grn_operator_exec_not_equal(context, &lhs, &rhs));
+}
+
+void
+data_exec_not_equal_false(void)
+{
+#define ADD_DATA(lhs_type, rhs_type)                            \
+  gcut_add_datum(lhs_type " != " rhs_type,                      \
+                 "lhs_type", G_TYPE_STRING, lhs_type,           \
+                 "rhs_type", G_TYPE_STRING, rhs_type,           \
+                 NULL)
+
+  ADD_DATA("text", "text");
+  ADD_DATA("text", "int32");
+  ADD_DATA("int32", "text");
+
+#undef ADD_DATA
+}
+
+void
+test_exec_not_equal_false(gconstpointer data)
+{
+  const gchar *lhs_type;
+  const gchar *rhs_type;
+
+  lhs_type = gcut_data_get_string(data, "lhs_type");
+  rhs_type = gcut_data_get_string(data, "rhs_type");
+
+  set_one(&lhs, lhs_type);
+  set_one(&rhs, rhs_type);
+
+  cut_assert_false(grn_operator_exec_not_equal(context, &lhs, &rhs));
+}
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index