Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
load_leveller
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
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
Lukas Weber
load_leveller
Commits
fc8d34fd
Commit
fc8d34fd
authored
Jul 29, 2019
by
Lukas Weber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use catch2 for testing
parent
f31b7cfb
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16872 additions
and
13 deletions
+16872
-13
test/catch.hpp
test/catch.hpp
+16865
-0
test/duration_parser.cpp
test/duration_parser.cpp
+7
-13
No files found.
test/catch.hpp
0 → 100644
View file @
fc8d34fd
This diff is collapsed.
Click to expand it.
test/duration_parser.cpp
View file @
fc8d34fd
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "jobinfo.cpp"
int
main
()
{
using
namespace
loadl
;
using
namespace
loadl
;
if
(
parse_duration
(
"20"
)
!=
20
)
{
return
1
;
}
if
(
parse_duration
(
"10:03"
)
!=
10
*
60
+
3
)
{
return
2
;
}
if
(
parse_duration
(
"24:06:10"
)
!=
60
*
60
*
24
+
60
*
6
+
10
)
{
return
3
;
}
return
0
;
TEST_CASE
(
"parse durations"
)
{
REQUIRE
(
parse_duration
(
"20"
)
==
20
);
REQUIRE
(
parse_duration
(
"10:03"
)
==
10
*
60
+
3
);
REQUIRE
(
parse_duration
(
"24:06:10"
)
==
60
*
60
*
24
+
60
*
6
+
10
);
}
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