Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006637TestLinkRequirement to Test Case Assignmentpublic2014-10-03 07:462015-02-26 21:08
Reporteratisne 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformGFASOSCentOS/RedHatOS Version5
Product Version1.9.11 (2014 Q2 - bug fixing) 
Fixed in Version1.9.13 (2015 #1) 
Summary0006637: Create test case from requiremenent fails - UTF-8 Issue ?
DescriptionThe automatic creation of test suite and test case from requirements may fail when the title of the requirement specification folder contain an UTF-8 character at a certain position.
Steps To ReproduceEnsure use_req_spec_as_testsuite_name = TRUE in custom config.inc.php (and not overloaded in custom_config.inc.php.

1- Create a requirement specification folder with the name 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxéxx' in english UI (or 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxéxx' in french UI)
2- Create a requirement inside
3- select the requirement specification created in step 1 and click on 'Create Test Cases'
-> The function hangs with a DB error. Neither test suite nor test case are created.

I've tested on the Testlink Demo platform (http://demo.testlink.org/latest [^]). The result is different. It is less critic because test suite and test case are created. But:
  * The first two notifications after the creation are blank
  * The test suite have no additive text "(automatically generated from req. spec.)"

I suspect the difference is due to the database used. I use a postgresql database. I guess the demo site use MySql. The two databases may react in a different way to the issue.
Additional InformationI think the problem is the following: the function create_tc_from_requirement in requirement_mgr.class.php truncate the test suite name to append the string "(automatically generated from req. spec.)". It truncates at position $truncate_limit. If exactly at this position stands an UTF-8 character, this can result to have the half of the extended character.
Postgresql detects that the string is in UTF-8 encoding but a character is not entire.

The select is:
SELECT id,name FROM tl_nodes_hierarchy NH WHERE name='xx\xc3\xa0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\xc3 (g\xc3\xa9n\xc3\xa9r\xc3\xa9 automatiquement depuis le dossier d\xe2\x80\x99exigences)' AND node_type_id=2 AND parent_id = 2143;

I've patched replacing the line

$testsuite_name = substr($node['name'],0,$truncate_limit). $addition;

by

$testsuite_name = mb_substr($node['name'],0,$truncate_limit,mb_detect_encoding($node['name'])). $addition;

to deal with UTF-8 strings.
TagsNo tags attached.
Database (MySQL,Postgres,etc)Postgresql 8.3
BrowserFirefox 24.6.0
PHP VersionPHP 5.4
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Files

- Relationships
child of 0006609closedfman Availables hot-fixes for 1.9.12 & How To get full fixed package from gitorious 

-  Notes
(0021831)
fman (administrator)
2014-10-03 09:11

thanks for reporting

- Issue History
Date Modified Username Field Change
2014-10-03 07:46 atisne New Issue
2014-10-03 09:11 fman Note Added: 0021831
2014-10-03 09:11 fman QA Team - Task Workflow Status => TBD
2014-10-03 09:11 fman Summary Create test case from requiremenent fails => Create test case from requiremenent fails - UTF-8 Issue ?
2014-10-03 17:36 fman QA Team - Task Workflow Status TBD => READY FOR TESTING
2014-10-03 17:36 fman Fixed in Version => 1.9.13 (2015 #1)
2014-10-03 17:37 fman Relationship added child of 0006609
2014-10-03 17:37 fman Status new => resolved
2014-10-03 17:37 fman Resolution open => fixed
2014-10-03 17:37 fman Assigned To => fman
2015-02-26 21:08 fman Status resolved => closed



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker