Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 611562592
  • Loading branch information
tensorflower-gardener authored and tflite-support-robot committed Feb 29, 2024
1 parent e8bda99 commit 3c280ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tensorflow_lite_support/scann_ondevice/cc/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cc_test(
"//tensorflow_lite_support/scann_ondevice/cc:index",
"//tensorflow_lite_support/scann_ondevice/cc/core:serialized_searcher_cc_proto",
"//tensorflow_lite_support/scann_ondevice/proto:index_config_cc_proto",
"@com_google_absl//absl/flags:flag",
"//testing/base/public:gunit",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@org_tensorflow//tensorflow/lite:test_util",
Expand All @@ -54,7 +54,7 @@ cc_test(
"//tensorflow_lite_support/cc/test:test_utils",
"//tensorflow_lite_support/scann_ondevice/cc:index_builder",
"//tensorflow_lite_support/scann_ondevice/proto:index_config_cc_proto",
"@com_google_absl//absl/flags:flag",
"//testing/base/public:gunit",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
#include <cstdint>
#include <string>

#include "absl/flags/flag.h" // from @com_google_absl
#include <gtest/gtest.h>
#include "absl/memory/memory.h" // from @com_google_absl
#include "absl/status/status.h" // from @com_google_absl
#include "absl/strings/str_format.h" // from @com_google_absl
Expand Down Expand Up @@ -132,7 +132,7 @@ class PopulateIndexFileTest : public TestWithParam<bool /*compression*/> {};

TEST_P(PopulateIndexFileTest, WritesHashedDatabaseWithPartitioner) {
const std::string db_path =
tflite::task::JoinPath(getenv("TEST_TMPDIR"), "hashed");
tflite::task::JoinPath(::testing::TempDir(), "hashed");
const bool compression = GetParam();

{
Expand Down Expand Up @@ -248,7 +248,7 @@ TEST_P(PopulateIndexFileTest, WritesHashedDatabaseWithPartitioner) {

TEST_P(PopulateIndexFileTest, WritesHashedDatabaseWithoutPartitioner) {
const std::string db_path =
tflite::task::JoinPath(getenv("TEST_TMPDIR"), "float");
tflite::task::JoinPath(::testing::TempDir(), "float");
const bool compression = GetParam();

{
Expand Down Expand Up @@ -337,7 +337,7 @@ TEST_P(PopulateIndexFileTest, WritesHashedDatabaseWithoutPartitioner) {

TEST_P(PopulateIndexFileTest, WritesFloatDatabaseWithPartitioner) {
const std::string db_path =
tflite::task::JoinPath(getenv("TEST_TMPDIR"), "float");
tflite::task::JoinPath(::testing::TempDir(), "float");
const bool compression = GetParam();

{
Expand Down Expand Up @@ -456,7 +456,7 @@ TEST_P(PopulateIndexFileTest, WritesFloatDatabaseWithPartitioner) {

TEST_P(PopulateIndexFileTest, WritesFloatDatabaseWithoutPartitioner) {
const std::string db_path =
tflite::task::JoinPath(getenv("TEST_TMPDIR"), "float");
tflite::task::JoinPath(::testing::TempDir(), "float");
const bool compression = GetParam();

{
Expand Down
8 changes: 3 additions & 5 deletions tensorflow_lite_support/scann_ondevice/cc/test/index_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#include <memory>

#include "tensorflow_lite_support/scann_ondevice/cc/core/serialized_searcher.pb.h"
#include "absl/flags/flag.h" // from @com_google_absl
#include <gtest/gtest.h>
#include "absl/status/status.h" // from @com_google_absl
#include "absl/strings/string_view.h" // from @com_google_absl
#include "tensorflow/lite/test_util.h"
Expand Down Expand Up @@ -47,8 +47,7 @@ constexpr char kDummyIndexPath[] =
TEST(CreateFromOptionsTest, Succeeds) {
// Load file in memory using ExternalFile.
ExternalFile file;
file.set_file_name(
JoinPath("./" /*test src dir*/, kDummyIndexPath));
file.set_file_name(JoinPath(::testing::SrcDir(), kDummyIndexPath));
SUPPORT_ASSERT_OK_AND_ASSIGN(std::unique_ptr<ExternalFileHandler> handler,
ExternalFileHandler::CreateFromExternalFile(&file));
absl::string_view file_contents = handler->GetFileContent();
Expand All @@ -62,8 +61,7 @@ class IndexTest : public tflite::testing::Test {
IndexTest() {
// Load file in memory using ExternalFile.
ExternalFile file;
file.set_file_name(
JoinPath("./" /*test src dir*/, kDummyIndexPath));
file.set_file_name(JoinPath(::testing::SrcDir(), kDummyIndexPath));
handler_ = ExternalFileHandler::CreateFromExternalFile(&file).value();
absl::string_view file_contents = handler_->GetFileContent();
// Build index.
Expand Down

0 comments on commit 3c280ea

Please sign in to comment.