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
ec3617d5
Commit
ec3617d5
authored
Jan 25, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add util/log and the tests
parent
e8303817
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
1 deletion
+48
-1
run_tests.sh
run_tests.sh
+5
-0
verify_log.cc
test_util/verify_log.cc
+13
-0
Makefrag
util/Makefrag
+1
-1
log.cc
util/log.cc
+18
-0
log.hh
util/log.hh
+11
-0
No files found.
run_tests.sh
View file @
ec3617d5
...
...
@@ -3,3 +3,8 @@ echo "./mtl/test_util_exe/verify_constants"
./mtl/test_util_exe/verify_constants
echo
==================================================================
echo
"./mtl/test_util_exe/verify_log"
./mtl/test_util_exe/verify_log
echo
==================================================================
test_util/verify_log.cc
0 → 100644
View file @
ec3617d5
#include "util/log.hh"
#include "util/constants.hh"
#include <string>
#include <iostream>
using
std
::
cout
;
using
std
::
endl
;
int
main
(){
std
::
string
line
(
"abcdefghehe"
);
logToFile
log
(
constGlobalConstants
.
logFile
);
log
<<
line
<<
"
\n
"
;
return
0
;
}
util/Makefrag
View file @
ec3617d5
OBJDIRS += util
UTILSRC := onions.cc cryptdb_log.cc ctr.cc util.cc version.cc constants.cc
UTILSRC := onions.cc cryptdb_log.cc ctr.cc util.cc version.cc constants.cc
log.cc
all: $(OBJDIR)/libedbutil.so $(OBJDIR)/libedbutil.a
...
...
util/log.cc
0 → 100644
View file @
ec3617d5
#include "util/log.hh"
#include <assert.h>
#include <stdio.h>
logToFile
::
logToFile
(
std
::
string
filename
){
logfileHandler
=
fopen
(
filename
.
c_str
(),
"w"
);
assert
(
logfileHandler
!=
NULL
);
}
logToFile
&
logToFile
::
operator
<<
(
std
::
string
record
)
{
fwrite
(
record
.
c_str
(),
1
,
record
.
size
(),
logfileHandler
);
return
*
this
;
}
logToFile
::~
logToFile
(){
fclose
(
logfileHandler
);
}
util/log.hh
0 → 100644
View file @
ec3617d5
#pragma once
#include <string>
class
logToFile
{
FILE
*
logfileHandler
;
public
:
logToFile
(
std
::
string
filename
);
logToFile
&
operator
<<
(
std
::
string
record
);
~
logToFile
();
};
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