[MOAB-dev] commit/MOAB: danwu: In unit test stl_test.cc, it seems that the pointer tmp_file can be unexpectedly modified by Cubit14 to an invalid memory address. A simple workaround is to use the static keyword, making tmp_file a file scoped variable that can only be accessed within stl_test.cc
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Dec 6 10:12:47 CST 2013
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/a31dfb0bb17e/
Changeset: a31dfb0bb17e
Branch: master
User: danwu
Date: 2013-12-06 17:12:24
Summary: In unit test stl_test.cc, it seems that the pointer tmp_file can be unexpectedly modified by Cubit14 to an invalid memory address. A simple workaround is to use the static keyword, making tmp_file a file scoped variable that can only be accessed within stl_test.cc
Affected #: 1 file
diff --git a/test/io/stl_test.cc b/test/io/stl_test.cc
index d2a448a..8956b38 100644
--- a/test/io/stl_test.cc
+++ b/test/io/stl_test.cc
@@ -17,7 +17,8 @@ static const char sample[] = STRINGIFY(MESHDIR) "/io/sample.stl";
static const char sample[] = "sample.stl";
#endif
-const char* tmp_file = "test.stl";
+// Use static keyword so that tmp_file can only be accessed within this file
+static const char* tmp_file = "test.stl";
void test_read_ascii();
void test_write_ascii();
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list