Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c45b50b9
Commit
c45b50b9
authored
Nov 17, 2007
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some cleanup
git-svn-id:
file:///svn/tokudb@612
c7de825b-a66e-492c-adef-691d508d4ae1
parent
9e701335
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
5 deletions
+45
-5
src/tests/test_db_env_open_nocreate.c
src/tests/test_db_env_open_nocreate.c
+36
-0
src/tests/test_db_env_set_data_dir.c
src/tests/test_db_env_set_data_dir.c
+6
-4
src/tests/test_db_env_set_errpfx.c
src/tests/test_db_env_set_errpfx.c
+3
-1
No files found.
src/tests/test_db_env_open_nocreate.c
0 → 100644
View file @
c45b50b9
// Try to open an environment where the directory does not exist
// Try when the dir exists but is not an initialized env
#include <assert.h>
#include <db.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
// DIR is defined in the Makefile
#define CKERR(r) if (r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, db_strerror(r)); assert(r==0);
int
main
()
{
DB_ENV
*
dbenv
;
int
r
;
system
(
"rm -rf "
DIR
);
r
=
db_env_create
(
&
dbenv
,
0
);
assert
(
r
==
0
);
r
=
dbenv
->
open
(
dbenv
,
DIR
,
DB_PRIVATE
|
DB_INIT_MPOOL
,
0
);
assert
(
r
==
ENOENT
);
dbenv
->
close
(
dbenv
,
0
);
// free memory
system
(
"rm -rf "
DIR
);
mkdir
(
DIR
,
0777
);
r
=
db_env_create
(
&
dbenv
,
0
);
assert
(
r
==
0
);
r
=
dbenv
->
open
(
dbenv
,
DIR
,
DB_PRIVATE
|
DB_INIT_MPOOL
,
0
);
assert
(
r
==
ENOENT
);
dbenv
->
close
(
dbenv
,
0
);
// free memory
return
0
;
}
src/tests/test_db_env_set_data_dir.c
View file @
c45b50b9
...
...
@@ -2,6 +2,8 @@
#include <assert.h>
#include <db.h>
// DIR is defined in the Makefile
int
main
()
{
DB_ENV
*
dbenv
;
int
r
;
...
...
@@ -9,16 +11,16 @@ int main() {
r
=
db_env_create
(
&
dbenv
,
0
);
assert
(
r
==
0
);
r
=
dbenv
->
set_data_dir
(
dbenv
,
"."
);
r
=
dbenv
->
set_data_dir
(
dbenv
,
DIR
);
assert
(
r
==
0
);
r
=
dbenv
->
set_data_dir
(
dbenv
,
"."
);
r
=
dbenv
->
set_data_dir
(
dbenv
,
DIR
);
assert
(
r
==
0
);
r
=
dbenv
->
open
(
dbenv
,
"."
,
DB_PRIVATE
+
DB_INIT_MPOOL
,
0
);
r
=
dbenv
->
open
(
dbenv
,
DIR
,
DB_PRIVATE
+
DB_INIT_MPOOL
,
0
);
assert
(
r
==
0
);
r
=
dbenv
->
set_data_dir
(
dbenv
,
"."
);
r
=
dbenv
->
set_data_dir
(
dbenv
,
DIR
);
assert
(
r
!=
0
);
r
=
dbenv
->
close
(
dbenv
,
0
);
...
...
src/tests/test_db_env_set_errpfx.c
View file @
c45b50b9
...
...
@@ -2,6 +2,8 @@
#include <assert.h>
#include <db.h>
// DIR is defined in the Makefile
int
main
()
{
DB_ENV
*
dbenv
;
int
r
;
...
...
@@ -11,7 +13,7 @@ int main() {
dbenv
->
set_errpfx
(
dbenv
,
"houdy partners: "
);
r
=
dbenv
->
open
(
dbenv
,
"."
,
DB_PRIVATE
+
DB_INIT_MPOOL
,
0
);
r
=
dbenv
->
open
(
dbenv
,
DIR
,
DB_CREATE
|
DB_PRIVATE
|
DB_INIT_MPOOL
,
0
);
assert
(
r
==
0
);
r
=
dbenv
->
close
(
dbenv
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment