Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
Practical-Cryptdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhaozhen
Practical-Cryptdb
Commits
e8303817
Commit
e8303817
authored
Jan 25, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add constants and add tests
parent
58e2c191
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
3 deletions
+43
-3
Makefile
Makefile
+6
-0
global.constant
conf/global.constant
+2
-1
run_tests.sh
run_tests.sh
+5
-0
Makefrag
test_util/Makefrag
+7
-0
verify_constants.cc
test_util/verify_constants.cc
+12
-0
constants.cc
util/constants.cc
+7
-1
constants.hh
util/constants.hh
+4
-1
No files found.
Makefile
View file @
e8303817
...
...
@@ -77,6 +77,7 @@ $(OBJDIR)/%.o: $(OBJDIR)/%.cc
$(CXX)
-MD
$(CXXFLAGS)
-c
$<
-o
$@
##rules for .cc in debug directory
mtl/%
:
$(OBJDIR)/debug/%.o $(OBJDIR)/libwrapper.so
@
mkdir
-p
$
(
@D
)
$(CXX)
-g
-o
$@
$^
$(CXXFLAGS)
$(LDFLAGS)
-L
/
$(MYBUILD)
/libmysqld
-lmysqld
-laio
-lz
-ldl
-lm
-lcrypt
-lpthread
-lwrapper
-lcryptdb
-ledbcrypto
-ledbutil
-ledbparser
-lntl
-lcrypto
...
...
@@ -87,6 +88,10 @@ mtl/test_wrapper_exe/%:$(OBJDIR)/test_wrapper/%.o $(OBJDIR)/libwrapper.so
$(CXX)
-g
-o
$@
$^
$(CXXFLAGS)
$(LDFLAGS)
-L
/
$(MYBUILD)
/libmysqld
-lmysqld
-laio
-lz
-ldl
-lm
-lcrypt
-lpthread
-lwrapper
-lcryptdb
-ledbcrypto
-ledbutil
-ledbparser
-lntl
-lcrypto
mtl/test_util_exe/%
:
$(OBJDIR)/test_util/%.o
@
mkdir
-p
$
(
@D
)
$(CXX)
-g
-o
$@
$^
$(CXXFLAGS)
$(LDFLAGS)
-L
/
$(MYBUILD)
/libmysqld
-lmysqld
-laio
-lz
-ldl
-lm
-lcrypt
-lpthread
-lcryptdb
-ledbcrypto
-ledbutil
-ledbparser
-lntl
-lcrypto
include
crypto/Makefrag
include
parser/Makefrag
...
...
@@ -96,6 +101,7 @@ include udf/Makefrag
include
mysqlproxy/Makefrag
include
debug/Makefrag
include
test_wrapper/Makefrag
include
test_util/Makefrag
include
wrapper/Makefrag
...
...
conf/global.constant
View file @
e8303817
loadCount:3
loadCount:5
pipelineCount:1000
other:1
run_tests.sh
0 → 100755
View file @
e8303817
source
setup.sh
echo
"./mtl/test_util_exe/verify_constants"
./mtl/test_util_exe/verify_constants
echo
==================================================================
test_util/Makefrag
0 → 100644
View file @
e8303817
OBJDIRS += test_util
##note that xx=*.cc will not expand. wildcard *.cc will include files from other directories.
##%.o will include testall
TESTALL_OBJS := $(patsubst %.cc,$(OBJDIR)/%.o,$(wildcard test_util/*.cc))
TESTALL_EXES := $(patsubst test_util/%.cc,mtl/test_util_exe/%,$(wildcard test_util/*.cc))
all: $(TESTALL_OBJS) $(TESTALL_EXES)
test_util/verify_constants.cc
0 → 100644
View file @
e8303817
#include "util/constants.hh"
#include <iostream>
using
std
::
cout
;
using
std
::
endl
;
int
main
(){
cout
<<
"loadCount:"
<<
constGlobalConstants
.
loadCount
<<
endl
;
cout
<<
"pipilineCount:"
<<
constGlobalConstants
.
pipelineCount
<<
endl
;
cout
<<
"logFile:"
<<
constGlobalConstants
.
logFile
<<
endl
;
return
0
;
}
util/constants.cc
View file @
e8303817
...
...
@@ -22,13 +22,19 @@ globalConstants initGlobalConstants(){
int
index
=
line
.
find
(
":"
);
std
::
string
head
=
line
.
substr
(
0
,
index
);
if
(
head
==
"loadCount"
){
res
.
loadCount
=
stoi
(
line
.
substr
(
index
+
1
));
res
.
loadCount
=
stoi
(
line
.
substr
(
index
+
1
));
}
else
if
(
head
==
"pipelineCount"
){
res
.
pipelineCount
=
stoi
(
line
.
substr
(
index
+
1
));
}
else
if
(
head
==
"other"
){
;
}
else
{
assert
(
0
);
}
}
/* the following values need not be determined
at runtime.*/
res
.
logFile
=
"LOG.TXT"
;
infile
.
close
();
return
res
;
}
...
...
util/constants.hh
View file @
e8303817
...
...
@@ -4,12 +4,15 @@
added by et. all et related things.
*/
#include<assert.h>
#include
<assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string>
struct
globalConstants
{
int
loadCount
;
/*used to limit the number of final_load*/
int
pipelineCount
;
std
::
string
logFile
;
/*file name for log*/
};
extern
const
char
*
cryptdb_dir
;
...
...
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