first commit

This commit is contained in:
stuce-bot 2025-06-30 20:47:33 +02:00
commit 5893b00dd2
1669 changed files with 1982740 additions and 0 deletions

View file

@ -0,0 +1,22 @@
/*
* SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
*
* SPDX-License-Identifier: MIT
*/
/*
UnitTest for M5Utility
*/
#include <gtest/gtest.h>
#include <M5Utility.hpp>
TEST(Utility, is_powerof2)
{
EXPECT_FALSE(m5::math::is_powerof2(0));
EXPECT_TRUE(m5::math::is_powerof2(1));
EXPECT_TRUE(m5::math::is_powerof2(2));
EXPECT_FALSE(m5::math::is_powerof2(3));
constexpr auto b = m5::math::is_powerof2(-1);
EXPECT_FALSE(b);
EXPECT_FALSE(m5::math::is_powerof2(-2));
}