From c051028052431aef631956e58473f810799c9876 Mon Sep 17 00:00:00 2001 From: Derek G Foster Date: Fri, 1 Nov 2024 08:50:58 -0700 Subject: [PATCH] Rename es2k_port_manager_dummy (#302) - Renamed es2k_port_manager_dummy.cc to es2k_port_manager_mock.cc. Signed-off-by: Derek Foster --- stratum/hal/lib/tdi/es2k/BUILD | 20 ++++--------------- ...ger_dummy.cc => es2k_port_manager_mock.cc} | 10 +++------- 2 files changed, 7 insertions(+), 23 deletions(-) rename stratum/hal/lib/tdi/es2k/{es2k_port_manager_dummy.cc => es2k_port_manager_mock.cc} (91%) diff --git a/stratum/hal/lib/tdi/es2k/BUILD b/stratum/hal/lib/tdi/es2k/BUILD index 601dc99cb..2834636c9 100644 --- a/stratum/hal/lib/tdi/es2k/BUILD +++ b/stratum/hal/lib/tdi/es2k/BUILD @@ -137,19 +137,17 @@ stratum_cc_library( ) stratum_cc_library( - name = "es2k_port_manager_dummy", + name = "es2k_port_manager_mock", testonly = True, - srcs = ["es2k_port_manager_dummy.cc"], - hdrs = ["es2k_port_manager.h"], + srcs = ["es2k_port_manager_mock.cc"], + hdrs = ["es2k_port_manager_mock.h"], deps = [ + ":es2k_port_manager_interface", "//stratum/glue:integral_types", - "//stratum/glue:logging", "//stratum/glue/status", "//stratum/glue/status:statusor", "//stratum/hal/lib/common:common_cc_proto", "//stratum/hal/lib/tdi:tdi_sde_headers", - "//stratum/lib/channel", - "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/synchronization", ], ) @@ -162,16 +160,6 @@ stratum_cc_library( ], ) -stratum_cc_library( - name = "es2k_port_manager_mock", - testonly = True, - hdrs = ["es2k_port_manager_mock.h"], - deps = [ - ":es2k_port_manager_dummy", - "@com_google_googletest//:gtest", - ], -) - stratum_cc_library( name = "es2k_switch", srcs = ["es2k_switch.cc"], diff --git a/stratum/hal/lib/tdi/es2k/es2k_port_manager_dummy.cc b/stratum/hal/lib/tdi/es2k/es2k_port_manager_mock.cc similarity index 91% rename from stratum/hal/lib/tdi/es2k/es2k_port_manager_dummy.cc rename to stratum/hal/lib/tdi/es2k/es2k_port_manager_mock.cc index ea5ea6b91..05860d28f 100644 --- a/stratum/hal/lib/tdi/es2k/es2k_port_manager_dummy.cc +++ b/stratum/hal/lib/tdi/es2k/es2k_port_manager_mock.cc @@ -2,19 +2,15 @@ // Copyright 2022-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 -// Dummy implementation of ES2K Port Manager. +// Dummy implemementation of Es2kPortManager for use with +// Es2PortManagerMock. #include "absl/synchronization/mutex.h" #include "stratum/glue/integral_types.h" -#include "stratum/glue/logging.h" #include "stratum/glue/status/status.h" -#include "stratum/glue/status/status_macros.h" #include "stratum/glue/status/statusor.h" #include "stratum/hal/lib/common/common.pb.h" -#include "stratum/hal/lib/common/utils.h" #include "stratum/hal/lib/tdi/es2k/es2k_port_manager.h" -#include "stratum/hal/lib/tdi/tdi_status.h" -#include "stratum/lib/channel/channel.h" namespace stratum { namespace hal { @@ -100,7 +96,7 @@ ::util::Status Es2kPortManager::SetPortLoopbackMode( // TODO: Check with Sandeep: Is this required? ::util::StatusOr Es2kPortManager::GetPortIdFromPortKey( int device, const PortKey& port_key) { - return 43; + return 42; } } // namespace tdi