| 605 | } |
| 606 | |
| 607 | void CheckStringColumnW(SQLHSTMT stmt, int col_id, const std::wstring& expected) { |
| 608 | SQLWCHAR buf[1024]; |
| 609 | SQLLEN buf_len = sizeof(buf) * GetSqlWCharSize(); |
| 610 | |
| 611 | ASSERT_EQ(SQL_SUCCESS, SQLGetData(stmt, col_id, SQL_C_WCHAR, buf, buf_len, &buf_len)); |
| 612 | |
| 613 | EXPECT_GT(buf_len, 0); |
| 614 | |
| 615 | // returned buf_len is in bytes so convert to length in characters |
| 616 | size_t char_count = static_cast<size_t>(buf_len) / GetSqlWCharSize(); |
| 617 | std::wstring returned(buf, buf + char_count); |
| 618 | |
| 619 | EXPECT_EQ(expected, returned); |
| 620 | } |
| 621 | |
| 622 | void CheckNullColumnW(SQLHSTMT stmt, int col_id) { |
| 623 | SQLWCHAR buf[1024]; |
no test coverage detected