Lines Matching defs:p1

31 	struct sshbuf *p1, *p2, *p3;
38 p1 = sshbuf_from(test_buf, sizeof(test_buf));
39 ASSERT_PTR_NE(p1, NULL);
40 ASSERT_PTR_EQ(sshbuf_mutable_ptr(p1), NULL);
41 ASSERT_INT_EQ(sshbuf_check_reserve(p1, 1), SSH_ERR_BUFFER_READ_ONLY);
42 ASSERT_INT_EQ(sshbuf_reserve(p1, 1, NULL), SSH_ERR_BUFFER_READ_ONLY);
43 ASSERT_INT_EQ(sshbuf_set_max_size(p1, 200), SSH_ERR_BUFFER_READ_ONLY);
44 ASSERT_INT_EQ(sshbuf_put_u32(p1, 0x12345678), SSH_ERR_BUFFER_READ_ONLY);
45 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), 0);
46 ASSERT_PTR_EQ(sshbuf_ptr(p1), test_buf);
47 sshbuf_free(p1);
51 p1 = sshbuf_from(test_buf, sizeof(test_buf) - 1);
52 ASSERT_PTR_NE(p1, NULL);
53 ASSERT_PTR_EQ(sshbuf_ptr(p1), test_buf);
54 ASSERT_INT_EQ(sshbuf_get_u8(p1, &c), 0);
55 ASSERT_PTR_EQ(sshbuf_ptr(p1), test_buf + 1);
57 ASSERT_INT_EQ(sshbuf_get_u32(p1, &i), 0);
58 ASSERT_PTR_EQ(sshbuf_ptr(p1), test_buf + 5);
60 ASSERT_INT_EQ(sshbuf_get_cstring(p1, &s, &l), 0);
61 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0);
64 sshbuf_free(p1);
69 p1 = sshbuf_new();
70 ASSERT_PTR_NE(p1, NULL);
71 ASSERT_U_INT_EQ(sshbuf_refcount(p1), 1);
72 ASSERT_PTR_EQ(sshbuf_parent(p1), NULL);
73 ASSERT_INT_EQ(sshbuf_put(p1, test_buf, sizeof(test_buf) - 1), 0);
74 p2 = sshbuf_fromb(p1);
76 ASSERT_U_INT_EQ(sshbuf_refcount(p1), 2);
77 ASSERT_PTR_EQ(sshbuf_parent(p1), NULL);
78 ASSERT_PTR_EQ(sshbuf_parent(p2), p1);
79 ASSERT_PTR_EQ(sshbuf_ptr(p2), sshbuf_ptr(p1));
80 ASSERT_PTR_NE(sshbuf_ptr(p1), NULL);
82 ASSERT_PTR_EQ(sshbuf_mutable_ptr(p1), NULL);
84 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sshbuf_len(p2));
86 ASSERT_PTR_EQ(sshbuf_ptr(p2), sshbuf_ptr(p1) + 1);
89 ASSERT_PTR_EQ(sshbuf_ptr(p2), sshbuf_ptr(p1) + 5);
95 sshbuf_free(p1);
96 ASSERT_U_INT_EQ(sshbuf_refcount(p1), 1);
102 p1 = sshbuf_new();
103 ASSERT_PTR_NE(p1, NULL);
104 ASSERT_INT_EQ(sshbuf_put_u8(p1, 0x01), 0);
105 ASSERT_INT_EQ(sshbuf_put_u32(p1, 0x12345678), 0);
106 ASSERT_INT_EQ(sshbuf_put_cstring(p1, "hello"), 0);
109 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sizeof(test_buf) - 1);
110 ASSERT_INT_EQ(sshbuf_put_stringb(p2, p1), 0);
119 ASSERT_INT_EQ(sshbuf_put_stringb(p2, p1), 0);
124 sshbuf_free(p1);