int main() {
  CHECK_EQ(false, testSingle(0));
  CHECK_EQ(false, testMultiple(0));
  CHECK_EQ(false, testVirtual(0));
  CHECK_EQ(false, testUnspecified(0));

  CHECK_EQ(true, testSingle(&Single::foo));
  CHECK_EQ(true, testMultiple(&Multiple::foo));
  CHECK_EQ(true, testVirtual(&Virtual::foo));
  CHECK_EQ(true, testUnspecified(&Unspecified::foo));

  // We only need to test the method pointer (slot 0) to know if the memptr is
  // non-null.  Full equality requires more comparisons.
  CHECK_EQ(false, testUnspecified(g_unspecified_memptr));
}
Ejemplo n.º 2
0
        void test()
        {
            std::vector<int> a{ 1,2,3,7,4,5 };
            std::vector<int> b{ 6,3,2,7,9,1 };
            std::set<int> combined;
            combined.insert(a.begin(), a.end());
            combined.insert(b.begin(), b.end());

            iprintf("%s, %d", "hello world", 5);

            std::string t;
            testMove(t);
            iprintf("%s", t.c_str());

            testCeil();

            uint64_t i1 = 11;
            printf("result: %12I64X\n", i1);

            
            std::vector<std::shared_ptr<int>> sss;
            sss.emplace_back(new int(40));

            auto p = std::move(sss[0]);
            assert(sss[0] == nullptr);
            assert(p != nullptr);
            printAndRemove(std::move(p));
 
            uint64_t x = 0;
            uint64_t y = 18446744072645148502;
            std::cout << "x-y:" << x - y << std::endl;

            testVirtual();

            std::map<int, SegmentBlob> blobs;
            blobs[1] = SegmentBlob{ 1, 2 };

            std::vector<SegmentBlob> tttttt;
            tttttt.emplace_back(SegmentBlob{ 1,3 });

            static const uint32_t t_num = *((const uint32_t*)("abcd"));
            printf("hello. %d\n", t_num);

            printf("%d\n", sizeof(PredefinedSegmentTag) / sizeof(SegmentTag));

            return;
        }