Commit fc8d34fd authored by Lukas Weber's avatar Lukas Weber

use catch2 for testing

parent f31b7cfb
This diff is collapsed.
#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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment