MCPcopy Create free account
hub / github.com/OpenPrinting/goipp / TestMessageReset

Function TestMessageReset

message_test.go:507–536  ·  view source on GitHub ↗

TestMessageReset tests Message.Reset function

(t *testing.T)

Source from the content-addressed store, hash-verified

505
506// TestMessageReset tests Message.Reset function
507func TestMessageReset(t *testing.T) {
508 uri := "ipp://192/168.0.1/ipp/print"
509 m := Message{
510 Groups: Groups{
511 Group{
512 Tag: TagOperationGroup,
513 Attrs: Attributes{
514 MakeAttr("attributes-charset",
515 TagCharset, String("utf-8")),
516 MakeAttr("attributes-natural-language",
517 TagLanguage, String("en-US")),
518 MakeAttr("printer-uri",
519 TagURI, String(uri)),
520 },
521 },
522 Group{
523 Tag: TagJobGroup,
524 Attrs: Attributes{
525 MakeAttr("copies", TagInteger, Integer(1)),
526 },
527 },
528 },
529 }
530
531 m.Reset()
532
533 if !reflect.ValueOf(m).IsZero() {
534 t.Errorf("Message.Reset test failed")
535 }
536}
537
538// TestMessagePrint tests Message.Print function
539func TestMessagePrint(t *testing.T) {

Callers

nothing calls this directly

Calls 4

ResetMethod · 0.95
MakeAttrFunction · 0.85
StringTypeAlias · 0.85
IntegerTypeAlias · 0.85

Tested by

no test coverage detected