|
| 1 | +/* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
| 2 | +
|
| 3 | + This program is free software; you can redistribute it and/or modify |
| 4 | + it under the terms of the GNU General Public License as published by |
| 5 | + the Free Software Foundation; version 2 of the License. |
| 6 | +
|
| 7 | + This program is distributed in the hope that it will be useful, |
| 8 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | + GNU General Public License for more details. |
| 11 | +
|
| 12 | + You should have received a copy of the GNU General Public License |
| 13 | + along with this program; if not, write to the Free Software |
| 14 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
| 15 | + |
| 16 | +#include "my_config.h" |
| 17 | +#include <gtest/gtest.h> |
| 18 | +#include <item.h> |
| 19 | + |
| 20 | +#include "test_utils.h" |
| 21 | + |
| 22 | +namespace item_param_unittest { |
| 23 | +using my_testing::Server_initializer; |
| 24 | + |
| 25 | +class ItemParamTest : public ::testing::Test |
| 26 | +{ |
| 27 | +protected: |
| 28 | + virtual void SetUp() |
| 29 | + { |
| 30 | + m_initializer.SetUp(); |
| 31 | + // An Item expects to be owned by current_thd->free_list, so allocate with |
| 32 | + // new, and do not delete it. |
| 33 | + m_item_param= new Item_param(POS(), 1); |
| 34 | + } |
| 35 | + |
| 36 | + virtual void TearDown() |
| 37 | + { |
| 38 | + m_initializer.TearDown(); |
| 39 | + } |
| 40 | + |
| 41 | + Server_initializer m_initializer; |
| 42 | + Item_param *m_item_param; |
| 43 | +}; |
| 44 | + |
| 45 | +TEST_F(ItemParamTest, convert_str_value) |
| 46 | +{ |
| 47 | + m_item_param->state= Item_param::LONG_DATA_VALUE; |
| 48 | + m_item_param->value.cs_info.final_character_set_of_str_value= NULL; |
| 49 | + EXPECT_TRUE(m_item_param->convert_str_value(m_initializer.thd())); |
| 50 | +} |
| 51 | +} |
0 commit comments