std::map 的单元测试
有谁知道我在哪里可以找到将测试 std::map
的单元测试?
我问的原因是因为我编写了一个类来替代 std::map
并且具有几乎所有相同的功能,因此对 std::map
进行单元测试> 也适合我的班级。
当然,我可以自己编写,但如果有人已经为此编写了广泛的测试,那么这将节省我很多时间,并有望涵盖我可能错过的东西。
谢谢。
Does anyone know where I can find unit tests that will test std::map
?
The reason I ask is because I have written a class that acts as a replacment for std::map
and has virtually all the same functionality, so unit tests for std::map
will be suitable for my class, too.
Of course, I can write my own, but if someone has already written extensive tests for this then that would save me a lot of time and would hopefully cover things that I might have missed.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
虽然我不知道独立使用它们需要多少,你可以看看 libstdc++' 测试套件。
While i don't know how much is needed to use them stand-alone, you could take a look at libstdc++' testsuite.
尝试在开源库实现中找到它,例如:
libstdc++
libc++
Try to find it in open source library implementations like:
libstdc++
libc++
Plauger 等人的The C++ Standard Template Library一书提供了示例代码STL 实现,带有所有类型的测试代码。我不知道代码是否可以在线使用。
The book The C++ Standard Template Library by Plauger et al provides code for a sample STL implementation, with test code for all types. I don't know from memory if the code is available on-line though.