TestMessageReset tests Message.Reset function
(t *testing.T)
| 505 | |
| 506 | // TestMessageReset tests Message.Reset function |
| 507 | func 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 |
| 539 | func TestMessagePrint(t *testing.T) { |