Iphone单元测试:带有SQL [英] Iphone Unit Test : with SQL
本文介绍了Iphone单元测试:带有SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试对包含FMDB包装的SQL调用的方法进行一些单元测试.当我尝试构建这些项目时,出现很多链接器错误:
I'm trying to do some Unit Testing on method that includes SQL call wrapped by FMDB. I get a lot of linker errors when i try to build the project such as these ones :
"_sqlite3_step", referenced from:
-[FMResultSet next] in FMResultSet.o
-[FMDatabase executeUpdate:arguments:] in FMDatabase.o
"_sqlite3_column_name", referenced from:
-[FMResultSet setupColumnNames] in FMResultSet.o
-[FMResultSet kvcMagic:] in FMResultSet.o
(有27个,所以我不会全部粘贴;)
(there are 27 of them so i wont paste them all ;)
当我的项目是我的活动目标时,一切都很好,但是当我将目标设置为单元测试包并将所有.m文件添加到目标时,则出现这些错误.
Everything works fine when my project is my active target, but when i set the target to the unit test bundle and add all the .m files to the target, then i get these errors.
有人知道问题可能来自哪里吗?
Does anybody has any idea where the problem could come from ?
预先感谢,文森特.
推荐答案
您的单元测试目标需要包含sqlite3.c.
Your Unit Tests target needs to include sqlite3.c.
那应该解决它.
这篇关于Iphone单元测试:带有SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文