@@ -2431,11 +2431,9 @@ TEST_F(FlightSQLODBCMockTestBase, SQLDescribeColQueryAllDataTypesMetadata) {
24312431
24322432 EXPECT_EQ (ret, SQL_SUCCESS);
24332433
2434- EXPECT_GT (nameLength, 0 );
2434+ EXPECT_EQ (nameLength, wcslen (columnNames[i]) );
24352435
2436- // Returned nameLength is in bytes so convert to length in characters
2437- size_t charCount = static_cast <size_t >(nameLength) / ODBC::GetSqlWCharSize ();
2438- std::wstring returned (columnName, columnName + charCount);
2436+ std::wstring returned (columnName, columnName + nameLength);
24392437 EXPECT_EQ (returned, columnNames[i]);
24402438 EXPECT_EQ (columnDataType, columnDataTypes[i]);
24412439 EXPECT_EQ (columnSize, 1024 );
@@ -2515,11 +2513,9 @@ TEST_F(FlightSQLODBCRemoteTestBase, SQLDescribeColQueryAllDataTypesMetadata) {
25152513
25162514 EXPECT_EQ (ret, SQL_SUCCESS);
25172515
2518- EXPECT_GT (nameLength, 0 );
2516+ EXPECT_EQ (nameLength, wcslen (columnNames[i]) );
25192517
2520- // Returned nameLength is in bytes so convert to length in characters
2521- size_t charCount = static_cast <size_t >(nameLength) / ODBC::GetSqlWCharSize ();
2522- std::wstring returned (columnName, columnName + charCount);
2518+ std::wstring returned (columnName, columnName + nameLength);
25232519 EXPECT_EQ (returned, columnNames[i]);
25242520 EXPECT_EQ (columnDataType, columnDataTypes[i]);
25252521 EXPECT_EQ (columnSize, columnSizes[i]);
@@ -2579,11 +2575,9 @@ TEST_F(FlightSQLODBCRemoteTestBase, SQLDescribeColODBCTestTableMetadata) {
25792575
25802576 EXPECT_EQ (ret, SQL_SUCCESS);
25812577
2582- EXPECT_GT (nameLength, 0 );
2578+ EXPECT_EQ (nameLength, wcslen (columnNames[i]) );
25832579
2584- // Returned nameLength is in bytes so convert to length in characters
2585- size_t charCount = static_cast <size_t >(nameLength) / ODBC::GetSqlWCharSize ();
2586- std::wstring returned (columnName, columnName + charCount);
2580+ std::wstring returned (columnName, columnName + nameLength);
25872581 EXPECT_EQ (returned, columnNames[i]);
25882582 EXPECT_EQ (columnDataType, columnDataTypes[i]);
25892583 EXPECT_EQ (columnSize, columnSizes[i]);
@@ -2643,11 +2637,9 @@ TEST_F(FlightSQLODBCRemoteTestBase, SQLDescribeColODBCTestTableMetadataODBC2) {
26432637
26442638 EXPECT_EQ (ret, SQL_SUCCESS);
26452639
2646- EXPECT_GT (nameLength, 0 );
2640+ EXPECT_EQ (nameLength, wcslen (columnNames[i]) );
26472641
2648- // Returned nameLength is in bytes so convert to length in characters
2649- size_t charCount = static_cast <size_t >(nameLength) / ODBC::GetSqlWCharSize ();
2650- std::wstring returned (columnName, columnName + charCount);
2642+ std::wstring returned (columnName, columnName + nameLength);
26512643 EXPECT_EQ (returned, columnNames[i]);
26522644 EXPECT_EQ (columnDataType, columnDataTypes[i]);
26532645 EXPECT_EQ (columnSize, columnSizes[i]);
@@ -2701,11 +2693,9 @@ TEST_F(FlightSQLODBCMockTestBase, SQLDescribeColAllTypesTableMetadata) {
27012693
27022694 EXPECT_EQ (ret, SQL_SUCCESS);
27032695
2704- EXPECT_GT (nameLength, 0 );
2696+ EXPECT_EQ (nameLength, wcslen (columnNames[i]) );
27052697
2706- // Returned nameLength is in bytes so convert to length in characters
2707- size_t charCount = static_cast <size_t >(nameLength) / ODBC::GetSqlWCharSize ();
2708- std::wstring returned (columnName, columnName + charCount);
2698+ std::wstring returned (columnName, columnName + nameLength);
27092699 EXPECT_EQ (returned, columnNames[i]);
27102700 EXPECT_EQ (columnDataType, columnDataTypes[i]);
27112701 EXPECT_EQ (columnSize, columnSizes[i]);
@@ -2755,11 +2745,9 @@ TEST_F(FlightSQLODBCMockTestBase, SQLDescribeColUnicodeTableMetadata) {
27552745
27562746 EXPECT_EQ (ret, SQL_SUCCESS);
27572747
2758- EXPECT_GT (nameLength, 0 );
2748+ EXPECT_EQ (nameLength, wcslen (expectedColumnName) );
27592749
2760- // Returned nameLength is in bytes so convert to length in characters
2761- size_t charCount = static_cast <size_t >(nameLength) / ODBC::GetSqlWCharSize ();
2762- std::wstring returned (columnName, columnName + charCount);
2750+ std::wstring returned (columnName, columnName + nameLength);
27632751 EXPECT_EQ (returned, expectedColumnName);
27642752 EXPECT_EQ (columnDataType, expectedColumnDataType);
27652753 EXPECT_EQ (columnSize, expectedColumnSize);
@@ -2810,11 +2798,9 @@ TYPED_TEST(FlightSQLODBCTestBase, SQLColumnsGetMetadataBySQLDescribeCol) {
28102798
28112799 EXPECT_EQ (ret, SQL_SUCCESS);
28122800
2813- EXPECT_GT (nameLength, 0 );
2801+ EXPECT_EQ (nameLength, wcslen (columnNames[i]) );
28142802
2815- // Returned nameLength is in bytes so convert to length in characters
2816- size_t charCount = static_cast <size_t >(nameLength) / ODBC::GetSqlWCharSize ();
2817- std::wstring returned (columnName, columnName + charCount);
2803+ std::wstring returned (columnName, columnName + nameLength);
28182804 EXPECT_EQ (returned, columnNames[i]);
28192805 EXPECT_EQ (columnDataType, columnDataTypes[i]);
28202806 EXPECT_EQ (columnSize, columnSizes[i]);
@@ -2880,11 +2866,9 @@ TYPED_TEST(FlightSQLODBCTestBase, SQLColumnsGetMetadataBySQLDescribeColODBC2) {
28802866
28812867 EXPECT_EQ (ret, SQL_SUCCESS);
28822868
2883- EXPECT_GT (nameLength, 0 );
2869+ EXPECT_EQ (nameLength, wcslen (columnNames[i]) );
28842870
2885- // Returned nameLength is in bytes so convert to length in characters
2886- size_t charCount = static_cast <size_t >(nameLength) / ODBC::GetSqlWCharSize ();
2887- std::wstring returned (columnName, columnName + charCount);
2871+ std::wstring returned (columnName, columnName + nameLength);
28882872 EXPECT_EQ (returned, columnNames[i]);
28892873 EXPECT_EQ (columnDataType, columnDataTypes[i]);
28902874 EXPECT_EQ (columnSize, columnSizes[i]);
0 commit comments