Warning, file /sdk/codevis/thirdparty/soci/tests/odbc/test-odbc-mysql.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 
0008 #include "soci/soci.h"
0009 #include "soci/odbc/soci-odbc.h"
0010 #include "mysql/test-mysql.h"
0011 #include <iostream>
0012 #include <string>
0013 #include <ctime>
0014 #include <cmath>
0015 
0016 std::string connectString;
0017 backend_factory const &backEnd = *soci::factory_odbc();
0018 
0019 int main(int argc, char** argv)
0020 {
0021 #ifdef _MSC_VER
0022     // Redirect errors, unrecoverable problems, and assert() failures to STDERR,
0023     // instead of debug message window.
0024     // This hack is required to run assert()-driven tests by Buildbot.
0025     // NOTE: Comment this 2 lines for debugging with Visual C++ debugger to catch assertions inside.
0026     _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
0027     _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
0028 #endif //_MSC_VER
0029 
0030     if (argc >= 2 && argv[1][0] != '-')
0031     {
0032         connectString = argv[1];
0033 
0034         // Replace the connect string with the process name to ensure that
0035         // CATCH uses the correct name in its messages.
0036         argv[1] = argv[0];
0037 
0038         argc--;
0039         argv++;
0040     }
0041     else
0042     {
0043         connectString = "FILEDSN=./test-mysql.dsn";
0044     }
0045 
0046     test_context tc(backEnd, connectString);
0047 
0048     return Catch::Session().run(argc, argv);
0049 }