[vte] parser: Parse subparameters in CSI sequences
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] parser: Parse subparameters in CSI sequences
- Date: Tue, 27 Mar 2018 17:41:52 +0000 (UTC)
commit 45561b86c5855a3a2c17582b033ef1aace20f2fb
Author: Christian Persch <chpe src gnome org>
Date: Tue Mar 27 19:40:12 2018 +0200
parser: Parse subparameters in CSI sequences
This is used in SGR.
src/parser-test.cc | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/parser-test.cc b/src/parser-test.cc
index eebfa42..649fd4e 100644
--- a/src/parser-test.cc
+++ b/src/parser-test.cc
@@ -172,7 +172,7 @@ public:
void set_params(vte_seq_arg_t params[16])
{
for (unsigned int i = 0; i < 16; i++)
- m_seq.args[i] = vte_seq_arg_init(params[i]);
+ m_seq.args[i] = vte_seq_arg_init(std::min(params[i], 0xffff));
}
void set_n_params(unsigned int n)
@@ -224,7 +224,7 @@ vte_seq_builder::to_string(std::u32string& s,
s.push_back(m_p);
auto n_args = m_seq.n_args;
for (unsigned int n = 0; n < n_args; n++) {
- auto arg = m_seq.args[n];
+ auto arg = vte_seq_arg_value(m_seq.args[n]);
if (n > 0)
s.push_back(0x3B); // semicolon
if (arg >= 0) {
@@ -268,10 +268,12 @@ vte_seq_builder::assert_equal_full(struct vte_seq* seq)
/* We may get one arg less back, if it's at default */
if (m_seq.n_args != seq->n_args) {
g_assert_cmpuint(m_seq.n_args, ==, seq->n_args + 1);
- g_assert_cmpuint(m_seq.args[m_seq.n_args - 1], ==, -1);
+ g_assert_cmpint(vte_seq_arg_value(m_seq.args[m_seq.n_args - 1]), ==, -1);
}
for (unsigned int n = 0; n < seq->n_args; n++)
- g_assert_cmpint(std::min(m_seq.args[n], 0xffff), ==, vte_seq_arg_value(seq->args[n]));
+ g_assert_cmpint(vte_seq_arg_value(m_seq.args[n]),
+ ==,
+ vte_seq_arg_value(seq->args[n]));
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]