[ox/std] Add min and max tests

This commit is contained in:
Gary Talent 2022-02-10 02:00:59 -06:00
parent f5c7c26340
commit 0d368b3c02
2 changed files with 24 additions and 0 deletions

View File

@ -26,6 +26,7 @@ add_library(
byteswap.cpp
fmt.cpp
heapmgr.cpp
math.cpp
memops.cpp
random.cpp
substitutes.cpp

23
deps/ox/src/ox/std/math.cpp vendored Normal file
View File

@ -0,0 +1,23 @@
/*
* Copyright 2015 - 2022 gary@drinkingtea.net
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "math.hpp"
namespace ox {
static_assert(min(2, 1) == 1);
static_assert(min(1, 2) == 1);
static_assert(max(2, 1) == 2);
static_assert(max(1, 2) == 2);
static_assert(clamp(2, 1, 3) == 2);
static_assert(clamp(1, 2, 3) == 2);
static_assert(clamp(3, 1, 2) == 2);
}