From 262ed9c03ad4e8e934b8480401dcef43fb18dfc6 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 10 Jun 2020 08:04:34 -0400 Subject: [PATCH] Tests: Avoid using std. No functional change. --- test_regress/t/TestSimulator.h | 4 ++-- test_regress/t/t_scope_map.cpp | 2 -- test_regress/t/t_timescale.cpp | 5 ++--- test_regress/t/t_vpi_get.cpp | 9 ++++----- test_regress/t/t_vpi_memory.cpp | 9 ++++----- test_regress/t/t_vpi_module.cpp | 1 - test_regress/t/t_vpi_time_cb.cpp | 11 +++++------ test_regress/t/t_vpi_var.cpp | 9 ++++----- test_regress/t/t_vpi_zero_time_cb.cpp | 11 +++++------ 9 files changed, 26 insertions(+), 35 deletions(-) diff --git a/test_regress/t/TestSimulator.h b/test_regress/t/TestSimulator.h index 6a6803774..63d537eff 100644 --- a/test_regress/t/TestSimulator.h +++ b/test_regress/t/TestSimulator.h @@ -67,8 +67,8 @@ public: } // return absolute scope of obj static const char* rooted(const char* obj) { - static string buf; - ostringstream os; + static std::string buf; + std::ostringstream os; os< -using namespace std; #define FILENM "t_timescale.cpp" #define CHECK_RESULT(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << FILENM << ":" << __LINE__ << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << FILENM << ":" << __LINE__ << ": GOT = " << (got) \ + << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } diff --git a/test_regress/t/t_vpi_get.cpp b/test_regress/t/t_vpi_get.cpp index 0dd2e7541..08d4dcfef 100644 --- a/test_regress/t/t_vpi_get.cpp +++ b/test_regress/t/t_vpi_get.cpp @@ -30,7 +30,6 @@ #include #include #include -using namespace std; #include "TestSimulator.h" #include "TestVpi.h" @@ -60,15 +59,15 @@ unsigned int main_time = 0; // Use cout to avoid issues with %d/%lx etc #define CHECK_RESULT(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << FILENM << ":" << __LINE__ << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << FILENM << ":" << __LINE__ << ": GOT = " << (got) \ + << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } #define CHECK_RESULT_HEX(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << FILENM << ":" << __LINE__ << hex << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << FILENM << ":" << __LINE__ << std::hex \ + << ": GOT = " << (got) << " EXP = " << (exp) << endl; \ return __LINE__; \ } diff --git a/test_regress/t/t_vpi_memory.cpp b/test_regress/t/t_vpi_memory.cpp index 1f8882a4d..e3a85982b 100644 --- a/test_regress/t/t_vpi_memory.cpp +++ b/test_regress/t/t_vpi_memory.cpp @@ -30,7 +30,6 @@ #include #include #include -using namespace std; #include "TestSimulator.h" #include "TestVpi.h" @@ -60,15 +59,15 @@ unsigned int main_time = 0; // Use cout to avoid issues with %d/%lx etc #define CHECK_RESULT(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << FILENM << ":" << __LINE__ << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << FILENM << ":" << __LINE__ << ": GOT = " << (got) \ + << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } #define CHECK_RESULT_HEX(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << FILENM << ":" << __LINE__ << hex << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << FILENM << ":" << __LINE__ << std::hex \ + << ": GOT = " << (got) << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } diff --git a/test_regress/t/t_vpi_module.cpp b/test_regress/t/t_vpi_module.cpp index d0559b26e..abbb9fc8a 100644 --- a/test_regress/t/t_vpi_module.cpp +++ b/test_regress/t/t_vpi_module.cpp @@ -30,7 +30,6 @@ #include #include #include -using namespace std; #include "TestSimulator.h" #include "TestVpi.h" diff --git a/test_regress/t/t_vpi_time_cb.cpp b/test_regress/t/t_vpi_time_cb.cpp index 12a5e774b..110f0a160 100644 --- a/test_regress/t/t_vpi_time_cb.cpp +++ b/test_regress/t/t_vpi_time_cb.cpp @@ -31,7 +31,6 @@ #include #include #include -using namespace std; #include "TestSimulator.h" #include "TestVpi.h" @@ -61,15 +60,15 @@ unsigned int callback_count_start_of_sim = 0; // Use cout to avoid issues with %d/%lx etc #define CHECK_RESULT(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << __FILE__ << ":" << __LINE__ << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << __FILE__ << ":" << __LINE__ << ": GOT = " << (got) \ + << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } #define CHECK_RESULT_HEX(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << __FILE__ << ":" << __LINE__ << hex << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << __FILE__ << ":" << __LINE__ << hex \ + << ": GOT = " << (got) << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } @@ -218,7 +217,7 @@ int main(int argc, char** argv, char** env) { void* lib = dlopen(filenamep, RTLD_LAZY); void* bootstrap = dlsym(lib, "vpi_compat_bootstrap"); if (!bootstrap) { - string msg = string("%Error: Could not dlopen ") + filenamep; + std::string msg = std::string("%Error: Could not dlopen ") + filenamep; vl_fatal(__FILE__, __LINE__, "main", msg.c_str()); } ((void (*)(void))bootstrap)(); diff --git a/test_regress/t/t_vpi_var.cpp b/test_regress/t/t_vpi_var.cpp index d268261ae..0b067dab6 100644 --- a/test_regress/t/t_vpi_var.cpp +++ b/test_regress/t/t_vpi_var.cpp @@ -30,7 +30,6 @@ #include #include #include -using namespace std; #include "TestSimulator.h" #include "TestVpi.h" @@ -65,15 +64,15 @@ unsigned int callback_count_strs_max = 500; // Use cout to avoid issues with %d/%lx etc #define CHECK_RESULT(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << FILENM << ":" << __LINE__ << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << FILENM << ":" << __LINE__ << ": GOT = " << (got) \ + << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } #define CHECK_RESULT_HEX(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << FILENM << ":" << __LINE__ << hex << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << FILENM << ":" << __LINE__ << std::hex \ + << ": GOT = " << (got) << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } diff --git a/test_regress/t/t_vpi_zero_time_cb.cpp b/test_regress/t/t_vpi_zero_time_cb.cpp index 94f7bf46c..a553bec45 100644 --- a/test_regress/t/t_vpi_zero_time_cb.cpp +++ b/test_regress/t/t_vpi_zero_time_cb.cpp @@ -31,7 +31,6 @@ #include #include #include -using namespace std; #include "TestSimulator.h" #include "TestVpi.h" @@ -60,15 +59,15 @@ unsigned int callback_count_start_of_sim = 0; // Use cout to avoid issues with %d/%lx etc #define CHECK_RESULT(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << __FILE__ << ":" << __LINE__ << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << __FILE__ << ":" << __LINE__ << ": GOT = " << (got) \ + << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } #define CHECK_RESULT_HEX(got, exp) \ if ((got) != (exp)) { \ - cout << dec << "%Error: " << __FILE__ << ":" << __LINE__ << hex << ": GOT = " << (got) \ - << " EXP = " << (exp) << endl; \ + std::cout << std::dec << "%Error: " << __FILE__ << ":" << __LINE__ << hex \ + << ": GOT = " << (got) << " EXP = " << (exp) << std::endl; \ return __LINE__; \ } @@ -168,7 +167,7 @@ int main(int argc, char** argv, char** env) { void* lib = dlopen(filenamep, RTLD_LAZY); void* bootstrap = dlsym(lib, "vpi_compat_bootstrap"); if (!bootstrap) { - string msg = string("%Error: Could not dlopen ") + filenamep; + std::string msg = std::string("%Error: Could not dlopen ") + filenamep; vl_fatal(__FILE__, __LINE__, "main", msg.c_str()); } ((void (*)(void))bootstrap)();