Lines Matching refs:p1

32 	struct sshbuf *p1, *p2, *p3;  in sshbuf_fixed()  local
39 p1 = sshbuf_from(test_buf, sizeof(test_buf)); in sshbuf_fixed()
40 ASSERT_PTR_NE(p1, NULL); in sshbuf_fixed()
41 ASSERT_PTR_EQ(sshbuf_mutable_ptr(p1), NULL); in sshbuf_fixed()
42 ASSERT_INT_EQ(sshbuf_check_reserve(p1, 1), SSH_ERR_BUFFER_READ_ONLY); in sshbuf_fixed()
43 ASSERT_INT_EQ(sshbuf_reserve(p1, 1, NULL), SSH_ERR_BUFFER_READ_ONLY); in sshbuf_fixed()
44 ASSERT_INT_EQ(sshbuf_set_max_size(p1, 200), SSH_ERR_BUFFER_READ_ONLY); in sshbuf_fixed()
45 ASSERT_INT_EQ(sshbuf_put_u32(p1, 0x12345678), SSH_ERR_BUFFER_READ_ONLY); in sshbuf_fixed()
46 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), 0); in sshbuf_fixed()
47 ASSERT_PTR_EQ(sshbuf_ptr(p1), test_buf); in sshbuf_fixed()
48 sshbuf_free(p1); in sshbuf_fixed()
52 p1 = sshbuf_from(test_buf, sizeof(test_buf) - 1); in sshbuf_fixed()
53 ASSERT_PTR_NE(p1, NULL); in sshbuf_fixed()
54 ASSERT_PTR_EQ(sshbuf_ptr(p1), test_buf); in sshbuf_fixed()
55 ASSERT_INT_EQ(sshbuf_get_u8(p1, &c), 0); in sshbuf_fixed()
56 ASSERT_PTR_EQ(sshbuf_ptr(p1), test_buf + 1); in sshbuf_fixed()
58 ASSERT_INT_EQ(sshbuf_get_u32(p1, &i), 0); in sshbuf_fixed()
59 ASSERT_PTR_EQ(sshbuf_ptr(p1), test_buf + 5); in sshbuf_fixed()
61 ASSERT_INT_EQ(sshbuf_get_cstring(p1, &s, &l), 0); in sshbuf_fixed()
62 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_fixed()
65 sshbuf_free(p1); in sshbuf_fixed()
70 p1 = sshbuf_new(); in sshbuf_fixed()
71 ASSERT_PTR_NE(p1, NULL); in sshbuf_fixed()
72 ASSERT_U_INT_EQ(sshbuf_refcount(p1), 1); in sshbuf_fixed()
73 ASSERT_PTR_EQ(sshbuf_parent(p1), NULL); in sshbuf_fixed()
74 ASSERT_INT_EQ(sshbuf_put(p1, test_buf, sizeof(test_buf) - 1), 0); in sshbuf_fixed()
75 p2 = sshbuf_fromb(p1); in sshbuf_fixed()
77 ASSERT_U_INT_EQ(sshbuf_refcount(p1), 2); in sshbuf_fixed()
78 ASSERT_PTR_EQ(sshbuf_parent(p1), NULL); in sshbuf_fixed()
79 ASSERT_PTR_EQ(sshbuf_parent(p2), p1); in sshbuf_fixed()
80 ASSERT_PTR_EQ(sshbuf_ptr(p2), sshbuf_ptr(p1)); in sshbuf_fixed()
81 ASSERT_PTR_NE(sshbuf_ptr(p1), NULL); in sshbuf_fixed()
83 ASSERT_PTR_EQ(sshbuf_mutable_ptr(p1), NULL); in sshbuf_fixed()
85 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sshbuf_len(p2)); in sshbuf_fixed()
87 ASSERT_PTR_EQ(sshbuf_ptr(p2), sshbuf_ptr(p1) + 1); in sshbuf_fixed()
90 ASSERT_PTR_EQ(sshbuf_ptr(p2), sshbuf_ptr(p1) + 5); in sshbuf_fixed()
96 sshbuf_free(p1); in sshbuf_fixed()
97 ASSERT_U_INT_EQ(sshbuf_refcount(p1), 1); in sshbuf_fixed()
103 p1 = sshbuf_new(); in sshbuf_fixed()
104 ASSERT_PTR_NE(p1, NULL); in sshbuf_fixed()
105 ASSERT_INT_EQ(sshbuf_put_u8(p1, 0x01), 0); in sshbuf_fixed()
106 ASSERT_INT_EQ(sshbuf_put_u32(p1, 0x12345678), 0); in sshbuf_fixed()
107 ASSERT_INT_EQ(sshbuf_put_cstring(p1, "hello"), 0); in sshbuf_fixed()
110 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sizeof(test_buf) - 1); in sshbuf_fixed()
111 ASSERT_INT_EQ(sshbuf_put_stringb(p2, p1), 0); in sshbuf_fixed()
120 ASSERT_INT_EQ(sshbuf_put_stringb(p2, p1), 0); in sshbuf_fixed()
125 sshbuf_free(p1); in sshbuf_fixed()