svn commit: samba r25112 - in branches/SAMBA_4_0/source:
lib/registry/tests torture
metze at samba.org
metze at samba.org
Wed Sep 12 07:29:30 GMT 2007
Author: metze
Date: 2007-09-12 07:29:29 +0000 (Wed, 12 Sep 2007)
New Revision: 25112
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25112
Log:
make torture_temp_dir() available via tortore/torture.h
and return more detailed errors
metze
Modified:
branches/SAMBA_4_0/source/lib/registry/tests/hive.c
branches/SAMBA_4_0/source/lib/registry/tests/registry.c
branches/SAMBA_4_0/source/torture/ui.c
branches/SAMBA_4_0/source/torture/util.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/tests/hive.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tests/hive.c 2007-09-11 23:57:59 UTC (rev 25111)
+++ branches/SAMBA_4_0/source/lib/registry/tests/hive.c 2007-09-12 07:29:29 UTC (rev 25112)
@@ -27,9 +27,6 @@
#include "librpc/gen_ndr/winreg.h"
#include "system/filesys.h"
-NTSTATUS torture_temp_dir(struct torture_context *tctx, const char *prefix,
- const char **tempdir);
-
static bool test_del_nonexistant_key(struct torture_context *tctx,
const void *test_data)
{
Modified: branches/SAMBA_4_0/source/lib/registry/tests/registry.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/tests/registry.c 2007-09-11 23:57:59 UTC (rev 25111)
+++ branches/SAMBA_4_0/source/lib/registry/tests/registry.c 2007-09-12 07:29:29 UTC (rev 25112)
@@ -28,9 +28,6 @@
#include "libcli/security/security.h"
#include "system/filesys.h"
-NTSTATUS torture_temp_dir(struct torture_context *tctx, const char *prefix,
- const char **tempdir);
-
/**
* Test obtaining a predefined key.
*/
Modified: branches/SAMBA_4_0/source/torture/ui.c
===================================================================
--- branches/SAMBA_4_0/source/torture/ui.c 2007-09-11 23:57:59 UTC (rev 25111)
+++ branches/SAMBA_4_0/source/torture/ui.c 2007-09-12 07:29:29 UTC (rev 25112)
@@ -24,6 +24,25 @@
#include "lib/util/dlinklist.h"
#include "param/param.h"
+/**
+ create a temporary directory.
+*/
+_PUBLIC_ NTSTATUS torture_temp_dir(struct torture_context *tctx,
+ const char *prefix,
+ char **tempdir)
+{
+ SMB_ASSERT(tctx->outputdir != NULL);
+
+ *tempdir = talloc_asprintf(tctx, "%s/%s.XXXXXX", tctx->outputdir, prefix);
+ NT_STATUS_HAVE_NO_MEMORY(*tempdir);
+
+ if (mkdtemp(*tempdir) == NULL) {
+ return map_nt_error_from_unix(errno);
+ }
+
+ return NT_STATUS_OK;
+}
+
void torture_comment(struct torture_context *context, const char *comment, ...)
{
va_list ap;
Modified: branches/SAMBA_4_0/source/torture/util.c
===================================================================
--- branches/SAMBA_4_0/source/torture/util.c 2007-09-11 23:57:59 UTC (rev 25111)
+++ branches/SAMBA_4_0/source/torture/util.c 2007-09-12 07:29:29 UTC (rev 25112)
@@ -25,22 +25,6 @@
#include "libcli/raw/libcliraw.h"
/**
- create a temporary directory.
-*/
-_PUBLIC_ NTSTATUS torture_temp_dir(struct torture_context *tctx,
- const char *prefix,
- char **tempdir)
-{
- SMB_ASSERT(tctx->outputdir != NULL);
- *tempdir = talloc_asprintf(tctx, "%s/%s.XXXXXX", tctx->outputdir, prefix);
-
- if (mkdtemp(*tempdir) == NULL)
- return NT_STATUS_UNSUCCESSFUL;
-
- return NT_STATUS_OK;
-}
-
-/**
check if 2 NTTIMEs are equal.
*/
BOOL nt_time_equal(NTTIME *t1, NTTIME *t2)
More information about the samba-cvs
mailing list