From c678f9a64809d4e672c7e7f5b690a5a6964ef6aa Mon Sep 17 00:00:00 2001 From: yitam Date: Fri, 23 Jun 2017 16:08:54 -0700 Subject: [PATCH] moved setup folder to functional --- .travis.yml | 8 +- appveyor.yml | 8 +- test/{ => functional}/setup/168256.dat | Bin test/{ => functional}/setup/168256.fmt | 26 ++-- test/{ => functional}/setup/168256.sql | 48 +++---- test/{ => functional}/setup/cd_info.dat | Bin test/{ => functional}/setup/cd_info.fmt | 24 ++-- test/{ => functional}/setup/cd_info.sql | 92 ++++++------ test/{ => functional}/setup/cleanup_dbs.py | 0 test/{ => functional}/setup/create_db.sql | 26 ++-- test/{ => functional}/setup/drop_db.sql | 16 +-- .../setup/exec_sql_scripts.py | 0 test/{ => functional}/setup/setup_dbs.py | 0 test/{ => functional}/setup/test_password.sql | 62 ++++---- .../setup/test_streamable_types.dat | Bin .../setup/test_streamable_types.fmt | 30 ++-- test/{ => functional}/setup/test_types.sql | 134 +++++++++--------- test/{ => functional}/setup/tracks.dat | Bin test/{ => functional}/setup/tracks.fmt | 8 +- test/{ => functional}/setup/tracks.sql | 62 ++++---- test/{ => functional}/setup/xml.dat | Bin test/{ => functional}/setup/xml.fmt | 6 +- 22 files changed, 275 insertions(+), 275 deletions(-) rename test/{ => functional}/setup/168256.dat (100%) rename test/{ => functional}/setup/168256.fmt (98%) rename test/{ => functional}/setup/168256.sql (96%) rename test/{ => functional}/setup/cd_info.dat (100%) rename test/{ => functional}/setup/cd_info.fmt (98%) rename test/{ => functional}/setup/cd_info.sql (94%) rename test/{ => functional}/setup/cleanup_dbs.py (100%) rename test/{ => functional}/setup/create_db.sql (92%) rename test/{ => functional}/setup/drop_db.sql (93%) rename test/{ => functional}/setup/exec_sql_scripts.py (100%) rename test/{ => functional}/setup/setup_dbs.py (100%) rename test/{ => functional}/setup/test_password.sql (96%) rename test/{ => functional}/setup/test_streamable_types.dat (100%) rename test/{ => functional}/setup/test_streamable_types.fmt (98%) rename test/{ => functional}/setup/test_types.sql (97%) rename test/{ => functional}/setup/tracks.dat (100%) rename test/{ => functional}/setup/tracks.fmt (97%) rename test/{ => functional}/setup/tracks.sql (94%) rename test/{ => functional}/setup/xml.dat (100%) rename test/{ => functional}/setup/xml.fmt (97%) diff --git a/.travis.yml b/.travis.yml index dc5738d1..96f02d83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,16 +27,16 @@ install: script: - docker run -e TRAVIS_JOB_ID -t -d -w $PHPSQLDIR --link $TEST_PHP_SQL_SERVER --name=client msphpsql-dev - docker ps -a - - docker exec client python ./test/setup/setup_dbs.py -dbname $SQLSRV_DBNAME - - docker exec client python ./test/setup/setup_dbs.py -dbname $PDOSQLSRV_DBNAME + - docker exec client python ./test/functional/setup/setup_dbs.py -dbname $SQLSRV_DBNAME + - docker exec client python ./test/functional/setup/setup_dbs.py -dbname $PDOSQLSRV_DBNAME - docker exec client php ./source/pdo_sqlsrv/run-tests.php ./test/functional/pdo_sqlsrv/*.phpt - docker exec client php ./source/sqlsrv/run-tests.php ./test/functional/sqlsrv/*.phpt - docker exec client bash -c 'for f in ./test/functional/sqlsrv/*.diff; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true' - docker exec client bash -c 'for f in ./test/functional/sqlsrv/*.out; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true' - docker exec client bash -c 'for f in ./test/functional/pdo_sqlsrv/*.diff; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true' - docker exec client bash -c 'for f in ./test/functional/pdo_sqlsrv/*.out; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true' - - docker exec client python ./test/setup/cleanup_dbs.py -dbname $SQLSRV_DBNAME - - docker exec client python ./test/setup/cleanup_dbs.py -dbname $PDOSQLSRV_DBNAME + - docker exec client python ./test/functional/setup/cleanup_dbs.py -dbname $SQLSRV_DBNAME + - docker exec client python ./test/functional/setup/cleanup_dbs.py -dbname $PDOSQLSRV_DBNAME - docker exec client coveralls -e ./source/shared/ --gcov-options '\-lp' - docker stop client - docker ps -a diff --git a/appveyor.yml b/appveyor.yml index c80e64d6..58d7d91c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -163,15 +163,15 @@ test_script: - php -i - python -V - Echo setup test database for SQLSRV tests - %SQLSRV_DBNAME% - - python %APPVEYOR_BUILD_FOLDER%\test\setup\setup_dbs.py -dbname %SQLSRV_DBNAME% + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %SQLSRV_DBNAME% - Echo setup test database for PDO_SQLSRV tests - %PDOSQLSRV_DBNAME% - - python %APPVEYOR_BUILD_FOLDER%\test\setup\setup_dbs.py -dbname %PDOSQLSRV_DBNAME% + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\setup_dbs.py -dbname %PDOSQLSRV_DBNAME% - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log - php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1 - type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log - - python %APPVEYOR_BUILD_FOLDER%\test\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% - - python %APPVEYOR_BUILD_FOLDER%\test\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME% + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME% + - python %APPVEYOR_BUILD_FOLDER%\test\functional\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME% after_test: - cd %APPVEYOR_BUILD_FOLDER%\test\functional\ diff --git a/test/setup/168256.dat b/test/functional/setup/168256.dat similarity index 100% rename from test/setup/168256.dat rename to test/functional/setup/168256.dat diff --git a/test/setup/168256.fmt b/test/functional/setup/168256.fmt similarity index 98% rename from test/setup/168256.fmt rename to test/functional/setup/168256.fmt index f5b3f474..69786dfd 100644 --- a/test/setup/168256.fmt +++ b/test/functional/setup/168256.fmt @@ -1,13 +1,13 @@ -9.0 -11 -1 SQLINT 0 4 "" 1 SalesOrderID "" -2 SQLINT 0 4 "" 2 SalesOrderDetailID "" -3 SQLNCHAR 2 50 "" 3 CarrierTrackingNumber Latin1_General_CS_AS -4 SQLSMALLINT 0 2 "" 4 OrderQty "" -5 SQLINT 0 4 "" 5 ProductID "" -6 SQLINT 0 4 "" 6 SpecialOfferID "" -7 SQLMONEY 0 8 "" 7 UnitPrice "" -8 SQLMONEY 0 8 "" 8 UnitPriceDiscount "" -9 SQLNUMERIC 1 19 "" 9 LineTotal "" -10 SQLUNIQUEID 1 16 "" 10 rowguid "" -11 SQLDATETIME 0 8 "" 11 ModifiedDate "" +9.0 +11 +1 SQLINT 0 4 "" 1 SalesOrderID "" +2 SQLINT 0 4 "" 2 SalesOrderDetailID "" +3 SQLNCHAR 2 50 "" 3 CarrierTrackingNumber Latin1_General_CS_AS +4 SQLSMALLINT 0 2 "" 4 OrderQty "" +5 SQLINT 0 4 "" 5 ProductID "" +6 SQLINT 0 4 "" 6 SpecialOfferID "" +7 SQLMONEY 0 8 "" 7 UnitPrice "" +8 SQLMONEY 0 8 "" 8 UnitPriceDiscount "" +9 SQLNUMERIC 1 19 "" 9 LineTotal "" +10 SQLUNIQUEID 1 16 "" 10 rowguid "" +11 SQLDATETIME 0 8 "" 11 ModifiedDate "" diff --git a/test/setup/168256.sql b/test/functional/setup/168256.sql similarity index 96% rename from test/setup/168256.sql rename to test/functional/setup/168256.sql index 0b2048c9..82dbe487 100644 --- a/test/setup/168256.sql +++ b/test/functional/setup/168256.sql @@ -1,24 +1,24 @@ -USE $(dbname) -GO - -IF EXISTS (SELECT * FROM sys.objects -WHERE object_id = OBJECT_ID(N'[dbo].[168256]') AND type in (N'U')) - -BEGIN -DROP TABLE [168256] -END -GO - -CREATE TABLE [168256] ( - [SalesOrderID] [int] NOT NULL, - [SalesOrderDetailID] [int] IDENTITY(1,1) NOT NULL, - [CarrierTrackingNumber] [nvarchar](25) NULL, - [OrderQty] [smallint] NOT NULL, - [ProductID] [int] NOT NULL, - [SpecialOfferID] [int] NOT NULL, - [UnitPrice] [money] NOT NULL, - [UnitPriceDiscount] [money] NOT NULL DEFAULT ((0.0)), - [LineTotal] AS (isnull(([UnitPrice]*((1.0)-[UnitPriceDiscount]))*[OrderQty],(0.0))), - [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL DEFAULT (newid()), - [ModifiedDate] [datetime] NOT NULL DEFAULT (getdate())); -GO +USE $(dbname) +GO + +IF EXISTS (SELECT * FROM sys.objects +WHERE object_id = OBJECT_ID(N'[dbo].[168256]') AND type in (N'U')) + +BEGIN +DROP TABLE [168256] +END +GO + +CREATE TABLE [168256] ( + [SalesOrderID] [int] NOT NULL, + [SalesOrderDetailID] [int] IDENTITY(1,1) NOT NULL, + [CarrierTrackingNumber] [nvarchar](25) NULL, + [OrderQty] [smallint] NOT NULL, + [ProductID] [int] NOT NULL, + [SpecialOfferID] [int] NOT NULL, + [UnitPrice] [money] NOT NULL, + [UnitPriceDiscount] [money] NOT NULL DEFAULT ((0.0)), + [LineTotal] AS (isnull(([UnitPrice]*((1.0)-[UnitPriceDiscount]))*[OrderQty],(0.0))), + [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL DEFAULT (newid()), + [ModifiedDate] [datetime] NOT NULL DEFAULT (getdate())); +GO diff --git a/test/setup/cd_info.dat b/test/functional/setup/cd_info.dat similarity index 100% rename from test/setup/cd_info.dat rename to test/functional/setup/cd_info.dat diff --git a/test/setup/cd_info.fmt b/test/functional/setup/cd_info.fmt similarity index 98% rename from test/setup/cd_info.fmt rename to test/functional/setup/cd_info.fmt index 7e0171de..df277bb9 100644 --- a/test/setup/cd_info.fmt +++ b/test/functional/setup/cd_info.fmt @@ -1,12 +1,12 @@ -9.0 -10 -1 SQLCHAR 2 10 "" 1 asin SQL_Latin1_General_CP1_CI_AS -2 SQLCHAR 2 12 "" 2 upc SQL_Latin1_General_CP1_CI_AS -3 SQLCHAR 2 50 "" 3 title SQL_Latin1_General_CP1_CI_AS -4 SQLCHAR 2 50 "" 4 artist SQL_Latin1_General_CP1_CI_AS -5 SQLCHAR 2 12 "" 5 rel_date SQL_Latin1_General_CP1_CI_AS -6 SQLCHAR 2 50 "" 6 label SQL_Latin1_General_CP1_CI_AS -7 SQLCHAR 2 500 "" 7 image SQL_Latin1_General_CP1_CI_AS -8 SQLCHAR 2 500 "" 8 med_image SQL_Latin1_General_CP1_CI_AS -9 SQLCHAR 8 0 "" 9 review1 SQL_Latin1_General_CP1_CI_AS -10 SQLCHAR 8 0 "" 10 review2 SQL_Latin1_General_CP1_CI_AS +9.0 +10 +1 SQLCHAR 2 10 "" 1 asin SQL_Latin1_General_CP1_CI_AS +2 SQLCHAR 2 12 "" 2 upc SQL_Latin1_General_CP1_CI_AS +3 SQLCHAR 2 50 "" 3 title SQL_Latin1_General_CP1_CI_AS +4 SQLCHAR 2 50 "" 4 artist SQL_Latin1_General_CP1_CI_AS +5 SQLCHAR 2 12 "" 5 rel_date SQL_Latin1_General_CP1_CI_AS +6 SQLCHAR 2 50 "" 6 label SQL_Latin1_General_CP1_CI_AS +7 SQLCHAR 2 500 "" 7 image SQL_Latin1_General_CP1_CI_AS +8 SQLCHAR 2 500 "" 8 med_image SQL_Latin1_General_CP1_CI_AS +9 SQLCHAR 8 0 "" 9 review1 SQL_Latin1_General_CP1_CI_AS +10 SQLCHAR 8 0 "" 10 review2 SQL_Latin1_General_CP1_CI_AS diff --git a/test/setup/cd_info.sql b/test/functional/setup/cd_info.sql similarity index 94% rename from test/setup/cd_info.sql rename to test/functional/setup/cd_info.sql index 064f83d9..40d3bb04 100644 --- a/test/setup/cd_info.sql +++ b/test/functional/setup/cd_info.sql @@ -1,47 +1,47 @@ -USE $(dbname) -GO - -IF EXISTS (SELECT * FROM sys.objects -WHERE object_id = OBJECT_ID(N'[dbo].[tracks]') AND type in (N'U')) - -BEGIN -ALTER TABLE $(dbname)..[tracks] DROP CONSTRAINT [FK__tracks__asin__7F60ED59] -END - -GO - -IF EXISTS (SELECT * FROM sys.objects -WHERE object_id = OBJECT_ID(N'[dbo].[cd_info]') AND type in (N'U')) - -BEGIN -DROP TABLE [cd_info] -END - -GO - -/****** Object: Table [dbo].[cd_info] Script Date: 09/26/2007 11:26:52 ******/ -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO -SET ANSI_PADDING ON -GO -CREATE TABLE [dbo].[cd_info]( - [asin] [char](10) NOT NULL, - [upc] [char](12) NULL, - [title] [varchar](50) NULL, - [artist] [varchar](50) NULL, - [rel_date] [varchar](12) NOT NULL CONSTRAINT [DF_cd_info_rel_date] DEFAULT ((0)), - [label] [varchar](50) NULL, - [image] [varchar](500) NULL, - [med_image] [varchar](500) NULL, - [review1] [varchar](max) NULL, - [review2] [varchar](max) NULL, - CONSTRAINT [PK_cd_info] PRIMARY KEY CLUSTERED -( - [asin] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) -) - -GO +USE $(dbname) +GO + +IF EXISTS (SELECT * FROM sys.objects +WHERE object_id = OBJECT_ID(N'[dbo].[tracks]') AND type in (N'U')) + +BEGIN +ALTER TABLE $(dbname)..[tracks] DROP CONSTRAINT [FK__tracks__asin__7F60ED59] +END + +GO + +IF EXISTS (SELECT * FROM sys.objects +WHERE object_id = OBJECT_ID(N'[dbo].[cd_info]') AND type in (N'U')) + +BEGIN +DROP TABLE [cd_info] +END + +GO + +/****** Object: Table [dbo].[cd_info] Script Date: 09/26/2007 11:26:52 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_PADDING ON +GO +CREATE TABLE [dbo].[cd_info]( + [asin] [char](10) NOT NULL, + [upc] [char](12) NULL, + [title] [varchar](50) NULL, + [artist] [varchar](50) NULL, + [rel_date] [varchar](12) NOT NULL CONSTRAINT [DF_cd_info_rel_date] DEFAULT ((0)), + [label] [varchar](50) NULL, + [image] [varchar](500) NULL, + [med_image] [varchar](500) NULL, + [review1] [varchar](max) NULL, + [review2] [varchar](max) NULL, + CONSTRAINT [PK_cd_info] PRIMARY KEY CLUSTERED +( + [asin] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +) + +GO SET ANSI_PADDING OFF \ No newline at end of file diff --git a/test/setup/cleanup_dbs.py b/test/functional/setup/cleanup_dbs.py similarity index 100% rename from test/setup/cleanup_dbs.py rename to test/functional/setup/cleanup_dbs.py diff --git a/test/setup/create_db.sql b/test/functional/setup/create_db.sql similarity index 92% rename from test/setup/create_db.sql rename to test/functional/setup/create_db.sql index e82c21ad..d8dee7ac 100644 --- a/test/setup/create_db.sql +++ b/test/functional/setup/create_db.sql @@ -1,13 +1,13 @@ -USE [master] -GO - -IF EXISTS (SELECT name FROM sys.databases WHERE name = '$(dbname)' ) - -BEGIN -DROP DATABASE $(dbname) -END - -CREATE DATABASE $(dbname) - -GO - +USE [master] +GO + +IF EXISTS (SELECT name FROM sys.databases WHERE name = '$(dbname)' ) + +BEGIN +DROP DATABASE $(dbname) +END + +CREATE DATABASE $(dbname) + +GO + diff --git a/test/setup/drop_db.sql b/test/functional/setup/drop_db.sql similarity index 93% rename from test/setup/drop_db.sql rename to test/functional/setup/drop_db.sql index 465b25b7..d45743f5 100644 --- a/test/setup/drop_db.sql +++ b/test/functional/setup/drop_db.sql @@ -1,8 +1,8 @@ -USE [master] -GO - -IF EXISTS (SELECT name FROM sys.databases WHERE name = '$(dbname)' ) - -BEGIN -DROP DATABASE $(dbname) -END +USE [master] +GO + +IF EXISTS (SELECT name FROM sys.databases WHERE name = '$(dbname)' ) + +BEGIN +DROP DATABASE $(dbname) +END diff --git a/test/setup/exec_sql_scripts.py b/test/functional/setup/exec_sql_scripts.py similarity index 100% rename from test/setup/exec_sql_scripts.py rename to test/functional/setup/exec_sql_scripts.py diff --git a/test/setup/setup_dbs.py b/test/functional/setup/setup_dbs.py similarity index 100% rename from test/setup/setup_dbs.py rename to test/functional/setup/setup_dbs.py diff --git a/test/setup/test_password.sql b/test/functional/setup/test_password.sql similarity index 96% rename from test/setup/test_password.sql rename to test/functional/setup/test_password.sql index da37f970..683556c8 100644 --- a/test/setup/test_password.sql +++ b/test/functional/setup/test_password.sql @@ -1,31 +1,31 @@ ---first, create new logins (user id / password pair) if not yet created -USE master; -GO - -IF NOT EXISTS (SELECT name FROM master..syslogins WHERE name = 'test_password') -BEGIN - CREATE LOGIN test_password WITH PASSWORD='! ;4triou'; -END -GO - -IF NOT EXISTS (SELECT name FROM master..syslogins WHERE name = 'test_password2') -BEGIN - CREATE LOGIN test_password2 WITH PASSWORD='!} ;4triou'; -END -GO - -IF NOT EXISTS (SELECT name FROM master..syslogins WHERE name = 'test_password3') -BEGIN - CREATE LOGIN test_password3 WITH PASSWORD='! ;4triou}'; -END -GO - ---the following users will be granted access to the test database -USE $(dbname); -GO - -CREATE USER test_password FROM LOGIN test_password; -CREATE USER test_password2 FROM LOGIN test_password2; -CREATE USER test_password3 FROM LOGIN test_password3; -GO - +--first, create new logins (user id / password pair) if not yet created +USE master; +GO + +IF NOT EXISTS (SELECT name FROM master..syslogins WHERE name = 'test_password') +BEGIN + CREATE LOGIN test_password WITH PASSWORD='! ;4triou'; +END +GO + +IF NOT EXISTS (SELECT name FROM master..syslogins WHERE name = 'test_password2') +BEGIN + CREATE LOGIN test_password2 WITH PASSWORD='!} ;4triou'; +END +GO + +IF NOT EXISTS (SELECT name FROM master..syslogins WHERE name = 'test_password3') +BEGIN + CREATE LOGIN test_password3 WITH PASSWORD='! ;4triou}'; +END +GO + +--the following users will be granted access to the test database +USE $(dbname); +GO + +CREATE USER test_password FROM LOGIN test_password; +CREATE USER test_password2 FROM LOGIN test_password2; +CREATE USER test_password3 FROM LOGIN test_password3; +GO + diff --git a/test/setup/test_streamable_types.dat b/test/functional/setup/test_streamable_types.dat similarity index 100% rename from test/setup/test_streamable_types.dat rename to test/functional/setup/test_streamable_types.dat diff --git a/test/setup/test_streamable_types.fmt b/test/functional/setup/test_streamable_types.fmt similarity index 98% rename from test/setup/test_streamable_types.fmt rename to test/functional/setup/test_streamable_types.fmt index 6e34b824..4a21d438 100644 --- a/test/setup/test_streamable_types.fmt +++ b/test/functional/setup/test_streamable_types.fmt @@ -1,15 +1,15 @@ -9.0 -13 -1 SQLCHAR 8 0 "" 1 varchar_type SQL_Latin1_General_CP1_CI_AS -2 SQLNCHAR 8 0 "" 2 nvarchar_type SQL_Latin1_General_CP1_CI_AS -3 SQLBINARY 8 0 "" 3 varbinary_type "" -4 SQLCHAR 4 0 "" 4 text_type SQL_Latin1_General_CP1_CI_AS -5 SQLNCHAR 4 0 "" 5 ntext_type SQL_Latin1_General_CP1_CI_AS -6 SQLIMAGE 4 0 "" 6 image_type "" -7 SQLNCHAR 8 0 "" 7 xml_type "" -8 SQLCHAR 2 256 "" 8 char_short_type SQL_Latin1_General_CP1_CI_AS -9 SQLCHAR 2 256 "" 9 varchar_short_type SQL_Latin1_General_CP1_CI_AS -10 SQLNCHAR 2 512 "" 10 nchar_short_type SQL_Latin1_General_CP1_CI_AS -11 SQLNCHAR 2 512 "" 11 nvarchar_short_type SQL_Latin1_General_CP1_CI_AS -12 SQLBINARY 2 256 "" 12 binary_short_type "" -13 SQLBINARY 2 256 "" 13 varbinary_short_type "" +9.0 +13 +1 SQLCHAR 8 0 "" 1 varchar_type SQL_Latin1_General_CP1_CI_AS +2 SQLNCHAR 8 0 "" 2 nvarchar_type SQL_Latin1_General_CP1_CI_AS +3 SQLBINARY 8 0 "" 3 varbinary_type "" +4 SQLCHAR 4 0 "" 4 text_type SQL_Latin1_General_CP1_CI_AS +5 SQLNCHAR 4 0 "" 5 ntext_type SQL_Latin1_General_CP1_CI_AS +6 SQLIMAGE 4 0 "" 6 image_type "" +7 SQLNCHAR 8 0 "" 7 xml_type "" +8 SQLCHAR 2 256 "" 8 char_short_type SQL_Latin1_General_CP1_CI_AS +9 SQLCHAR 2 256 "" 9 varchar_short_type SQL_Latin1_General_CP1_CI_AS +10 SQLNCHAR 2 512 "" 10 nchar_short_type SQL_Latin1_General_CP1_CI_AS +11 SQLNCHAR 2 512 "" 11 nvarchar_short_type SQL_Latin1_General_CP1_CI_AS +12 SQLBINARY 2 256 "" 12 binary_short_type "" +13 SQLBINARY 2 256 "" 13 varbinary_short_type "" diff --git a/test/setup/test_types.sql b/test/functional/setup/test_types.sql similarity index 97% rename from test/setup/test_types.sql rename to test/functional/setup/test_types.sql index 75e9c552..eef114de 100644 --- a/test/setup/test_types.sql +++ b/test/functional/setup/test_types.sql @@ -1,67 +1,67 @@ -USE $(dbname) -GO - -CREATE TABLE [test_types] ([bigint_type] BIGINT null, - [int_type] INT null, - [smallint_type] SMALLINT null, - [tinyint_type] TINYINT null, - [bit_type] BIT null, - [decimal_type] DECIMAL(38,0) null, - [money_type] MONEY null, - [smallmoney_type] SMALLMONEY null, - [float_type] FLOAT(53) null, - [real_type] REAL null, - [datetime_type] DATETIME null, - [smalldatetime_type] SMALLDATETIME null ); -GO - --- maximum test -INSERT INTO $(dbname)..[test_types] (bigint_type, int_type, smallint_type, tinyint_type, bit_type, decimal_type, datetime_type, money_type, smallmoney_type, float_type, real_type) - VALUES (9223372036854775807, 2147483647, 32767, 255, 1, 9999999999999999999999999999999999999, '12/12/1968 16:20', 922337203685477.5807, 214748.3647, 1.79E+308, 1.18E-38 ) --- minimum test -INSERT INTO $(dbname)..[test_types] (bigint_type, int_type, smallint_type, tinyint_type, bit_type, decimal_type, datetime_type, money_type, smallmoney_type, float_type, real_type) - VALUES (-9223372036854775808, -2147483648, -32768, 0, 0, -10000000000000000000000000000000000001,'12/12/1968 16:20', -922337203685477.5808, -214748.3648, -1.79E+308, -1.18E-38 ) --- zero test -INSERT INTO $(dbname)..[test_types] (bigint_type, int_type, smallint_type, tinyint_type, bit_type, decimal_type, datetime_type, money_type, smallmoney_type, float_type, real_type) - VALUES (0, 0, 0, 0, 0, 0, '12/12/1968 16:20', 0, 0, 0, 0) - -GO - -CREATE TABLE [test_streamable_types] ( - [varchar_type] VARCHAR(MAX) null, - [nvarchar_type] NVARCHAR(MAX) null, - [varbinary_type] VARBINARY(MAX) null, - [text_type] TEXT null, - [ntext_type] NTEXT null, - [image_type] IMAGE null, - [xml_type] XML null, - [char_short_type] CHAR(256) null, - [varchar_short_type] VARCHAR(256) null, - [nchar_short_type] NCHAR(256) null, - [nvarchar_short_type] NVARCHAR(256) null, - [binary_short_type] BINARY(256) null, - [varbinary_short_type] VARBINARY(256) null ); -GO - -CREATE TABLE [155671] ([cat_id] [int] IDENTITY (1,1) NOT NULL, [cat_title] [varchar](50) NOT NULL, [cat_order][int] NOT NULL) ON [PRIMARY]; -GO - -CREATE TABLE [159137] ([xml_type][xml] null) ON [PRIMARY]; -GO - -IF EXISTS ( SELECT * - FROM sys.objects - WHERE object_id = OBJECT_ID(N'test_out') - AND type IN ( N'P', N'PC' ) ) -BEGIN -DROP proc test_out -END -GO - -create proc test_out @p1 integer, @p2 integer, @p3 integer output -as -begin - select @p3 = @p1 + @p2 - print @p3 -end -go +USE $(dbname) +GO + +CREATE TABLE [test_types] ([bigint_type] BIGINT null, + [int_type] INT null, + [smallint_type] SMALLINT null, + [tinyint_type] TINYINT null, + [bit_type] BIT null, + [decimal_type] DECIMAL(38,0) null, + [money_type] MONEY null, + [smallmoney_type] SMALLMONEY null, + [float_type] FLOAT(53) null, + [real_type] REAL null, + [datetime_type] DATETIME null, + [smalldatetime_type] SMALLDATETIME null ); +GO + +-- maximum test +INSERT INTO $(dbname)..[test_types] (bigint_type, int_type, smallint_type, tinyint_type, bit_type, decimal_type, datetime_type, money_type, smallmoney_type, float_type, real_type) + VALUES (9223372036854775807, 2147483647, 32767, 255, 1, 9999999999999999999999999999999999999, '12/12/1968 16:20', 922337203685477.5807, 214748.3647, 1.79E+308, 1.18E-38 ) +-- minimum test +INSERT INTO $(dbname)..[test_types] (bigint_type, int_type, smallint_type, tinyint_type, bit_type, decimal_type, datetime_type, money_type, smallmoney_type, float_type, real_type) + VALUES (-9223372036854775808, -2147483648, -32768, 0, 0, -10000000000000000000000000000000000001,'12/12/1968 16:20', -922337203685477.5808, -214748.3648, -1.79E+308, -1.18E-38 ) +-- zero test +INSERT INTO $(dbname)..[test_types] (bigint_type, int_type, smallint_type, tinyint_type, bit_type, decimal_type, datetime_type, money_type, smallmoney_type, float_type, real_type) + VALUES (0, 0, 0, 0, 0, 0, '12/12/1968 16:20', 0, 0, 0, 0) + +GO + +CREATE TABLE [test_streamable_types] ( + [varchar_type] VARCHAR(MAX) null, + [nvarchar_type] NVARCHAR(MAX) null, + [varbinary_type] VARBINARY(MAX) null, + [text_type] TEXT null, + [ntext_type] NTEXT null, + [image_type] IMAGE null, + [xml_type] XML null, + [char_short_type] CHAR(256) null, + [varchar_short_type] VARCHAR(256) null, + [nchar_short_type] NCHAR(256) null, + [nvarchar_short_type] NVARCHAR(256) null, + [binary_short_type] BINARY(256) null, + [varbinary_short_type] VARBINARY(256) null ); +GO + +CREATE TABLE [155671] ([cat_id] [int] IDENTITY (1,1) NOT NULL, [cat_title] [varchar](50) NOT NULL, [cat_order][int] NOT NULL) ON [PRIMARY]; +GO + +CREATE TABLE [159137] ([xml_type][xml] null) ON [PRIMARY]; +GO + +IF EXISTS ( SELECT * + FROM sys.objects + WHERE object_id = OBJECT_ID(N'test_out') + AND type IN ( N'P', N'PC' ) ) +BEGIN +DROP proc test_out +END +GO + +create proc test_out @p1 integer, @p2 integer, @p3 integer output +as +begin + select @p3 = @p1 + @p2 + print @p3 +end +go diff --git a/test/setup/tracks.dat b/test/functional/setup/tracks.dat similarity index 100% rename from test/setup/tracks.dat rename to test/functional/setup/tracks.dat diff --git a/test/setup/tracks.fmt b/test/functional/setup/tracks.fmt similarity index 97% rename from test/setup/tracks.fmt rename to test/functional/setup/tracks.fmt index 1c925160..7186668a 100644 --- a/test/setup/tracks.fmt +++ b/test/functional/setup/tracks.fmt @@ -1,4 +1,4 @@ -9.0 -2 -1 SQLCHAR 2 100 "" 1 track SQL_Latin1_General_CP1_CI_AS -2 SQLCHAR 2 10 "" 2 asin SQL_Latin1_General_CP1_CI_AS +9.0 +2 +1 SQLCHAR 2 100 "" 1 track SQL_Latin1_General_CP1_CI_AS +2 SQLCHAR 2 10 "" 2 asin SQL_Latin1_General_CP1_CI_AS diff --git a/test/setup/tracks.sql b/test/functional/setup/tracks.sql similarity index 94% rename from test/setup/tracks.sql rename to test/functional/setup/tracks.sql index 63e73acd..2ba3b793 100644 --- a/test/setup/tracks.sql +++ b/test/functional/setup/tracks.sql @@ -1,32 +1,32 @@ -USE $(dbname) -GO - -IF EXISTS (SELECT * FROM sys.objects -WHERE object_id = OBJECT_ID(N'[dbo].[tracks]') AND type in (N'U')) - -BEGIN -DROP TABLE [tracks] -END -GO - -/****** Object: Table [dbo].[tracks] Script Date: 09/26/2007 11:33:41 ******/ -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO -SET ANSI_PADDING ON -GO -CREATE TABLE [dbo].[tracks]( - [track] [varchar](100) NULL, - [asin] [char](10) NOT NULL -) ON [PRIMARY] -GO - -SET ANSI_PADDING OFF -GO - -ALTER TABLE [dbo].[tracks] WITH NOCHECK ADD CONSTRAINT [FK__tracks__asin__7F60ED59] FOREIGN KEY([asin]) -REFERENCES [dbo].[cd_info] ([asin]) -GO - +USE $(dbname) +GO + +IF EXISTS (SELECT * FROM sys.objects +WHERE object_id = OBJECT_ID(N'[dbo].[tracks]') AND type in (N'U')) + +BEGIN +DROP TABLE [tracks] +END +GO + +/****** Object: Table [dbo].[tracks] Script Date: 09/26/2007 11:33:41 ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_PADDING ON +GO +CREATE TABLE [dbo].[tracks]( + [track] [varchar](100) NULL, + [asin] [char](10) NOT NULL +) ON [PRIMARY] +GO + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[tracks] WITH NOCHECK ADD CONSTRAINT [FK__tracks__asin__7F60ED59] FOREIGN KEY([asin]) +REFERENCES [dbo].[cd_info] ([asin]) +GO + ALTER TABLE [dbo].[tracks] CHECK CONSTRAINT [FK__tracks__asin__7F60ED59] \ No newline at end of file diff --git a/test/setup/xml.dat b/test/functional/setup/xml.dat similarity index 100% rename from test/setup/xml.dat rename to test/functional/setup/xml.dat diff --git a/test/setup/xml.fmt b/test/functional/setup/xml.fmt similarity index 97% rename from test/setup/xml.fmt rename to test/functional/setup/xml.fmt index 12ce6baa..3a4e86f5 100644 --- a/test/setup/xml.fmt +++ b/test/functional/setup/xml.fmt @@ -1,3 +1,3 @@ -9.0 -1 -1 SQLBINARY 8 0 "" 1 xml_type "" +9.0 +1 +1 SQLBINARY 8 0 "" 1 xml_type ""