#include <gtest/gtest.h>
#include <solution/3201.h>

class MaximumLengthTest : public ::testing::Test
{
  protected:
    // 提供统一断言接口
    void AssertMaximumLength(const std::vector<int> &input, int expected)
    {
        int *arr = const_cast<int *>(input.data());
        int result = maximumLength(arr, input.size());
        EXPECT_EQ(result, expected);
    }
};

// 示例 1：输入 [1,2,3,4]，输出 4
TEST_F(MaximumLengthTest, IncreasingSequence)
{
    AssertMaximumLength({1, 2, 3, 4}, 4);
}

// 示例 2：输入 [1,2,1,1,2,1,2]，输出 6
TEST_F(MaximumLengthTest, AlternatingSequence)
{
    AssertMaximumLength({1, 2, 1, 1, 2, 1, 2}, 6);
}

// 示例 3：输入 [1,3]，输出 2
TEST_F(MaximumLengthTest, ShortSequence)
{
    AssertMaximumLength({1, 3}, 2);
}

// 示例 4：输入 [4,51,68]，输出 3
TEST_F(MaximumLengthTest, TEST4)
{
    AssertMaximumLength({4, 51, 68}, 3);
}