MCPcopy Create free account
hub / github.com/distributedio/titan / TestStringSetBit

Function TestStringSetBit

db/string_test.go:566–640  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

564}
565
566func TestStringSetBit(t *testing.T) {
567 type args struct {
568 on int
569 off int
570 }
571 type want struct {
572 retval int
573 value []byte
574 }
575 tests := []struct {
576 name string
577 args args
578 want want
579 }{
580 {
581 name: "one",
582 args: args{
583 off: 1,
584 on: 1,
585 },
586 want: want{
587 retval: 0,
588 value: []byte{0x40},
589 },
590 },
591 {
592 name: "two",
593 args: args{
594 off: 5,
595 on: 1,
596 },
597 want: want{
598 retval: 0,
599 value: []byte{0x44},
600 },
601 },
602 {
603 name: "three",
604 args: args{
605 off: 5,
606 on: 0,
607 },
608 want: want{
609 retval: 0x4,
610 value: []byte{0x40},
611 },
612 },
613 {
614 name: "four",
615 args: args{
616 off: 12,
617 on: 1,
618 },
619 want: want{
620 retval: 0,
621 value: []byte{0x40, 0x08},
622 },
623 },

Callers

nothing calls this directly

Calls 4

GetStringFunction · 0.85
MockTestFunction · 0.85
getValueFunction · 0.85
SetBitMethod · 0.80

Tested by

no test coverage detected