367
This commit is contained in:
26
tests/test_367.cpp
Normal file
26
tests/test_367.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by xfj12 on 2025/3/25.
|
||||
//
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <solution/367.h>
|
||||
TEST(IsPerfectSquareTest, PerfectSquareCase)
|
||||
{
|
||||
// [IN] 16
|
||||
// [OUT] true
|
||||
EXPECT_TRUE(isPerfectSquare(16)); // 验证完全平方数
|
||||
}
|
||||
|
||||
TEST(IsPerfectSquareTest, NonPerfectSquareCase)
|
||||
{
|
||||
// [IN] 14
|
||||
// [OUT] false
|
||||
EXPECT_FALSE(isPerfectSquare(14)); // 验证非完全平方数
|
||||
}
|
||||
|
||||
TEST(IsPerfectSquareTest, BigIntNonPerfectSquareCase)
|
||||
{
|
||||
// [IN] 14
|
||||
// [OUT] false
|
||||
EXPECT_FALSE(isPerfectSquare(2147483647)); // 验证非完全平方数
|
||||
}
|
||||
Reference in New Issue
Block a user