◆ errorHasType()
void io.flutter.plugin.common.StandardMessageCodecTest.errorHasType |
( |
| ) |
|
|
inline |
Definition at line 136 of file StandardMessageCodecTest.java.
136 {
137 StandardMessageCodec codec = new StandardMessageCodec();
138 NotEncodable notEncodable = new NotEncodable();
139 Exception exception =
140 assertThrows(
141 IllegalArgumentException.class,
142 () -> {
143 codec.encodeMessage(notEncodable);
144 });
145 assertTrue(exception.getMessage().contains("NotEncodable"));
146 }
◆ itEncodesBooleans()
void io.flutter.plugin.common.StandardMessageCodecTest.itEncodesBooleans |
( |
| ) |
|
|
inline |
Definition at line 86 of file StandardMessageCodecTest.java.
86 {
87
88 StandardMessageCodec codec = new StandardMessageCodec();
89
90 ArrayList<Object> messageContent = new ArrayList();
91
92 messageContent.add(new Boolean(true));
93 messageContent.add(new Boolean(false));
94 ByteBuffer
message = codec.encodeMessage(messageContent);
96 ByteBuffer expected = ByteBuffer.allocateDirect(4);
97 expected.put(new byte[] {LIST, 2, TRUE, FALSE});
98 expected.flip();
99 assertEquals(expected,
message);
100 }
◆ itEncodesCharSequences()
void io.flutter.plugin.common.StandardMessageCodecTest.itEncodesCharSequences |
( |
| ) |
|
|
inline |
Definition at line 116 of file StandardMessageCodecTest.java.
116 {
117 StandardMessageCodec codec = new StandardMessageCodec();
118
119 CharSequence cs = new SpannableString("hello world");
120
121 ByteBuffer
message = codec.encodeMessage(cs);
123
125 assertEquals(
value,
"hello world");
126 }
◆ itEncodesFloatArrays()
void io.flutter.plugin.common.StandardMessageCodecTest.itEncodesFloatArrays |
( |
| ) |
|
|
inline |
Definition at line 103 of file StandardMessageCodecTest.java.
103 {
104 StandardMessageCodec codec = new StandardMessageCodec();
105
106 float[] expectedValues = new float[] {1.0f, 2.2f, 5.3f};
107
108 ByteBuffer
message = codec.encodeMessage(expectedValues);
110
112 assertArrayEquals(expectedValues,
values, 0.01
f);
113 }
◆ itEncodesNullLiterals()
void io.flutter.plugin.common.StandardMessageCodecTest.itEncodesNullLiterals |
( |
| ) |
|
|
inline |
Definition at line 38 of file StandardMessageCodecTest.java.
38 {
39
40 StandardMessageCodec codec = new StandardMessageCodec();
41
42
43
44
45 ArrayList<Object> messageContent = new ArrayList();
46 messageContent.add(null);
47 ByteBuffer
message = codec.encodeMessage(messageContent);
49 ByteBuffer expected = ByteBuffer.allocateDirect(3);
50 expected.put(new byte[] {LIST, 1, NULL});
51 expected.flip();
52 assertEquals(expected,
message);
53 }
◆ itEncodesNullObjects()
void io.flutter.plugin.common.StandardMessageCodecTest.itEncodesNullObjects |
( |
| ) |
|
|
inline |
Definition at line 56 of file StandardMessageCodecTest.java.
56 {
57
58 class ExampleNullObject {
59 @Override
60 public boolean equals(Object other) {
61 return other == null || other == this;
62 }
63
64 @Override
65 public int hashCode() {
66 return 0;
67 }
68 }
69
70
71 StandardMessageCodec codec = new StandardMessageCodec();
72
73
74 ArrayList<Object> messageContent = new ArrayList();
75 messageContent.add(new ExampleNullObject());
76 ByteBuffer
message = codec.encodeMessage(messageContent);
78 ByteBuffer expected = ByteBuffer.allocateDirect(3);
79 expected.put(new byte[] {LIST, 1, NULL});
80 expected.flip();
81 assertEquals(expected,
message);
82 }
bool equals(SkDrawable *a, SkDrawable *b)
The documentation for this class was generated from the following file: