add test_Ref.cc
This commit is contained in:
parent
1d049b5f27
commit
29520933f7
24
test/src/test_Ref.cc
Normal file
24
test/src/test_Ref.cc
Normal file
@ -0,0 +1,24 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "jes/Ref.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace jes;
|
||||
|
||||
class Foo
|
||||
{
|
||||
};
|
||||
typedef Ref<Foo> FooRef;
|
||||
|
||||
TEST(RefTest, checking_for_null)
|
||||
{
|
||||
FooRef f = NULL;
|
||||
FooRef f2 = new Foo();
|
||||
|
||||
EXPECT_TRUE(f == NULL);
|
||||
EXPECT_TRUE(f.is_null());
|
||||
EXPECT_FALSE(f != NULL);
|
||||
|
||||
EXPECT_FALSE(f2 == NULL);
|
||||
EXPECT_FALSE(f2.is_null());
|
||||
EXPECT_TRUE(f2 != NULL);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user