MCPcopy Create free account
hub / github.com/Singular/Singular / test_enterid

Method test_enterid

tests/Singular/test_ipid.cpp:57–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void IpIdTest::test_enterid() {
58 double fStart;
59 double fEnd;
60
61 idhdl start;
62 idhdl rh;
63 std::cout<<"enterid\n";
64 printf("Base: %p\n", basePack);
65
66 std::cout<<"enterid\n";
67 std::cout<<"enterid\n";
68 fStart = Time();
69 int nMax = 10000;
70 for(int i=0; i<nMax; i++) {
71 char s[64];
72 snprintf(s, sizeof(s), "dummy%06d", i);
73 rh = enterid(s, 0, INT_CMD, &IDROOT, TRUE);
74 CPPUNIT_ASSERT_EQUAL(rh, ggetid(s));
75 }
76 fEnd = Time();
77 printf("Find sizeof enterid Time: for %d : %f\n", nMax, fEnd-fStart);
78
79 fStart = Time();
80 for(int i=0; i<nMax; i++) {
81 char s[64];
82 snprintf(s, sizeof(s), "ZDummy%06d", i);
83 rh = enterid(s, 0, INT_CMD, &IDROOT, TRUE);
84 CPPUNIT_ASSERT_EQUAL(rh, ggetid(s));
85 //snprintf(s, sizeof(s), "dummy%06d", i);
86 killid(s, &IDROOT);
87 CPPUNIT_ASSERT_EQUAL((idhdl)0, ggetid(s));
88 }
89 fEnd = Time();
90 printf("Find sizeof enterid and killid Time: for %d : %f\n", nMax, fEnd-fStart);
91
92#if 0
93 idhdl h=IDROOT;//_basePack->idroot;
94 start=h;
95 while (h!=NULL)
96 {
97 std::cout<<"Name: "<<h->id<<std::endl;
98
99 h = IDNEXT(h);
100 }
101#endif
102}
103
104void IpIdTest::test_killid() {
105}

Callers

nothing calls this directly

Calls 4

TimeFunction · 0.85
enteridFunction · 0.85
ggetidFunction · 0.85
killidFunction · 0.85

Tested by

no test coverage detected