You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/06/19 11:49:33 UTC

[GitHub] [hbase-native-client] phrocker commented on a change in pull request #8: HBASE-24559: Fix test logging initialization

phrocker commented on a change in pull request #8:
URL: https://github.com/apache/hbase-native-client/pull/8#discussion_r442794598



##########
File path: src/hbase/test-util/test-util.cc
##########
@@ -18,81 +18,17 @@
  */
 
 #include "hbase/test-util/test-util.h"
-#include <string.h>
 
-#include <folly/Format.h>
+#include <string>
+#include <limits.h>
+#include <unistd.h>
 
-#include "hbase/client/zk-util.h"
+using std::string;
 
-using hbase::TestUtil;
-using folly::Random;
-
-std::string TestUtil::RandString(int len) {
-  // Create the whole string.
-  // Filling everything with z's
-  auto s = std::string(len, 'z');
-
-  // Now pick a bunch of random numbers
-  for (int i = 0; i < len; i++) {
-    // use Folly's random to get the numbers
-    // as I don't want to have to learn
-    // all the cpp rand invocation magic.
-    auto r = Random::rand32('a', 'z');
-    // Cast that to ascii.
-    s[i] = static_cast<char>(r);
+namespace hbase {
+  string TestUtil::get_exec_path() {
+    char result[ PATH_MAX ];
+    ssize_t count = readlink( "/proc/self/exe", result, PATH_MAX );

Review comment:
       Not sure if we can use boost::dll::program_location ( that's 1.61 + I think ) but that may be more cross platform compatible. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org