summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorpjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-11-29 18:23:27 +0000
committerpjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-11-29 18:23:27 +0000
commit8460f65dd042d52eaaa80acfef7f288ab4ceb27a (patch)
treef9aa57c89e28acf03e849b930ea66f94f84caceb /tests
parent664191f7a2c161617580ee8e966f126ce2d8a99b (diff)
downloadATCD-8460f65dd042d52eaaa80acfef7f288ab4ceb27a.tar.gz
Added code to remove the temporary backing store.
Diffstat (limited to 'tests')
-rw-r--r--tests/Naming_Test.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/Naming_Test.cpp b/tests/Naming_Test.cpp
index df4cce8410a..6b3f036978a 100644
--- a/tests/Naming_Test.cpp
+++ b/tests/Naming_Test.cpp
@@ -125,7 +125,16 @@ main (int argc, char *argv[])
name_options->parse_args (argc, argv);
name_options->database (ACE::basename (name_options->process_name (),
ACE_DIRECTORY_SEPARATOR_CHAR));
- ns_context->open (ACE_Naming_Context::PROC_LOCAL);
+
+ // Remove the temporary file (if it exists)
+ char temp_file [BUFSIZ];
+ ACE_OS::strcpy (temp_file, name_options->namespace_dir ());
+ ACE_OS::strcat (temp_file, ACE_DIRECTORY_SEPARATOR_STR);
+ ACE_OS::strcat (temp_file, name_options->database ());
+ ACE_OS::unlink (temp_file); // No need to check return value here
+
+ if (ns_context->open (ACE_Naming_Context::PROC_LOCAL) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "Open failed\n"), -1);
// Add some bindings to the database
bind (ns_context, 0);