awtk/tests/wstr_test.cc

15 lines
351 B
C++
Raw Normal View History

2018-02-21 19:36:38 +08:00
#include "base/wstr.h"
#include "gtest/gtest.h"
TEST(WStr, basic) {
wstr_t str;
const wchar_t* cstr = L"Hello";
ASSERT_EQ(wstr_init(&str, 100), &str);
ASSERT_EQ(str.capacity, 100);
ASSERT_EQ(wstr_set(&str, cstr), RET_OK);
ASSERT_EQ(str.size, wcslen(cstr));
ASSERT_EQ(wcscmp(str.str, cstr), 0);
ASSERT_EQ(wstr_reset(&str), RET_OK);
2018-02-21 19:36:38 +08:00
}