[Groonga-commit] groonga/grnxx at be94069 [master] Add a test for N/A key rejection. (#138)

Back to archive index

susumu.yata null+****@clear*****
Thu Dec 25 15:13:11 JST 2014


susumu.yata	2014-12-25 15:13:11 +0900 (Thu, 25 Dec 2014)

  New Revision: be94069c84c19c1d20dfb27012ced5229fd2f82f
  https://github.com/groonga/grnxx/commit/be94069c84c19c1d20dfb27012ced5229fd2f82f

  Message:
    Add a test for N/A key rejection. (#138)

  Modified files:
    test/test_table.cpp

  Modified: test/test_table.cpp (+16 -0)
===================================================================
--- test/test_table.cpp    2014-12-25 12:36:05 +0900 (e9e8b80)
+++ test/test_table.cpp    2014-12-25 15:13:11 +0900 (6dff32d)
@@ -270,6 +270,22 @@ void test_int_key() {
   // Unset key column.
   table->unset_key_column();
   assert(!table->key_column());
+
+  // Test an N/A value.
+  column->set(grnxx::Int(0), grnxx::Int::na());
+  try {
+    table->set_key_column("Column");
+    assert(false);
+  } catch (...) {
+  }
+
+  // Test a trailing N/A value.
+  table->insert_row();
+  try {
+    table->set_key_column("Column");
+    assert(false);
+  } catch (...) {
+  }
 }
 
 void test_text_key() {
-------------- next part --------------
HTML����������������������������...
下载 



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