self_msgproto 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/self_msgproto/message.cpp +2 -2
- data/lib/self_msgproto/version.rb +1 -1
- data/test/unit/test_message.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b41848085e3168bb4fcd9d40ec312c386bf6e0d21e6ad0514bd78e458e65e7eb
|
4
|
+
data.tar.gz: 293c5a942344da9edfe27f0d9b542c2d03a5037f117cb0ce69990c0e0e4e6550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d0e4d5ed89740b736a2944e5a5f4c29e50254bdcda810ada5ada42677fece84a5a423accd1a9a7d6ed5c3a9073551094c5997e37481215cd9885f2bd0acd584
|
7
|
+
data.tar.gz: 9146689eecc6e9b025c6fc7e85918608bd6d1fde76aa5b9b81e39254012c02cb8a3536bb1a9c41e32ddb0719fe083a3e2b457959d04e3f874d5fcdbf27bcbb74
|
@@ -105,8 +105,8 @@ VALUE message_to_fb(VALUE self)
|
|
105
105
|
VALUE message_type_v = rb_ivar_get(self, rb_intern("@message_type"));
|
106
106
|
|
107
107
|
if (message_type_v != Qnil) {
|
108
|
-
|
109
|
-
|
108
|
+
message_type_str = (u_char *)RSTRING_PTR(message_type_v);
|
109
|
+
message_type_len = RSTRING_LEN(message_type_v);
|
110
110
|
}
|
111
111
|
|
112
112
|
VALUE ciphertext_v = rb_ivar_get(self, rb_intern("@ciphertext"));
|
data/test/unit/test_message.rb
CHANGED
@@ -7,6 +7,32 @@ class TestMessage < Minitest::Test
|
|
7
7
|
include SelfMsg
|
8
8
|
|
9
9
|
def test_new_message
|
10
|
+
m = SelfMsg::Message.new
|
11
|
+
m.id = "id"
|
12
|
+
m.type = MsgTypeMSG
|
13
|
+
m.sender = "sender"
|
14
|
+
m.recipient = "recipient"
|
15
|
+
m.ciphertext = "ciphertext"
|
16
|
+
m.message_type = "message_type"
|
17
|
+
m.priority = 1
|
18
|
+
|
19
|
+
d = m.to_fb
|
20
|
+
p d
|
21
|
+
|
22
|
+
m = SelfMsg::Message.new(data: d)
|
23
|
+
|
24
|
+
p m.id
|
25
|
+
p m.type
|
26
|
+
p m.offset
|
27
|
+
p m.timestamp
|
28
|
+
p m.sender
|
29
|
+
p m.recipient
|
30
|
+
p m.ciphertext
|
31
|
+
p m.message_type
|
32
|
+
p m.priority
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_new_message_with_data
|
10
36
|
d = Base64.decode64('HAAAABgALAAoAAAAAAAkACAADAAcAAAACAAEABgAAAAoAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAGAAAACAAAAAoAAAAAAAAAAQAAAB0ZXN0BwAAAGFsaWNlOjEABgAAAHRlc3Q6MQAAJAAAADlhMGY2YzY5LTJiNmUtNGIwNi04NzFlLTBjNWJhYTkyYmM5NgAAAAA')
|
11
37
|
m = SelfMsg::Message.new(data: d)
|
12
38
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: self_msgproto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Bevan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|