Displaying 5 results from an estimated 5 matches for "iterationtest".
2008 Dec 27
0
[LLVMdev] [Patch] Adding unit tests to LLVM
...ecrement, or not have the code there (that's
commented out) at all.
* Instead of this:
EXPECT_TRUE(uintMap[0] == 1);
you should use EXPECT_EQ()
* Instead of this:
EXPECT_TRUE(uintMap.find(0u) == uintMap.begin());
is it possible to use EXPECT_EQ() as well?
* In this test:
TEST_F(DenseMapTest, IterationTest) {
you use the array "int numbers[100];" as an array of booleans; why not
make it "bool visited[100];" to make clear what it for, how it's used,
and maybe be slightly more efficient?
> 1) For the testing framework, I went with Google Test, since it's the one I
> h...
2008 Dec 23
6
[LLVMdev] [Patch] Adding unit tests to LLVM
(Forwarding this to llvm-dev)
This patch adds a unit test framework to LLVM, along with a sample unit test
for DenseMap. I don't expect this patch to be accepted as-is, this is mainly
a trial balloon and proof of concept.
Some notes about the patch:
1) For the testing framework, I went with Google Test, since it's the one I
have the most experience with. I fully expect an extended
2008 Dec 27
3
[LLVMdev] [Patch] Adding unit tests to LLVM
...mented out) at all.
>
> * Instead of this:
> EXPECT_TRUE(uintMap[0] == 1);
> you should use EXPECT_EQ()
>
> * Instead of this:
> EXPECT_TRUE(uintMap.find(0u) == uintMap.begin());
> is it possible to use EXPECT_EQ() as well?
>
> * In this test:
> TEST_F(DenseMapTest, IterationTest) {
> you use the array "int numbers[100];" as an array of booleans; why not
> make it "bool visited[100];" to make clear what it for, how it's used,
> and maybe be slightly more efficient?
>
> > 1) For the testing framework, I went with Google Test, since i...
2008 Dec 27
1
[LLVMdev] [Patch] Adding unit tests to LLVM
...though
you can make anything printable by adding the necessary stream operator
overloads. In this particular case, I decided that the printed
representation of an iterator wouldn't be meaningful, so I didn't bother
defining those overloads.
> * In this test:
> TEST_F(DenseMapTest, IterationTest) {
> you use the array "int numbers[100];" as an array of booleans; why not
> make it "bool visited[100];" to make clear what it for, how it's used,
> and maybe be slightly more efficient?
>
OK
>> 1) For the testing framework, I went with Google Test, si...
2008 Dec 27
0
[LLVMdev] [Patch] Adding unit tests to LLVM
...mented out) at all.
>
> * Instead of this:
> EXPECT_TRUE(uintMap[0] == 1);
> you should use EXPECT_EQ()
>
> * Instead of this:
> EXPECT_TRUE(uintMap.find(0u) == uintMap.begin());
> is it possible to use EXPECT_EQ() as well?
>
> * In this test:
> TEST_F(DenseMapTest, IterationTest) {
> you use the array "int numbers[100];" as an array of booleans; why not
> make it "bool visited[100];" to make clear what it for, how it's used,
> and maybe be slightly more efficient?
>
> > 1) For the testing framework, I went with Google Test, since i...