| 343 | } |
| 344 | |
| 345 | TEST_F(StatementRemoteTest, TestSQLExecDirectTimeQuery) { |
| 346 | // Mock server test is skipped due to limitation on the mock server. |
| 347 | // Time type from mock server does not include the fraction |
| 348 | |
| 349 | SQLWCHAR wsql[] = |
| 350 | LR"( |
| 351 | SELECT CAST(TIME '00:00:00' AS TIME) AS time_min, |
| 352 | CAST(TIME '23:59:59' AS TIME) AS time_max; |
| 353 | )"; |
| 354 | SQLSMALLINT wsql_len = std::wcslen(wsql); |
| 355 | |
| 356 | ASSERT_EQ(SQL_SUCCESS, SQLExecDirect(stmt, wsql, wsql_len)); |
| 357 | |
| 358 | ASSERT_EQ(SQL_SUCCESS, SQLFetch(stmt)); |
| 359 | |
| 360 | SQL_TIME_STRUCT time_var{}; |
| 361 | SQLLEN buf_len = sizeof(time_var); |
| 362 | SQLLEN ind; |
| 363 | |
| 364 | ASSERT_EQ(SQL_SUCCESS, SQLGetData(stmt, 1, SQL_C_TYPE_TIME, &time_var, buf_len, &ind)); |
| 365 | // Check min values for time. |
| 366 | EXPECT_EQ(0, time_var.hour); |
| 367 | EXPECT_EQ(0, time_var.minute); |
| 368 | EXPECT_EQ(0, time_var.second); |
| 369 | |
| 370 | ASSERT_EQ(SQL_SUCCESS, SQLGetData(stmt, 2, SQL_C_TYPE_TIME, &time_var, buf_len, &ind)); |
| 371 | // Check max values for time. |
| 372 | EXPECT_EQ(23, time_var.hour); |
| 373 | EXPECT_EQ(59, time_var.minute); |
| 374 | EXPECT_EQ(59, time_var.second); |
| 375 | } |
| 376 | |
| 377 | TEST_F(StatementMockTest, TestSQLExecDirectVarbinaryQuery) { |
| 378 | // Have binary test on mock test base as remote test servers tend to have different |
nothing calls this directly
no test coverage detected