You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by dk...@apache.org on 2020/05/24 14:25:23 UTC

[avro] branch master updated: AVRO-2845: Fix broken C interop test

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d6a4cf  AVRO-2845: Fix broken C interop test
9d6a4cf is described below

commit 9d6a4cf2d814d1efda5caf855b3a89d8a997c6e0
Author: Kengo Seki <se...@apache.org>
AuthorDate: Sun May 24 23:03:49 2020 +0900

    AVRO-2845: Fix broken C interop test
---
 lang/c/tests/test_interop_data.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lang/c/tests/test_interop_data.c b/lang/c/tests/test_interop_data.c
index 0205e44..4738f31 100644
--- a/lang/c/tests/test_interop_data.c
+++ b/lang/c/tests/test_interop_data.c
@@ -94,12 +94,6 @@ int main(int argc, char *argv[])
         size_t size = strlen(argv[1]) + d_name_len + 2;
         char* path = malloc(sizeof(char) * size);
         sprintf(path, "%s/%s", argv[1], d_name);
-        if (avro_file_reader(path, &reader))
-        {
-            fprintf(stderr, "Failed to read from a file: %s\n", path);
-            free(path);
-            return EXIT_FAILURE;
-        }
 
         if (!should_test(d_name))
         {
@@ -109,6 +103,12 @@ int main(int argc, char *argv[])
         }
         printf("Checking file: %s\n", path);
 
+        if (avro_file_reader(path, &reader))
+        {
+            fprintf(stderr, "Failed to read from a file: %s\n", path);
+            free(path);
+            return EXIT_FAILURE;
+        }
         avro_schema_t schema = avro_file_reader_get_writer_schema(reader);
         avro_value_iface_t *iface = avro_generic_class_from_schema(schema);
         avro_generic_value_new(iface, &value);