MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/lib/io/table_test.cc:550–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548class TableTest {};
549
550TEST(TableTest, ApproximateOffsetOfPlain) {
551 TableConstructor c;
552 c.Add("k01", "hello");
553 c.Add("k02", "hello2");
554 c.Add("k03", string(10000, 'x'));
555 c.Add("k04", string(200000, 'x'));
556 c.Add("k05", string(300000, 'x'));
557 c.Add("k06", "hello3");
558 c.Add("k07", string(100000, 'x'));
559 std::vector<string> keys;
560 KVMap kvmap;
561 Options options;
562 options.block_size = 1024;
563 options.compression = kNoCompression;
564 c.Finish(options, &keys, &kvmap);
565
566 ASSERT_TRUE(Between(c.ApproximateOffsetOf("abc"), 0, 0));
567 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k01"), 0, 0));
568 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k01a"), 0, 0));
569 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k02"), 0, 0));
570 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k03"), 10, 500));
571 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k04"), 10000, 11000));
572 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k04a"), 210000, 211000));
573 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k05"), 210000, 211000));
574 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k06"), 510000, 511000));
575 ASSERT_TRUE(Between(c.ApproximateOffsetOf("k07"), 510000, 511000));
576 ASSERT_TRUE(Between(c.ApproximateOffsetOf("xyz"), 610000, 612000));
577}
578
579static bool SnappyCompressionSupported() {
580 string out;

Callers

nothing calls this directly

Calls 9

BetweenFunction · 0.85
CompressibleStringFunction · 0.85
AddMethod · 0.45
FinishMethod · 0.45
ApproximateOffsetOfMethod · 0.45
NewIteratorMethod · 0.45
SeekMethod · 0.45
BytesReadMethod · 0.45

Tested by

no test coverage detected