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

class ReverseVowelsTest : public ::testing::Test
{
  protected:
    // 测试包装器
    void AssertReverseVowels(const std::string &input, const std::string &expected)
    {
        char buffer[1024];
        strncpy(buffer, input.c_str(), sizeof(buffer));
        buffer[sizeof(buffer) - 1] = '\0'; // 保证结尾

        char *result = reverseVowels(buffer);
        EXPECT_STREQ(result, expected.c_str());
    }
};

// 示例 1
TEST_F(ReverseVowelsTest, Example1)
{
    AssertReverseVowels("IceCreAm", "AceCreIm");
}

// 示例 2
TEST_F(ReverseVowelsTest, Example2)
{
    AssertReverseVowels("leetcode", "leotcede");
}
