-
Joseph Walton-Rivers authoredJoseph Walton-Rivers authored
safety.cpp 1.23 KiB
/*
* This file is part of FGGL.
*
* FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with FGGL.
* If not, see <https://www.gnu.org/licenses/>.
*/
//
// Created by webpigeon on 23/07/22.
//
#include <gtest/gtest.h>
#include "fggl/util/safety.hpp"
namespace {
using TestType = fggl::util::OpaqueName<unsigned int, struct TestTag>;
TEST(SafetyHandle, CheckZero) {
auto v1 = TestType::make(0);
auto v2 = TestType::make(0);
EXPECT_EQ(v1, v2);
}
TEST(SafetyHandle, CheckValue) {
auto v1 = TestType::make(0x12345678);
auto v2 = TestType::make(0x12345678);
EXPECT_EQ(v1, v2);
}
TEST(SafetyHandle, CheckValueNE) {
auto v1 = TestType::make(0x12345678);
auto v2 = TestType::make(0x87654321);
EXPECT_NE(v1, v2);
}
}