StringPool.cpp 809 B

12345678910111213141516171819202122232425262728293031
  1. //===- llvm/unittest/Support/StringPoiil.cpp - StringPool tests -----------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #include "llvm/Support/StringPool.h"
  10. #include "gtest/gtest.h"
  11. using namespace llvm;
  12. namespace {
  13. TEST(PooledStringPtrTest, OperatorEquals) {
  14. StringPool pool;
  15. const PooledStringPtr a = pool.intern("a");
  16. const PooledStringPtr b = pool.intern("b");
  17. EXPECT_FALSE(a == b);
  18. }
  19. TEST(PooledStringPtrTest, OperatorNotEquals) {
  20. StringPool pool;
  21. const PooledStringPtr a = pool.intern("a");
  22. const PooledStringPtr b = pool.intern("b");
  23. EXPECT_TRUE(a != b);
  24. }
  25. }