Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
f7a91d70
Verified
Commit
f7a91d70
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
TST: enable all tests
parent
0a708961
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#9650
passed
3 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#9652
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/caosdb/utils.h
+6
-10
6 additions, 10 deletions
include/caosdb/utils.h
test/CMakeLists.txt
+1
-1
1 addition, 1 deletion
test/CMakeLists.txt
with
7 additions
and
11 deletions
include/caosdb/utils.h
+
6
−
10
View file @
f7a91d70
...
@@ -26,9 +26,7 @@
...
@@ -26,9 +26,7 @@
#include
<fstream>
#include
<fstream>
#include
<string>
#include
<string>
#include
<cstdlib>
#include
<cstdlib>
/*
#include
<boost/beast/core/detail/base64.hpp>
#include
<boost/beast/core/detail/base64.hpp>
*/
namespace
caosdb
::
utils
{
namespace
caosdb
::
utils
{
...
@@ -70,16 +68,14 @@ inline auto get_env_var(const std::string &key, const std::string &fall_back)
...
@@ -70,16 +68,14 @@ inline auto get_env_var(const std::string &key, const std::string &fall_back)
* @brief Encode string as base64
* @brief Encode string as base64
*/
*/
inline
auto
base64_encode
(
const
std
::
string
&
plain
)
->
std
::
string
{
inline
auto
base64_encode
(
const
std
::
string
&
plain
)
->
std
::
string
{
return
std
::
string
(
"YWRtaW46Y2Fvc2Ri"
);
auto
size_plain
=
plain
.
size
();
// TODO
auto
size_encoded
=
boost
::
beast
::
detail
::
base64
::
encoded_size
(
size_plain
);
// auto size_plain = plain.size();
// auto size_encoded = boost::beast::detail::base64::encoded_size(size_plain);
//
char encoded[size_encoded];
char
encoded
[
size_encoded
];
//
boost::beast::detail::base64::encode(&encoded, plain.c_str(), size_plain);
boost
::
beast
::
detail
::
base64
::
encode
(
&
encoded
,
plain
.
c_str
(),
size_plain
);
//
//
the encoded char[] is not null terminated, so explicitely set the length
// the encoded char[] is not null terminated, so explicitely set the length
//
return std::string(encoded, encoded + size_encoded);
return
std
::
string
(
encoded
,
encoded
+
size_encoded
);
}
}
}
// namespace caosdb::utils
}
// namespace caosdb::utils
...
...
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
+
1
−
1
View file @
f7a91d70
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
# append all the test cases here (file name without the ".cpp" suffix)
# append all the test cases here (file name without the ".cpp" suffix)
set
(
test_cases
set
(
test_cases
test_connection
test_connection
#
test_utils
test_utils
)
)
# download gtest library
# download gtest library
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment