~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to unittests/table_identifier.cc

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
 
21
#include <config.h>
22
22
 
23
23
#define BOOST_TEST_DYN_LINK
24
24
#include <boost/test/unit_test.hpp>
32
32
{
33
33
  identifier::Table identifier("test", "a");
34
34
  BOOST_REQUIRE_EQUAL("test/a", identifier.getPath());
35
 
  std::string path;
36
 
  identifier.getSQLPath(path);
37
 
  BOOST_REQUIRE_EQUAL("test.a", path);
 
35
  BOOST_REQUIRE_EQUAL("test.a", identifier.getSQLPath());
38
36
}
39
37
 
40
38
BOOST_AUTO_TEST_CASE(CreateTemporary)
41
39
{
42
40
  identifier::Table identifier("test", "a", message::Table::TEMPORARY);
43
41
  BOOST_REQUIRE_EQUAL("/#sql", identifier.getPath().substr(0, 5));
44
 
  std::string path;
45
 
  identifier.getSQLPath(path);
46
 
  BOOST_REQUIRE_EQUAL("test.#a", path);
 
42
  BOOST_REQUIRE_EQUAL("test.#a", identifier.getSQLPath());
47
43
}
48
44
 
49
45
BOOST_AUTO_TEST_CASE(CreateInternal)
50
46
{
51
47
  identifier::Table identifier("test", "a", message::Table::TEMPORARY);
52
48
  BOOST_REQUIRE_EQUAL("/#sql", identifier.getPath().substr(0, 5));
53
 
  std::string path;
54
 
  identifier.getSQLPath(path);
55
 
  BOOST_REQUIRE_EQUAL("test.#a", path);
 
49
  BOOST_REQUIRE_EQUAL("test.#a", identifier.getSQLPath());
56
50
}
57
51
 
58
52
BOOST_AUTO_TEST_CASE(StaticTmpTable)
59
53
{
60
 
  std::vector<char> pathname;
61
 
 
62
 
  identifier::Table::build_tmptable_filename(pathname);
 
54
  std::string pathname(identifier::Table::build_tmptable_filename());
63
55
 
64
56
  BOOST_REQUIRE_GT(pathname.size(), 0);
65
57
  BOOST_REQUIRE_GT(strlen(&pathname[0]), 0);