Skip to content

Commit

Permalink
add basic compile time tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkichler committed Feb 8, 2025
1 parent d1e0f53 commit ce0e948
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 0 additions & 1 deletion include/cuinterval/interval.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ constexpr bool operator==(interval<T> lhs, interval<T> rhs)
{
auto empty = [](interval<T> x) { return !(x.lb <= x.ub); };


return (empty(lhs) && empty(rhs)) || (lhs.lb == rhs.lb && lhs.ub == rhs.ub);
}

Expand Down
1 change: 1 addition & 0 deletions tests/tests.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "generated/tests_generated.h"
#include "tests_additional.h"
#include "tests_common.h"
#include "tests_compile_time.h"

#include <cuda_runtime.h>
#include <omp.h>
Expand Down
22 changes: 22 additions & 0 deletions tests/tests_compile_time.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include <cuinterval/interval.h>

// #include <boost/ut.hpp>

#include <concepts>

// using namespace boost::ut;

static_assert(std::regular<cu::interval<int>>);
static_assert(std::regular<cu::interval<float>>);
static_assert(std::regular<cu::interval<double>>);

// void tests_compile_time()
// {
// "regular"_test = [] consteval {
// static_assert(std::regular<cu::interval<int>>);
// static_assert(std::regular<cu::interval<float>>);
// static_assert(std::regular<cu::interval<double>>);
// };
// }

0 comments on commit ce0e948

Please sign in to comment.