From b47a212b1736bde0f1224c69c28320edd20d2d0c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 11 Jul 2021 13:55:00 -0400 Subject: [PATCH] initialize "me" before using it. --- unittest/formats/test_file_operations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/formats/test_file_operations.cpp b/unittest/formats/test_file_operations.cpp index eb30b69cfd..794222fe5a 100644 --- a/unittest/formats/test_file_operations.cpp +++ b/unittest/formats/test_file_operations.cpp @@ -208,11 +208,11 @@ TEST_F(FileOperationsTest, read_lines_from_file) MPI_Comm world = MPI_COMM_WORLD; int me, rv; memset(buf, 0, MAX_BUF_SIZE); + MPI_Comm_rank(world, &me); rv = utils::read_lines_from_file(nullptr, 1, MAX_BUF_SIZE, buf, me, world); ASSERT_EQ(rv, 1); - MPI_Comm_rank(world, &me); if (me == 0) { fp = fopen("safe_file_read_test.txt", "r"); ASSERT_NE(fp, nullptr);