null+****@clear*****
null+****@clear*****
2012年 4月 20日 (金) 10:45:10 JST
khayashi 2012-04-20 10:45:10 +0900 (Fri, 20 Apr 2012) New Revision: d8ae4e15735ad5b3db3ba98989dff403336345ba Log: test: migrate a test from Cutter to grntest style The test checks loading the max latitude value of geo point. Added files: test/function/suite/load/scalar-geo-point-valid-large-latitude.expected test/function/suite/load/scalar-geo-point-valid-large-latitude.test Modified files: test/unit/core/test-command-load.c Added: test/function/suite/load/scalar-geo-point-valid-large-latitude.expected (+43 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/load/scalar-geo-point-valid-large-latitude.expected 2012-04-20 10:45:10 +0900 (56b66de) @@ -0,0 +1,43 @@ +table_create Shops TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Shops location COLUMN_SCALAR WGS84GeoPoint +[[0,0.0,0.0],true] +load --table Shops +[ +{"_key": "たかね", "location": "324000000x502419287"} +] +[[0,0.0,0.0],1] +select Shops +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 1 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "ShortText" + ], + [ + "location", + "WGS84GeoPoint" + ] + ], + [ + 1, + "たかね", + "324000000x502419287" + ] + ] + ] +] Added: test/function/suite/load/scalar-geo-point-valid-large-latitude.test (+9 -0) 100644 =================================================================== --- /dev/null +++ test/function/suite/load/scalar-geo-point-valid-large-latitude.test 2012-04-20 10:45:10 +0900 (b1e704c) @@ -0,0 +1,9 @@ +table_create Shops TABLE_HASH_KEY ShortText +column_create Shops location COLUMN_SCALAR WGS84GeoPoint + +load --table Shops +[ +{"_key": "たかね", "location": "324000000x502419287"} +] + +select Shops Modified: test/unit/core/test-command-load.c (+0 -40) =================================================================== --- test/unit/core/test-command-load.c 2012-04-19 19:01:15 +0900 (75569a9) +++ test/unit/core/test-command-load.c 2012-04-20 10:45:10 +0900 (cef2687) @@ -43,8 +43,6 @@ void data_each(void); void test_each(gconstpointer data); void test_vector_reference_column(void); void test_invalid_int32_value(void); -void data_valid_geo_point_valid(void); -void test_valid_geo_point_value(gconstpointer data); void data_invalid_geo_point_valid(void); void test_invalid_geo_point_value(gconstpointer data); @@ -563,44 +561,6 @@ test_invalid_int32_value(void) send_command("select Users")); } -void -data_valid_geo_point_value(void) -{ -#define ADD_DATUM(label, location) \ - gcut_add_datum(label " (" location ")", \ - "location", G_TYPE_STRING, location, \ - NULL) - - ADD_DATUM("too large latitude", "324000000x502419287"); - ADD_DATUM("too small latitude", "-324000000x502419287"); - ADD_DATUM("too large longitude", "128514964x648000000"); - ADD_DATUM("too small longitude", "128514964x-648000000"); - -#undef ADD_DATUM -} - -void -test_valid_geo_point_value(gconstpointer data) -{ - assert_send_command("table_create Shops TABLE_HASH_KEY ShortText"); - assert_send_command("column_create Shops location COLUMN_SCALAR WGS84GeoPoint"); - cut_assert_equal_string( - "1", - send_command( - cut_take_printf("load --table Shops\n" - "[\n" - "{\"_key\": \"たかね\", \"location\": \"%s\"}\n" - "]\n", - gcut_data_get_string(data, "location")))); - cut_assert_equal_string( - cut_take_printf("[[[1]," - "[[\"_id\",\"UInt32\"]," - "[\"_key\",\"ShortText\"]," - "[\"location\",\"WGS84GeoPoint\"]]," - "[1,\"たかね\",\"%s\"]]]", - gcut_data_get_string(data, "location")), - send_command("select Shops")); -} void data_invalid_geo_point_value(void)