Kouhei Sutou
null+****@clear*****
Tue Dec 22 22:14:28 JST 2015
Kouhei Sutou 2015-12-22 22:14:28 +0900 (Tue, 22 Dec 2015) New Revision: 8317b63f2c013e091c0e511207b8bf57d4dbc514 https://github.com/groonga/groonga/commit/8317b63f2c013e091c0e511207b8bf57d4dbc514 Message: Improve message format Modified files: lib/hash.c lib/ii.c lib/pat.c lib/store.c test/unit/core/test-inverted-index.c Modified: lib/hash.c (+4 -2) =================================================================== --- lib/hash.c 2015-12-22 21:17:35 +0900 (368dd3c) +++ lib/hash.c 2015-12-22 22:14:28 +0900 (c6b23a6) @@ -603,7 +603,8 @@ grn_array_open(grn_ctx *ctx, const char *path) GRN_FREE(array); } } else { - ERR(GRN_INVALID_FORMAT, "[table][array] file type must be %#x: <%#x>", + ERR(GRN_INVALID_FORMAT, + "[table][array] file type must be %#04x: <%#04x>", GRN_TABLE_NO_KEY, io_type); } grn_io_close(ctx, io); @@ -1861,7 +1862,8 @@ grn_hash_open(grn_ctx *ctx, const char *path) GRN_FREE(hash); } } else { - ERR(GRN_INVALID_FORMAT, "[table][hash] file type must be %#x: <%#x>", + ERR(GRN_INVALID_FORMAT, + "[table][hash] file type must be %#04x: <%#04x>", GRN_TABLE_HASH_KEY, io_type); } grn_io_close(ctx, io); Modified: lib/ii.c (+2 -1) =================================================================== --- lib/ii.c 2015-12-22 21:17:35 +0900 (2572a16) +++ lib/ii.c 2015-12-22 22:14:28 +0900 (79d849b) @@ -3741,7 +3741,8 @@ grn_ii_open(grn_ctx *ctx, const char *path, grn_obj *lexicon) header = grn_io_header(seg); io_type = grn_io_get_type(seg); if (io_type != GRN_COLUMN_INDEX) { - ERR(GRN_INVALID_FORMAT, "[column][index] file type must be %#x: <%#x>", + ERR(GRN_INVALID_FORMAT, + "[column][index] file type must be %#04x: <%#04x>", GRN_COLUMN_INDEX, io_type); grn_io_close(ctx, seg); grn_io_close(ctx, chunk); Modified: lib/pat.c (+1 -1) =================================================================== --- lib/pat.c 2015-12-22 21:17:35 +0900 (d24d49c) +++ lib/pat.c 2015-12-22 22:14:28 +0900 (daa3014) @@ -592,7 +592,7 @@ grn_pat_open(grn_ctx *ctx, const char *path) header = grn_io_header(io); io_type = grn_io_get_type(io); if (io_type != GRN_TABLE_PAT_KEY) { - ERR(GRN_INVALID_FORMAT, "[table][pat] file type must be %#x: <%#x>", + ERR(GRN_INVALID_FORMAT, "[table][pat] file type must be %#04x: <%#04x>", GRN_TABLE_PAT_KEY, io_type); grn_io_close(ctx, io); return NULL; Modified: lib/store.c (+4 -2) =================================================================== --- lib/store.c 2015-12-22 21:17:35 +0900 (4d0aeb2) +++ lib/store.c 2015-12-22 22:14:28 +0900 (3b4209c) @@ -83,7 +83,8 @@ grn_ra_open(grn_ctx *ctx, const char *path) header = grn_io_header(io); io_type = grn_io_get_type(io); if (io_type != GRN_COLUMN_FIX_SIZE) { - ERR(GRN_INVALID_FORMAT, "[column][fix-size] file type must be %#x: <%#x>", + ERR(GRN_INVALID_FORMAT, + "[column][fix-size] file type must be %#04x: <%#04x>", GRN_COLUMN_FIX_SIZE, io_type); grn_io_close(ctx, io); return NULL; @@ -417,7 +418,8 @@ grn_ja_open(grn_ctx *ctx, const char *path) header_v2 = grn_io_header(io); io_type = grn_io_get_type(io); if (io_type != GRN_COLUMN_VAR_SIZE) { - ERR(GRN_INVALID_FORMAT, "[column][var-size] file type must be %#x: <%#x>", + ERR(GRN_INVALID_FORMAT, + "[column][var-size] file type must be %#04x: <%#04x>", GRN_COLUMN_VAR_SIZE, io_type); grn_io_close(ctx, io); return NULL; Modified: test/unit/core/test-inverted-index.c (+2 -1) =================================================================== --- test/unit/core/test-inverted-index.c 2015-12-22 21:17:35 +0900 (df4935f) +++ test/unit/core/test-inverted-index.c 2015-12-22 22:14:28 +0900 (10728ab) @@ -291,7 +291,8 @@ test_open_invalid_chunk_file(void) { grn_io *io; gchar *id_string; - gchar expected_error_message[] = "file type unmatch"; + const gchar *expected_error_message = + cut_take_printf("[column][index] file type must be 0x48: <%#04x>", 0); io = grn_io_create(context, path, 10, 10, 10, grn_io_auto, GRN_IO_EXPIRE_SEGMENT); cut_assert_not_null(io); -------------- next part -------------- HTML����������������������������...Télécharger