Skip to content

Commit

Permalink
modified testcase for 10.1.0.0001 (#1)
Browse files Browse the repository at this point in the history
PR for issue# #2
  • Loading branch information
ssihil authored and kisoo-han committed Jun 14, 2017
1 parent a961591 commit d5fc101
Show file tree
Hide file tree
Showing 61 changed files with 344 additions and 238 deletions.
2 changes: 1 addition & 1 deletion php_cubrid_version.h
Expand Up @@ -28,4 +28,4 @@
*
*/

#define PHP_CUBRID_VERSION "10.0.0.0001"
#define PHP_CUBRID_VERSION "10.1.0.0001"
13 changes: 8 additions & 5 deletions tests/cubrid_connect.phpt
Expand Up @@ -34,13 +34,15 @@ cubrid_close($conn);
cubrid_close($conn2);

// invalid db
$conn2 = cubrid_connect('test-db-server', '33000', 'invalid_db', 'dba', '');
#$conn2 = cubrid_connect('test-db-server', '33000', 'invalid_db', 'dba', '');
$conn2 = cubrid_connect($host, $port, 'invalid_db', $user, $passwd);
if($conn2 == false){
printf("[007] [%d] %s\n", cubrid_error_code(), cubrid_error_msg());
}

// invalid password
$conn2 = cubrid_connect('test-db-server', '33000', 'demodb', 'dba', '222');
#$conn2 = cubrid_connect('test-db-server', '33000', 'demodb', 'dba', '222');
$conn2 = cubrid_connect($host, $port, $db, $user, '222');
if($conn2 == false){
printf("[008] [%d] %s\n", cubrid_error_code(), cubrid_error_msg());
}
Expand All @@ -50,7 +52,8 @@ if($conn2 == false){
printf("[009] [%d] %s\n", cubrid_error_code(), cubrid_error_msg());
}

$conn1 = cubrid_connect('test-db-server', '33000', 'demodb', 'invalid_user', '');
#$conn1 = cubrid_connect('test-db-server', '33000', 'demodb', 'invalid_user', '');
$conn1 = cubrid_connect($host, $port, $db, 'invalid_user', '');
if($conn1 == false){
printf("[010] [%d] %s\n", cubrid_error_code(), cubrid_error_msg());
}
Expand Down Expand Up @@ -89,8 +92,8 @@ Warning: Error: DBMS, -677, Failed to connect to database server, %s
Warning: Error: DBMS, -171, Incorrect or missing password.%s
[008] [-171] Incorrect or missing password.%s

Warning: Error: CCI, -20038, Connection timed out %s
[009] [-20038] Connection timed out
Warning: Error: CCI, -20016, Cannot connect to CUBRID CAS in %s
[009] [-20016] Cannot connect to CUBRID CAS

Warning: Error: DBMS, -165, User "invalid_user" is invalid.%s
[010] [-165] User "invalid_user" is invalid.%s
Expand Down
8 changes: 4 additions & 4 deletions tests/cubrid_db_parameter.phpt
Expand Up @@ -33,7 +33,7 @@ if (false !== ($tmp = @cubrid_set_db_parameter($conn, 10000, 1))) {
}

cubrid_set_db_parameter($conn, CUBRID_PARAM_ISOLATION_LEVEL, 50);
cubrid_set_db_parameter($conn, CUBRID_PARAM_ISOLATION_LEVEL, 2);
cubrid_set_db_parameter($conn, CUBRID_PARAM_ISOLATION_LEVEL, 5);

cubrid_set_db_parameter($conn, CUBRID_PARAM_LOCK_TIMEOUT, 1);

Expand All @@ -60,7 +60,7 @@ print "done!";
--EXPECTF--
array(4) {
["PARAM_ISOLATION_LEVEL"]=>
int(3)
int(4)
["PARAM_LOCK_TIMEOUT"]=>
int(-1)
["PARAM_MAX_STRING_LENGTH"]=>
Expand All @@ -69,10 +69,10 @@ array(4) {
int(1)
}

Warning: Error: DBMS, -110, Isolation level value must be between 1 and 6.%s in %s on line %d
Warning: Error: DBMS, -1157, Isolation level value in MVCC must be 'read committed', 'repeatable read' or 'serializable'.%s in %s on line %d
array(4) {
["PARAM_ISOLATION_LEVEL"]=>
int(2)
int(5)
["PARAM_LOCK_TIMEOUT"]=>
int(1)
["PARAM_MAX_STRING_LENGTH"]=>
Expand Down
2 changes: 1 addition & 1 deletion tests/cubrid_enum_type.phpt
Expand Up @@ -115,7 +115,7 @@ function get_result_info($req_handle)

--CLEAN--
--EXPECTF--
Warning: Error: DBMS, -181 %s
Warning: Error: DBMS, -181, %s
cubrid execute failed.

------------ get_result_info --------------------
Expand Down
10 changes: 10 additions & 0 deletions tests/cubrid_lob2_seek.phpt
Expand Up @@ -91,6 +91,16 @@ position after move 47 related to CUBRID_CURSOR_LAST: 0
Warning: cubrid_lob2_seek(): offet(-1) is out of range, please input a proper number. in %s on line %d
position after move 27 related to CUBRID_CURSOR_CURRENT: 27

Warning: cubrid_lob2_close(): %d is not a valid CUBRID-Lob2 resource in %s on line %d

Warning: cubrid_lob2_close() expects parameter 1 to be resource, integer given in %s on line %d

Warning: cubrid_lob2_size64() expects parameter 1 to be resource, integer given in %s on line %d

Warning: cubrid_lob2_tell64() expects parameter 1 to be resource, integer given in %s on line %d

Warning: cubrid_lob2_seek64() expects at least 2 parameters, 1 given in %s on line %d

Warning: cubrid_lob2_seek64(): %d is not a valid CUBRID-Lob2 resource in %s on line %d

Warning: cubrid_lob2_tell64(): %d is not a valid CUBRID-Lob2 resource in %s on line %d
Expand Down
2 changes: 1 addition & 1 deletion tests/cubrid_next_result.phpt
Expand Up @@ -205,7 +205,7 @@ Second Column Flags: not_null primary_key unique_key
------------ print_field_info --------------------
name: athlete
table: history
default value: ""
default value: "NULL"
max length: 0
not null: 1
primary key: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/cubrid_version.phpt
Expand Up @@ -42,6 +42,6 @@ print "done!";
%s
cubrid version: %s
server version: %s
client version: 10.0.0
client version: %s
database name: demodb
done!
30 changes: 24 additions & 6 deletions tests2/choseRunCases.sh
Expand Up @@ -29,14 +29,15 @@ function runAll()
function modifyPort()
{
port=`cubrid broker status -b | grep broker1 | awk '{print $4}'`
sed -i "s/33199/$port/g" $1
cp $1 $1.ori
sed -i "s/33000/$port/g" $1
}

function createDB()
{
mkdir $2
cd $2
cubrid createdb $1
cubrid createdb $1 en_US
cubrid server start $1
cubrid server status
cd ..
Expand All @@ -58,6 +59,9 @@ if [ $1 == -L ]
then
#modify file about: broker port
modifyPort connectLarge.inc
#modify skipifconnectfailure.inc
cp skipifconnectfailure.inc skipifconnectfailure.inc.ori
sed -i "s/connect.inc/connectLarge.inc/g" skipifconnectfailure.inc

#create database
createDB largedb largedbFile
Expand All @@ -71,10 +75,17 @@ then
php largeTable.php

#start to run test cases about large data
runLargeDataCases
if [ "$2" == "" ]
then
runLargeDataCases
else
php run-tests.php $2
fi

#deletedb
deleteDB largedb largedbFile
mv connectLarge.inc.ori connectLarge.inc
mv skipifconnectfailure.inc.ori skipifconnectfailure.inc

#rm large file
cd largeFile
Expand All @@ -89,11 +100,16 @@ then
#create database
createDB phpdb phpdbFile

#start to run test cases about large data
runNormalCases

if [ "$2" == "" ]
then
#start to run test cases about large data
runNormalCases
else
php run-tests.php $2
fi
#deletedb
deleteDB phpdb phpdbFile
mv connect.inc.ori connect.inc

else
#default is to run all of test cases
Expand Down Expand Up @@ -121,6 +137,8 @@ else
#deletedb
deleteDB largedb largedbFile
deleteDB phpdb phpdbFile
mv connectLarge.inc.ori connectLarge.inc
mv connect.inc.ori connect.inc

#rm large file
cd largeFile
Expand Down
2 changes: 1 addition & 1 deletion tests2/connect.inc
@@ -1,7 +1,7 @@
<?php
$host = "test-db-server";
$port = 33000;
$db = "qadb";
$db = "phpdb";
$user = "dba";
$passwd = "";
$connect_url = "CUBRID:$host:$port:$db:::";
Expand Down
38 changes: 19 additions & 19 deletions tests2/php/_01_schema/get_class_name.phpt
Expand Up @@ -8,8 +8,8 @@ require_once('skipifconnectfailure.inc')
--FILE--
<?php
include_once("connect.inc");
$conn = cubrid_connect($host, $port, $db, $user, $passwd);
$req = cubrid_execute($conn, "select * from db_class", CUBRID_INCLUDE_OID);
$conn = cubrid_connect($host, $port, "demodb", $user, $passwd);
$req = cubrid_execute($conn, "select * from game", CUBRID_INCLUDE_OID);
if (!$req) {
printf("[001] [%d] %s\n", cubrid_errno($conn), cubrid_error($conn));
}
Expand Down Expand Up @@ -54,29 +54,29 @@ print "Finished!\n";
--CLEAN--
--EXPECTF--
#####correct example#####
_db_class
_db_class
_db_class
_db_class
_db_class
_db_class
_db_class
_db_class
_db_class
_db_class
game
game
game
game
game
game
game
game
game
game


#####negative example#####

Notice: Undefined variable: oidd in %s on line %d

Warning: Error: CCI, -20, Invalid oid string in %s on line %d
[001]Expect false [-20] [Invalid oid string]
45
Warning: Error: CCI, -20020, Invalid oid string in %s on line %d
[001]Expect false [-20020] [Invalid oid string]
48
Warning: cubrid_get_class_name() expects exactly 2 parameters, 1 given in %s on line %d
[002]Expect false [-20] [Invalid oid string]
45
[002]Expect false [-20020] [Invalid oid string]
48
Warning: cubrid_get_class_name() expects exactly 2 parameters, 0 given in %s on line %d
[003]Expect false [-20] [Invalid oid string]
45
[003]Expect false [-20020] [Invalid oid string]
48
Finished!
26 changes: 17 additions & 9 deletions tests2/php/_01_schema/schema_01.phpt
Expand Up @@ -67,26 +67,30 @@ print "Finished!\n";
#####positive example#####

#####CUBRID_SCH_CLASS#####
Number of class: 51
Number of class: 43
array(1) {
[0]=>
array(2) {
array(3) {
["NAME"]=>
string(8) "_db_auth"
["TYPE"]=>
string(1) "0"
["REMARKS"]=>
NULL
}
}

#####CUBRID_SCH_VCLASS#####
Number of vclass: 17
Number of vclass: 18
array(1) {
[0]=>
array(2) {
array(3) {
["NAME"]=>
string(7) "db_auth"
["TYPE"]=>
string(1) "0"
["REMARKS"]=>
NULL
}
}

Expand All @@ -97,7 +101,7 @@ array(0) {
#####CUBRID_SCH_ATTRIBUTE #####
array(2) {
[0]=>
array(13) {
array(14) {
["ATTR_NAME"]=>
string(7) "type_id"
["DOMAIN"]=>
Expand All @@ -115,7 +119,7 @@ array(2) {
["UNIQUE"]=>
string(1) "0"
["DEFAULT"]=>
NULL
string(4) "NULL"
["ATTR_ORDER"]=>
string(1) "1"
["CLASS_NAME"]=>
Expand All @@ -124,17 +128,19 @@ array(2) {
string(13) "_db_data_type"
["IS_KEY"]=>
string(1) "0"
["REMARKS"]=>
string(0) ""
}
[1]=>
array(13) {
array(14) {
["ATTR_NAME"]=>
string(9) "type_name"
["DOMAIN"]=>
string(1) "2"
["SCALE"]=>
string(1) "0"
["PRECISION"]=>
string(1) "9"
string(2) "16"
["INDEXED"]=>
string(1) "0"
["NON_NULL"]=>
Expand All @@ -144,7 +150,7 @@ array(2) {
["UNIQUE"]=>
string(1) "0"
["DEFAULT"]=>
NULL
string(4) "NULL"
["ATTR_ORDER"]=>
string(1) "2"
["CLASS_NAME"]=>
Expand All @@ -153,6 +159,8 @@ array(2) {
string(13) "_db_data_type"
["IS_KEY"]=>
string(1) "0"
["REMARKS"]=>
string(0) ""
}
}

Expand Down

0 comments on commit d5fc101

Please sign in to comment.