Flutter Engine
fl_value_test.cc File Reference
#include "flutter/shell/platform/linux/public/flutter_linux/fl_value.h"
#include <gmodule.h>
#include "gtest/gtest.h"

Go to the source code of this file.

Functions

 TEST (FlDartProjectTest, Null)
 
 TEST (FlValueTest, NullEqual)
 
 TEST (FlValueTest, NullToString)
 
 TEST (FlValueTest, BoolTrue)
 
 TEST (FlValueTest, BoolFalse)
 
 TEST (FlValueTest, BoolEqual)
 
 TEST (FlValueTest, BoolNotEqual)
 
 TEST (FlValueTest, BoolTrueToString)
 
 TEST (FlValueTest, BoolFalseToString)
 
 TEST (FlValueTest, IntZero)
 
 TEST (FlValueTest, IntOne)
 
 TEST (FlValueTest, IntMinusOne)
 
 TEST (FlValueTest, IntMin)
 
 TEST (FlValueTest, IntMax)
 
 TEST (FlValueTest, IntEqual)
 
 TEST (FlValueTest, IntNotEqual)
 
 TEST (FlValueTest, IntToString)
 
 TEST (FlValueTest, FloatZero)
 
 TEST (FlValueTest, FloatOne)
 
 TEST (FlValueTest, FloatMinusOne)
 
 TEST (FlValueTest, FloatPi)
 
 TEST (FlValueTest, FloatEqual)
 
 TEST (FlValueTest, FloatNotEqual)
 
 TEST (FlValueTest, FloatToString)
 
 TEST (FlValueTest, String)
 
 TEST (FlValueTest, StringEmpty)
 
 TEST (FlValueTest, StringSized)
 
 TEST (FlValueTest, StringSizedNullptr)
 
 TEST (FlValueTest, StringSizedZeroLength)
 
 TEST (FlValueTest, StringEqual)
 
 TEST (FlValueTest, StringNotEqual)
 
 TEST (FlValueTest, StringToString)
 
 TEST (FlValueTest, Uint8List)
 
 TEST (FlValueTest, Uint8ListNullptr)
 
 TEST (FlValueTest, Uint8ListEqual)
 
 TEST (FlValueTest, Uint8ListEmptyEqual)
 
 TEST (FlValueTest, Uint8ListNotEqualSameSize)
 
 TEST (FlValueTest, Uint8ListNotEqualDifferentSize)
 
 TEST (FlValueTest, Uint8ListEmptyNotEqual)
 
 TEST (FlValueTest, Uint8ListToString)
 
 TEST (FlValueTest, Int32List)
 
 TEST (FlValueTest, Int32ListNullptr)
 
 TEST (FlValueTest, Int32ListEqual)
 
 TEST (FlValueTest, Int32ListEmptyEqual)
 
 TEST (FlValueTest, Int32ListNotEqualSameSize)
 
 TEST (FlValueTest, Int32ListNotEqualDifferentSize)
 
 TEST (FlValueTest, Int32ListEmptyNotEqual)
 
 TEST (FlValueTest, Int32ListToString)
 
 TEST (FlValueTest, Int64List)
 
 TEST (FlValueTest, Int64ListNullptr)
 
 TEST (FlValueTest, Int64ListEqual)
 
 TEST (FlValueTest, Int64ListEmptyEqual)
 
 TEST (FlValueTest, Int64ListNotEqualSameSize)
 
 TEST (FlValueTest, Int64ListNotEqualDifferentSize)
 
 TEST (FlValueTest, Int64ListEmptyNotEqual)
 
 TEST (FlValueTest, Int64ListToString)
 
 TEST (FlValueTest, FloatList)
 
 TEST (FlValueTest, FloatListNullptr)
 
 TEST (FlValueTest, FloatListEqual)
 
 TEST (FlValueTest, FloatListEmptyEqual)
 
 TEST (FlValueTest, FloatListNotEqualSameSize)
 
 TEST (FlValueTest, FloatListNotEqualDifferentSize)
 
 TEST (FlValueTest, FloatListEmptyNotEqual)
 
 TEST (FlValueTest, FloatListToString)
 
 TEST (FlValueTest, ListEmpty)
 
 TEST (FlValueTest, ListAdd)
 
 TEST (FlValueTest, ListAddTake)
 
 TEST (FlValueTest, ListChildTypes)
 
 TEST (FlValueTest, ListStrv)
 
 TEST (FlValueTest, ListStrvEmpty)
 
 TEST (FlValueTest, ListEqual)
 
 TEST (FlValueTest, ListEmptyEqual)
 
 TEST (FlValueTest, ListNotEqualSameSize)
 
 TEST (FlValueTest, ListNotEqualDifferentSize)
 
 TEST (FlValueTest, ListEmptyNotEqual)
 
 TEST (FlValueTest, ListToString)
 
 TEST (FlValueTest, MapEmpty)
 
 TEST (FlValueTest, MapSet)
 
 TEST (FlValueTest, MapSetTake)
 
 TEST (FlValueTest, MapSetString)
 
 TEST (FlValueTest, MapSetStringTake)
 
 TEST (FlValueTest, MapLookup)
 
 TEST (FlValueTest, MapLookupString)
 
 TEST (FlValueTest, MapValueypes)
 
 TEST (FlValueTest, MapKeyTypes)
 
 TEST (FlValueTest, MapEqual)
 
 TEST (FlValueTest, MapEqualDifferentOrder)
 
 TEST (FlValueTest, MapEmptyEqual)
 
 TEST (FlValueTest, MapNotEqualSameSizeDifferentKeys)
 
 TEST (FlValueTest, MapNotEqualSameSizeDifferentValues)
 
 TEST (FlValueTest, MapNotEqualDifferentSize)
 
 TEST (FlValueTest, MapEmptyNotEqual)
 
 TEST (FlValueTest, MapToString)
 
 TEST (FlValueTest, EqualSameObject)
 
 TEST (FlValueTest, NullIntNotEqual)
 
 TEST (FlValueTest, NullBoolNotEqual)
 
 TEST (FlValueTest, StringUint8ListNotEqual)
 
 TEST (FlValueTest, Uint8ListInt32ListNotEqual)
 
 TEST (FlValueTest, Int32ListInt64ListNotEqual)
 
 TEST (FlValueTest, Int64ListFloatListNotEqual)
 
 TEST (FlValueTest, ListMapNotEqual)
 

Function Documentation

◆ TEST() [1/101]

TEST ( FlDartProjectTest  ,
Null   
)

Definition at line 11 of file fl_value_test.cc.

References fl_value_get_type(), fl_value_new_null(), FL_VALUE_TYPE_NULL, and value.

11  {
12  g_autoptr(FlValue) value = fl_value_new_null();
14 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [2/101]

TEST ( FlValueTest  ,
NullEqual   
)

Definition at line 16 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_null().

16  {
17  g_autoptr(FlValue) value1 = fl_value_new_null();
18  g_autoptr(FlValue) value2 = fl_value_new_null();
19  EXPECT_TRUE(fl_value_equal(value1, value2));
20 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [3/101]

TEST ( FlValueTest  ,
NullToString   
)

Definition at line 22 of file fl_value_test.cc.

References fl_value_new_null(), fl_value_to_string(), and value.

22  {
23  g_autoptr(FlValue) value = fl_value_new_null();
24  g_autofree gchar* text = fl_value_to_string(value);
25  EXPECT_STREQ(text, "null");
26 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [4/101]

TEST ( FlValueTest  ,
BoolTrue   
)

Definition at line 28 of file fl_value_test.cc.

References fl_value_get_bool(), fl_value_get_type(), fl_value_new_bool(), FL_VALUE_TYPE_BOOL, TRUE, and value.

28  {
29  g_autoptr(FlValue) value = fl_value_new_bool(TRUE);
31  EXPECT_TRUE(fl_value_get_bool(value));
32 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
uint8_t value
return TRUE
Definition: fl_view.cc:107
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
Definition: fl_value.cc:575

◆ TEST() [5/101]

TEST ( FlValueTest  ,
BoolFalse   
)

Definition at line 34 of file fl_value_test.cc.

References fl_value_get_bool(), fl_value_get_type(), fl_value_new_bool(), FL_VALUE_TYPE_BOOL, and value.

34  {
35  g_autoptr(FlValue) value = fl_value_new_bool(FALSE);
37  EXPECT_FALSE(fl_value_get_bool(value));
38 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
uint8_t value
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
Definition: fl_value.cc:575

◆ TEST() [6/101]

TEST ( FlValueTest  ,
BoolEqual   
)

Definition at line 40 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_bool(), and TRUE.

40  {
41  g_autoptr(FlValue) value1 = fl_value_new_bool(TRUE);
42  g_autoptr(FlValue) value2 = fl_value_new_bool(TRUE);
43  EXPECT_TRUE(fl_value_equal(value1, value2));
44 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
return TRUE
Definition: fl_view.cc:107

◆ TEST() [7/101]

TEST ( FlValueTest  ,
BoolNotEqual   
)

Definition at line 46 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_bool(), and TRUE.

46  {
47  g_autoptr(FlValue) value1 = fl_value_new_bool(TRUE);
48  g_autoptr(FlValue) value2 = fl_value_new_bool(FALSE);
49  EXPECT_FALSE(fl_value_equal(value1, value2));
50 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
return TRUE
Definition: fl_view.cc:107

◆ TEST() [8/101]

TEST ( FlValueTest  ,
BoolTrueToString   
)

Definition at line 52 of file fl_value_test.cc.

References fl_value_new_bool(), fl_value_to_string(), TRUE, and value.

52  {
53  g_autoptr(FlValue) value = fl_value_new_bool(TRUE);
54  g_autofree gchar* text = fl_value_to_string(value);
55  EXPECT_STREQ(text, "true");
56 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723
return TRUE
Definition: fl_view.cc:107

◆ TEST() [9/101]

TEST ( FlValueTest  ,
BoolFalseToString   
)

Definition at line 58 of file fl_value_test.cc.

References fl_value_new_bool(), fl_value_to_string(), and value.

58  {
59  g_autoptr(FlValue) value = fl_value_new_bool(FALSE);
60  g_autofree gchar* text = fl_value_to_string(value);
61  EXPECT_STREQ(text, "false");
62 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723

◆ TEST() [10/101]

TEST ( FlValueTest  ,
IntZero   
)

Definition at line 64 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

64  {
65  g_autoptr(FlValue) value = fl_value_new_int(0);
67  EXPECT_EQ(fl_value_get_int(value), 0);
68 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [11/101]

TEST ( FlValueTest  ,
IntOne   
)

Definition at line 70 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

70  {
71  g_autoptr(FlValue) value = fl_value_new_int(1);
73  EXPECT_EQ(fl_value_get_int(value), 1);
74 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [12/101]

TEST ( FlValueTest  ,
IntMinusOne   
)

Definition at line 76 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

76  {
77  g_autoptr(FlValue) value = fl_value_new_int(-1);
79  EXPECT_EQ(fl_value_get_int(value), -1);
80 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [13/101]

TEST ( FlValueTest  ,
IntMin   
)

Definition at line 82 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

82  {
83  g_autoptr(FlValue) value = fl_value_new_int(G_MININT64);
85  EXPECT_EQ(fl_value_get_int(value), G_MININT64);
86 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [14/101]

TEST ( FlValueTest  ,
IntMax   
)

Definition at line 88 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_type(), fl_value_new_int(), FL_VALUE_TYPE_INT, and value.

88  {
89  g_autoptr(FlValue) value = fl_value_new_int(G_MAXINT64);
91  EXPECT_EQ(fl_value_get_int(value), G_MAXINT64);
92 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [15/101]

TEST ( FlValueTest  ,
IntEqual   
)

Definition at line 94 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int().

94  {
95  g_autoptr(FlValue) value1 = fl_value_new_int(42);
96  g_autoptr(FlValue) value2 = fl_value_new_int(42);
97  EXPECT_TRUE(fl_value_equal(value1, value2));
98 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [16/101]

TEST ( FlValueTest  ,
IntNotEqual   
)

Definition at line 100 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int().

100  {
101  g_autoptr(FlValue) value1 = fl_value_new_int(42);
102  g_autoptr(FlValue) value2 = fl_value_new_int(99);
103  EXPECT_FALSE(fl_value_equal(value1, value2));
104 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [17/101]

TEST ( FlValueTest  ,
IntToString   
)

Definition at line 106 of file fl_value_test.cc.

References fl_value_new_int(), fl_value_to_string(), and value.

106  {
107  g_autoptr(FlValue) value = fl_value_new_int(42);
108  g_autofree gchar* text = fl_value_to_string(value);
109  EXPECT_STREQ(text, "42");
110 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723

◆ TEST() [18/101]

TEST ( FlValueTest  ,
FloatZero   
)

Definition at line 112 of file fl_value_test.cc.

References fl_value_get_float(), fl_value_get_type(), fl_value_new_float(), FL_VALUE_TYPE_FLOAT, and value.

112  {
113  g_autoptr(FlValue) value = fl_value_new_float(0.0);
115  EXPECT_EQ(fl_value_get_float(value), 0.0);
116 }
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:589
uint8_t value

◆ TEST() [19/101]

TEST ( FlValueTest  ,
FloatOne   
)

Definition at line 118 of file fl_value_test.cc.

References fl_value_get_float(), fl_value_get_type(), fl_value_new_float(), FL_VALUE_TYPE_FLOAT, and value.

118  {
119  g_autoptr(FlValue) value = fl_value_new_float(1.0);
121  EXPECT_EQ(fl_value_get_float(value), 1.0);
122 }
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:589
uint8_t value

◆ TEST() [20/101]

TEST ( FlValueTest  ,
FloatMinusOne   
)

Definition at line 124 of file fl_value_test.cc.

References fl_value_get_float(), fl_value_get_type(), fl_value_new_float(), FL_VALUE_TYPE_FLOAT, and value.

124  {
125  g_autoptr(FlValue) value = fl_value_new_float(-1.0);
127  EXPECT_EQ(fl_value_get_float(value), -1.0);
128 }
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:589
uint8_t value

◆ TEST() [21/101]

TEST ( FlValueTest  ,
FloatPi   
)

Definition at line 130 of file fl_value_test.cc.

References fl_value_get_float(), fl_value_get_type(), fl_value_new_float(), FL_VALUE_TYPE_FLOAT, and value.

130  {
131  g_autoptr(FlValue) value = fl_value_new_float(M_PI);
133  EXPECT_EQ(fl_value_get_float(value), M_PI);
134 }
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:589
uint8_t value

◆ TEST() [22/101]

TEST ( FlValueTest  ,
FloatEqual   
)

Definition at line 136 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_float().

136  {
137  g_autoptr(FlValue) value1 = fl_value_new_float(M_PI);
138  g_autoptr(FlValue) value2 = fl_value_new_float(M_PI);
139  EXPECT_TRUE(fl_value_equal(value1, value2));
140 }
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [23/101]

TEST ( FlValueTest  ,
FloatNotEqual   
)

Definition at line 142 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_float().

142  {
143  g_autoptr(FlValue) value1 = fl_value_new_float(M_PI);
144  g_autoptr(FlValue) value2 = fl_value_new_float(M_E);
145  EXPECT_FALSE(fl_value_equal(value1, value2));
146 }
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [24/101]

TEST ( FlValueTest  ,
FloatToString   
)

Definition at line 148 of file fl_value_test.cc.

References fl_value_new_float(), fl_value_to_string(), and value.

148  {
149  g_autoptr(FlValue) value = fl_value_new_float(M_PI);
150  g_autofree gchar* text = fl_value_to_string(value);
151  EXPECT_STREQ(text, "3.1415926535897931");
152 }
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723

◆ TEST() [25/101]

TEST ( FlValueTest  ,
String   
)

Definition at line 154 of file fl_value_test.cc.

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string(), FL_VALUE_TYPE_STRING, and value.

154  {
155  g_autoptr(FlValue) value = fl_value_new_string("hello");
157  EXPECT_STREQ(fl_value_get_string(value), "hello");
158 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596

◆ TEST() [26/101]

TEST ( FlValueTest  ,
StringEmpty   
)

Definition at line 160 of file fl_value_test.cc.

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string(), FL_VALUE_TYPE_STRING, and value.

160  {
161  g_autoptr(FlValue) value = fl_value_new_string("");
163  EXPECT_STREQ(fl_value_get_string(value), "");
164 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596

◆ TEST() [27/101]

TEST ( FlValueTest  ,
StringSized   
)

Definition at line 166 of file fl_value_test.cc.

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string_sized(), FL_VALUE_TYPE_STRING, and value.

166  {
167  g_autoptr(FlValue) value = fl_value_new_string_sized("hello", 2);
169  EXPECT_STREQ(fl_value_get_string(value), "he");
170 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596
G_MODULE_EXPORT FlValue * fl_value_new_string_sized(const gchar *value, size_t value_length)
Definition: fl_value.cc:254

◆ TEST() [28/101]

TEST ( FlValueTest  ,
StringSizedNullptr   
)

Definition at line 172 of file fl_value_test.cc.

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string_sized(), FL_VALUE_TYPE_STRING, and value.

172  {
173  g_autoptr(FlValue) value = fl_value_new_string_sized(nullptr, 0);
175  EXPECT_STREQ(fl_value_get_string(value), "");
176 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596
G_MODULE_EXPORT FlValue * fl_value_new_string_sized(const gchar *value, size_t value_length)
Definition: fl_value.cc:254

◆ TEST() [29/101]

TEST ( FlValueTest  ,
StringSizedZeroLength   
)

Definition at line 178 of file fl_value_test.cc.

References fl_value_get_string(), fl_value_get_type(), fl_value_new_string_sized(), FL_VALUE_TYPE_STRING, and value.

178  {
179  g_autoptr(FlValue) value = fl_value_new_string_sized("hello", 0);
181  EXPECT_STREQ(fl_value_get_string(value), "");
182 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596
G_MODULE_EXPORT FlValue * fl_value_new_string_sized(const gchar *value, size_t value_length)
Definition: fl_value.cc:254

◆ TEST() [30/101]

TEST ( FlValueTest  ,
StringEqual   
)

Definition at line 184 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_string().

184  {
185  g_autoptr(FlValue) value1 = fl_value_new_string("hello");
186  g_autoptr(FlValue) value2 = fl_value_new_string("hello");
187  EXPECT_TRUE(fl_value_equal(value1, value2));
188 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247

◆ TEST() [31/101]

TEST ( FlValueTest  ,
StringNotEqual   
)

Definition at line 190 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_string().

190  {
191  g_autoptr(FlValue) value1 = fl_value_new_string("hello");
192  g_autoptr(FlValue) value2 = fl_value_new_string("world");
193  EXPECT_FALSE(fl_value_equal(value1, value2));
194 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247

◆ TEST() [32/101]

TEST ( FlValueTest  ,
StringToString   
)

Definition at line 196 of file fl_value_test.cc.

References fl_value_new_string(), fl_value_to_string(), and value.

196  {
197  g_autoptr(FlValue) value = fl_value_new_string("hello");
198  g_autofree gchar* text = fl_value_to_string(value);
199  EXPECT_STREQ(text, "hello");
200 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247

◆ TEST() [33/101]

TEST ( FlValueTest  ,
Uint8List   
)

Definition at line 202 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_type(), fl_value_get_uint8_list(), fl_value_new_uint8_list(), FL_VALUE_TYPE_UINT8_LIST, and value.

202  {
203  uint8_t data[] = {0x00, 0x01, 0xFE, 0xFF};
204  g_autoptr(FlValue) value = fl_value_new_uint8_list(data, 4);
206  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(4));
207  EXPECT_EQ(fl_value_get_uint8_list(value)[0], 0x00);
208  EXPECT_EQ(fl_value_get_uint8_list(value)[1], 0x01);
209  EXPECT_EQ(fl_value_get_uint8_list(value)[2], 0xFE);
210  EXPECT_EQ(fl_value_get_uint8_list(value)[3], 0xFF);
211 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT const uint8_t * fl_value_get_uint8_list(FlValue *self)
Definition: fl_value.cc:603
uint8_t value
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [34/101]

TEST ( FlValueTest  ,
Uint8ListNullptr   
)

Definition at line 213 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_type(), fl_value_new_uint8_list(), FL_VALUE_TYPE_UINT8_LIST, and value.

213  {
214  g_autoptr(FlValue) value = fl_value_new_uint8_list(nullptr, 0);
216  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
217 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [35/101]

TEST ( FlValueTest  ,
Uint8ListEqual   
)

Definition at line 219 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_uint8_list().

219  {
220  uint8_t data1[] = {1, 2, 3};
221  g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data1, 3);
222  uint8_t data2[] = {1, 2, 3};
223  g_autoptr(FlValue) value2 = fl_value_new_uint8_list(data2, 3);
224  EXPECT_TRUE(fl_value_equal(value1, value2));
225 }
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [36/101]

TEST ( FlValueTest  ,
Uint8ListEmptyEqual   
)

Definition at line 227 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_uint8_list().

227  {
228  g_autoptr(FlValue) value1 = fl_value_new_uint8_list(nullptr, 0);
229  g_autoptr(FlValue) value2 = fl_value_new_uint8_list(nullptr, 0);
230  EXPECT_TRUE(fl_value_equal(value1, value2));
231 }
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [37/101]

TEST ( FlValueTest  ,
Uint8ListNotEqualSameSize   
)

Definition at line 233 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_uint8_list().

233  {
234  uint8_t data1[] = {1, 2, 3};
235  g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data1, 3);
236  uint8_t data2[] = {1, 2, 4};
237  g_autoptr(FlValue) value2 = fl_value_new_uint8_list(data2, 3);
238  EXPECT_FALSE(fl_value_equal(value1, value2));
239 }
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [38/101]

TEST ( FlValueTest  ,
Uint8ListNotEqualDifferentSize   
)

Definition at line 241 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_uint8_list().

241  {
242  uint8_t data1[] = {1, 2, 3};
243  g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data1, 3);
244  uint8_t data2[] = {1, 2, 3, 4};
245  g_autoptr(FlValue) value2 = fl_value_new_uint8_list(data2, 4);
246  EXPECT_FALSE(fl_value_equal(value1, value2));
247 }
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [39/101]

TEST ( FlValueTest  ,
Uint8ListEmptyNotEqual   
)

Definition at line 249 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_uint8_list().

249  {
250  g_autoptr(FlValue) value1 = fl_value_new_uint8_list(nullptr, 0);
251  uint8_t data[] = {1, 2, 3};
252  g_autoptr(FlValue) value2 = fl_value_new_uint8_list(data, 3);
253  EXPECT_FALSE(fl_value_equal(value1, value2));
254 }
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [40/101]

TEST ( FlValueTest  ,
Uint8ListToString   
)

Definition at line 256 of file fl_value_test.cc.

References fl_value_new_uint8_list(), fl_value_to_string(), and value.

256  {
257  uint8_t data[] = {0x00, 0x01, 0xFE, 0xFF};
258  g_autoptr(FlValue) value = fl_value_new_uint8_list(data, 4);
259  g_autofree gchar* text = fl_value_to_string(value);
260  EXPECT_STREQ(text, "[0, 1, 254, 255]");
261 }
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723

◆ TEST() [41/101]

TEST ( FlValueTest  ,
Int32List   
)

Definition at line 263 of file fl_value_test.cc.

References fl_value_get_int32_list(), fl_value_get_length(), fl_value_get_type(), fl_value_new_int32_list(), FL_VALUE_TYPE_INT32_LIST, and value.

263  {
264  int32_t data[] = {0, -1, G_MAXINT32, G_MININT32};
265  g_autoptr(FlValue) value = fl_value_new_int32_list(data, 4);
267  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(4));
268  EXPECT_EQ(fl_value_get_int32_list(value)[0], 0);
269  EXPECT_EQ(fl_value_get_int32_list(value)[1], -1);
270  EXPECT_EQ(fl_value_get_int32_list(value)[2], G_MAXINT32);
271  EXPECT_EQ(fl_value_get_int32_list(value)[3], G_MININT32);
272 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
uint8_t value
G_MODULE_EXPORT const int32_t * fl_value_get_int32_list(FlValue *self)
Definition: fl_value.cc:610
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [42/101]

TEST ( FlValueTest  ,
Int32ListNullptr   
)

Definition at line 274 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_type(), fl_value_new_int32_list(), FL_VALUE_TYPE_INT32_LIST, and value.

274  {
275  g_autoptr(FlValue) value = fl_value_new_int32_list(nullptr, 0);
277  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
278 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
uint8_t value
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [43/101]

TEST ( FlValueTest  ,
Int32ListEqual   
)

Definition at line 280 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int32_list().

280  {
281  int32_t data1[] = {0, G_MAXINT32, G_MININT32};
282  g_autoptr(FlValue) value1 = fl_value_new_int32_list(data1, 3);
283  int32_t data2[] = {0, G_MAXINT32, G_MININT32};
284  g_autoptr(FlValue) value2 = fl_value_new_int32_list(data2, 3);
285  EXPECT_TRUE(fl_value_equal(value1, value2));
286 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [44/101]

TEST ( FlValueTest  ,
Int32ListEmptyEqual   
)

Definition at line 288 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int32_list().

288  {
289  g_autoptr(FlValue) value1 = fl_value_new_int32_list(nullptr, 0);
290  g_autoptr(FlValue) value2 = fl_value_new_int32_list(nullptr, 0);
291  EXPECT_TRUE(fl_value_equal(value1, value2));
292 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [45/101]

TEST ( FlValueTest  ,
Int32ListNotEqualSameSize   
)

Definition at line 294 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int32_list().

294  {
295  int32_t data1[] = {0, G_MAXINT32, G_MININT32};
296  g_autoptr(FlValue) value1 = fl_value_new_int32_list(data1, 3);
297  int32_t data2[] = {0, G_MININT32, G_MAXINT32};
298  g_autoptr(FlValue) value2 = fl_value_new_int32_list(data2, 3);
299  EXPECT_FALSE(fl_value_equal(value1, value2));
300 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [46/101]

TEST ( FlValueTest  ,
Int32ListNotEqualDifferentSize   
)

Definition at line 302 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int32_list().

302  {
303  int32_t data1[] = {0, G_MAXINT32, G_MININT32};
304  g_autoptr(FlValue) value1 = fl_value_new_int32_list(data1, 3);
305  int32_t data2[] = {0, G_MAXINT32, G_MININT32, -1};
306  g_autoptr(FlValue) value2 = fl_value_new_int32_list(data2, 4);
307  EXPECT_FALSE(fl_value_equal(value1, value2));
308 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [47/101]

TEST ( FlValueTest  ,
Int32ListEmptyNotEqual   
)

Definition at line 310 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int32_list().

310  {
311  g_autoptr(FlValue) value1 = fl_value_new_int32_list(nullptr, 0);
312  int32_t data[] = {0, G_MAXINT32, G_MININT32};
313  g_autoptr(FlValue) value2 = fl_value_new_int32_list(data, 3);
314  EXPECT_FALSE(fl_value_equal(value1, value2));
315 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [48/101]

TEST ( FlValueTest  ,
Int32ListToString   
)

Definition at line 317 of file fl_value_test.cc.

References fl_value_new_int32_list(), fl_value_to_string(), and value.

317  {
318  int32_t data[] = {0, G_MAXINT32, G_MININT32};
319  g_autoptr(FlValue) value = fl_value_new_int32_list(data, 3);
320  g_autofree gchar* text = fl_value_to_string(value);
321  EXPECT_STREQ(text, "[0, 2147483647, -2147483648]");
322 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723

◆ TEST() [49/101]

TEST ( FlValueTest  ,
Int64List   
)

Definition at line 324 of file fl_value_test.cc.

References fl_value_get_int64_list(), fl_value_get_length(), fl_value_get_type(), fl_value_new_int64_list(), FL_VALUE_TYPE_INT64_LIST, and value.

324  {
325  int64_t data[] = {0, -1, G_MAXINT64, G_MININT64};
326  g_autoptr(FlValue) value = fl_value_new_int64_list(data, 4);
328  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(4));
329  EXPECT_EQ(fl_value_get_int64_list(value)[0], 0);
330  EXPECT_EQ(fl_value_get_int64_list(value)[1], -1);
331  EXPECT_EQ(fl_value_get_int64_list(value)[2], G_MAXINT64);
332  EXPECT_EQ(fl_value_get_int64_list(value)[3], G_MININT64);
333 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT const int64_t * fl_value_get_int64_list(FlValue *self)
Definition: fl_value.cc:617
uint8_t value
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [50/101]

TEST ( FlValueTest  ,
Int64ListNullptr   
)

Definition at line 335 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_type(), fl_value_new_int64_list(), FL_VALUE_TYPE_INT64_LIST, and value.

335  {
336  g_autoptr(FlValue) value = fl_value_new_int64_list(nullptr, 0);
338  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
339 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [51/101]

TEST ( FlValueTest  ,
Int64ListEqual   
)

Definition at line 341 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int64_list().

341  {
342  int64_t data1[] = {0, G_MAXINT64, G_MININT64};
343  g_autoptr(FlValue) value1 = fl_value_new_int64_list(data1, 3);
344  int64_t data2[] = {0, G_MAXINT64, G_MININT64};
345  g_autoptr(FlValue) value2 = fl_value_new_int64_list(data2, 3);
346  EXPECT_TRUE(fl_value_equal(value1, value2));
347 }
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [52/101]

TEST ( FlValueTest  ,
Int64ListEmptyEqual   
)

Definition at line 349 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int64_list().

349  {
350  g_autoptr(FlValue) value1 = fl_value_new_int64_list(nullptr, 0);
351  g_autoptr(FlValue) value2 = fl_value_new_int64_list(nullptr, 0);
352  EXPECT_TRUE(fl_value_equal(value1, value2));
353 }
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [53/101]

TEST ( FlValueTest  ,
Int64ListNotEqualSameSize   
)

Definition at line 355 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int64_list().

355  {
356  int64_t data1[] = {0, G_MAXINT64, G_MININT64};
357  g_autoptr(FlValue) value1 = fl_value_new_int64_list(data1, 3);
358  int64_t data2[] = {0, G_MININT64, G_MAXINT64};
359  g_autoptr(FlValue) value2 = fl_value_new_int64_list(data2, 3);
360  EXPECT_FALSE(fl_value_equal(value1, value2));
361 }
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [54/101]

TEST ( FlValueTest  ,
Int64ListNotEqualDifferentSize   
)

Definition at line 363 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int64_list().

363  {
364  int64_t data1[] = {0, G_MAXINT64, G_MININT64};
365  g_autoptr(FlValue) value1 = fl_value_new_int64_list(data1, 3);
366  int64_t data2[] = {0, G_MAXINT64, G_MININT64, -1};
367  g_autoptr(FlValue) value2 = fl_value_new_int64_list(data2, 4);
368  EXPECT_FALSE(fl_value_equal(value1, value2));
369 }
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [55/101]

TEST ( FlValueTest  ,
Int64ListEmptyNotEqual   
)

Definition at line 371 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_int64_list().

371  {
372  g_autoptr(FlValue) value1 = fl_value_new_int64_list(nullptr, 0);
373  int64_t data[] = {0, G_MAXINT64, G_MININT64};
374  g_autoptr(FlValue) value2 = fl_value_new_int64_list(data, 3);
375  EXPECT_FALSE(fl_value_equal(value1, value2));
376 }
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [56/101]

TEST ( FlValueTest  ,
Int64ListToString   
)

Definition at line 378 of file fl_value_test.cc.

References fl_value_new_int64_list(), fl_value_to_string(), and value.

378  {
379  int64_t data[] = {0, G_MAXINT64, G_MININT64};
380  g_autoptr(FlValue) value = fl_value_new_int64_list(data, 3);
381  g_autofree gchar* text = fl_value_to_string(value);
382  EXPECT_STREQ(text, "[0, 9223372036854775807, -9223372036854775808]");
383 }
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723

◆ TEST() [57/101]

TEST ( FlValueTest  ,
FloatList   
)

Definition at line 385 of file fl_value_test.cc.

References fl_value_get_float_list(), fl_value_get_length(), fl_value_get_type(), fl_value_new_float_list(), FL_VALUE_TYPE_FLOAT_LIST, and value.

385  {
386  double data[] = {0.0, -1.0, M_PI};
387  g_autoptr(FlValue) value = fl_value_new_float_list(data, 4);
389  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(4));
390  EXPECT_EQ(fl_value_get_float_list(value)[0], 0);
391  EXPECT_EQ(fl_value_get_float_list(value)[1], -1.0);
392  EXPECT_EQ(fl_value_get_float_list(value)[2], M_PI);
393 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT const double * fl_value_get_float_list(FlValue *self)
Definition: fl_value.cc:624
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [58/101]

TEST ( FlValueTest  ,
FloatListNullptr   
)

Definition at line 395 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_type(), fl_value_new_float_list(), FL_VALUE_TYPE_FLOAT_LIST, and value.

395  {
396  g_autoptr(FlValue) value = fl_value_new_float_list(nullptr, 0);
398  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
399 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [59/101]

TEST ( FlValueTest  ,
FloatListEqual   
)

Definition at line 401 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_float_list().

401  {
402  double data1[] = {0, -0.5, M_PI};
403  g_autoptr(FlValue) value1 = fl_value_new_float_list(data1, 3);
404  double data2[] = {0, -0.5, M_PI};
405  g_autoptr(FlValue) value2 = fl_value_new_float_list(data2, 3);
406  EXPECT_TRUE(fl_value_equal(value1, value2));
407 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300

◆ TEST() [60/101]

TEST ( FlValueTest  ,
FloatListEmptyEqual   
)

Definition at line 409 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_float_list().

409  {
410  g_autoptr(FlValue) value1 = fl_value_new_float_list(nullptr, 0);
411  g_autoptr(FlValue) value2 = fl_value_new_float_list(nullptr, 0);
412  EXPECT_TRUE(fl_value_equal(value1, value2));
413 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300

◆ TEST() [61/101]

TEST ( FlValueTest  ,
FloatListNotEqualSameSize   
)

Definition at line 415 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_float_list().

415  {
416  double data1[] = {0, -0.5, M_PI};
417  g_autoptr(FlValue) value1 = fl_value_new_float_list(data1, 3);
418  double data2[] = {0, -0.5, M_E};
419  g_autoptr(FlValue) value2 = fl_value_new_float_list(data2, 3);
420  EXPECT_FALSE(fl_value_equal(value1, value2));
421 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300

◆ TEST() [62/101]

TEST ( FlValueTest  ,
FloatListNotEqualDifferentSize   
)

Definition at line 423 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_float_list().

423  {
424  double data1[] = {0, -0.5, M_PI};
425  g_autoptr(FlValue) value1 = fl_value_new_float_list(data1, 3);
426  double data2[] = {0, -0.5, M_PI, 42};
427  g_autoptr(FlValue) value2 = fl_value_new_float_list(data2, 4);
428  EXPECT_FALSE(fl_value_equal(value1, value2));
429 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300

◆ TEST() [63/101]

TEST ( FlValueTest  ,
FloatListEmptyNotEqual   
)

Definition at line 431 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_float_list().

431  {
432  g_autoptr(FlValue) value1 = fl_value_new_float_list(nullptr, 0);
433  double data[] = {0, -0.5, M_PI};
434  g_autoptr(FlValue) value2 = fl_value_new_float_list(data, 3);
435  EXPECT_FALSE(fl_value_equal(value1, value2));
436 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300

◆ TEST() [64/101]

TEST ( FlValueTest  ,
FloatListToString   
)

Definition at line 438 of file fl_value_test.cc.

References fl_value_new_float_list(), fl_value_to_string(), and value.

438  {
439  double data[] = {0, -0.5, M_PI};
440  g_autoptr(FlValue) value = fl_value_new_float_list(data, 3);
441  g_autofree gchar* text = fl_value_to_string(value);
442  EXPECT_STREQ(text, "[0.0, -0.5, 3.1415926535897931]");
443 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300

◆ TEST() [65/101]

TEST ( FlValueTest  ,
ListEmpty   
)

Definition at line 445 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_type(), fl_value_new_list(), FL_VALUE_TYPE_LIST, and value.

445  {
446  g_autoptr(FlValue) value = fl_value_new_list();
448  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
449 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
uint8_t value
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [66/101]

TEST ( FlValueTest  ,
ListAdd   
)

Definition at line 451 of file fl_value_test.cc.

References fl_value_append(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_type(), fl_value_new_list(), fl_value_new_null(), FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_NULL, and value.

451  {
452  g_autoptr(FlValue) value = fl_value_new_list();
453  g_autoptr(FlValue) child = fl_value_new_null();
454  fl_value_append(value, child);
456  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
459 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
Definition: fl_value.cc:506
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:677
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [67/101]

TEST ( FlValueTest  ,
ListAddTake   
)

Definition at line 461 of file fl_value_test.cc.

References fl_value_append_take(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_type(), fl_value_new_list(), fl_value_new_null(), FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_NULL, and value.

461  {
462  g_autoptr(FlValue) value = fl_value_new_list();
465  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
468 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:514
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:677
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [68/101]

TEST ( FlValueTest  ,
ListChildTypes   
)

Definition at line 470 of file fl_value_test.cc.

References fl_value_append_take(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_type(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_uint8_list(), FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_FLOAT_LIST, FL_VALUE_TYPE_INT, FL_VALUE_TYPE_INT32_LIST, FL_VALUE_TYPE_INT64_LIST, FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_NULL, FL_VALUE_TYPE_UINT8_LIST, TRUE, and value.

470  {
471  g_autoptr(FlValue) value = fl_value_new_list();
483  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
504 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:514
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:677
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
return TRUE
Definition: fl_view.cc:107
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [69/101]

TEST ( FlValueTest  ,
ListStrv   
)

Definition at line 506 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_list_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_list_from_strv(), FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_STRING, and value.

506  {
507  g_auto(GStrv) words = g_strsplit("hello:world", ":", -1);
508  g_autoptr(FlValue) value = fl_value_new_list_from_strv(words);
510  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(2));
513  EXPECT_STREQ(fl_value_get_string(fl_value_get_list_value(value, 0)), "hello");
516  EXPECT_STREQ(fl_value_get_string(fl_value_get_list_value(value, 1)), "world");
517 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_list_from_strv(const gchar *const *str_array)
Definition: fl_value.cc:317
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:677
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [70/101]

TEST ( FlValueTest  ,
ListStrvEmpty   
)

Definition at line 519 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_type(), fl_value_new_list_from_strv(), FL_VALUE_TYPE_LIST, and value.

519  {
520  g_auto(GStrv) words = g_strsplit("", ":", -1);
521  g_autoptr(FlValue) value = fl_value_new_list_from_strv(words);
523  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
524 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_list_from_strv(const gchar *const *str_array)
Definition: fl_value.cc:317
uint8_t value
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [71/101]

TEST ( FlValueTest  ,
ListEqual   
)

Definition at line 526 of file fl_value_test.cc.

References fl_value_append_take(), fl_value_equal(), fl_value_new_int(), and fl_value_new_list().

526  {
527  g_autoptr(FlValue) value1 = fl_value_new_list();
531  g_autoptr(FlValue) value2 = fl_value_new_list();
535  EXPECT_TRUE(fl_value_equal(value1, value2));
536 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:514
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [72/101]

TEST ( FlValueTest  ,
ListEmptyEqual   
)

Definition at line 538 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_list().

538  {
539  g_autoptr(FlValue) value1 = fl_value_new_list();
540  g_autoptr(FlValue) value2 = fl_value_new_list();
541  EXPECT_TRUE(fl_value_equal(value1, value2));
542 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [73/101]

TEST ( FlValueTest  ,
ListNotEqualSameSize   
)

Definition at line 544 of file fl_value_test.cc.

References fl_value_append_take(), fl_value_equal(), fl_value_new_int(), and fl_value_new_list().

544  {
545  g_autoptr(FlValue) value1 = fl_value_new_list();
549  g_autoptr(FlValue) value2 = fl_value_new_list();
553  EXPECT_FALSE(fl_value_equal(value1, value2));
554 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:514
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [74/101]

TEST ( FlValueTest  ,
ListNotEqualDifferentSize   
)

Definition at line 556 of file fl_value_test.cc.

References fl_value_append_take(), fl_value_equal(), fl_value_new_int(), and fl_value_new_list().

556  {
557  g_autoptr(FlValue) value1 = fl_value_new_list();
561  g_autoptr(FlValue) value2 = fl_value_new_list();
566  EXPECT_FALSE(fl_value_equal(value1, value2));
567 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:514
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [75/101]

TEST ( FlValueTest  ,
ListEmptyNotEqual   
)

Definition at line 569 of file fl_value_test.cc.

References fl_value_append_take(), fl_value_equal(), fl_value_new_int(), and fl_value_new_list().

569  {
570  g_autoptr(FlValue) value1 = fl_value_new_list();
571  g_autoptr(FlValue) value2 = fl_value_new_list();
575  EXPECT_FALSE(fl_value_equal(value1, value2));
576 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:514
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [76/101]

TEST ( FlValueTest  ,
ListToString   
)

Definition at line 578 of file fl_value_test.cc.

References fl_value_append_take(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_uint8_list(), fl_value_to_string(), TRUE, and value.

578  {
579  g_autoptr(FlValue) value = fl_value_new_list();
590  g_autofree gchar* text = fl_value_to_string(value);
591  EXPECT_STREQ(text,
592  "[null, true, 42, 3.1415926535897931, [], [], [], [], [], {}]");
593 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:514
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723
return TRUE
Definition: fl_view.cc:107
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [77/101]

TEST ( FlValueTest  ,
MapEmpty   
)

Definition at line 595 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_type(), fl_value_new_map(), FL_VALUE_TYPE_MAP, and value.

595  {
596  g_autoptr(FlValue) value = fl_value_new_map();
598  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
599 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
uint8_t value
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [78/101]

TEST ( FlValueTest  ,
MapSet   
)

Definition at line 601 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_int(), fl_value_new_map(), fl_value_new_string(), fl_value_set(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, and value.

601  {
602  g_autoptr(FlValue) value = fl_value_new_map();
603  g_autoptr(FlValue) k = fl_value_new_string("count");
604  g_autoptr(FlValue) v = fl_value_new_int(42);
605  fl_value_set(value, k, v);
607  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
610  EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
613  EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
614 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
G_MODULE_EXPORT void fl_value_set(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:523
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
Definition: fl_value.cc:693
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
Definition: fl_value.cc:685
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [79/101]

TEST ( FlValueTest  ,
MapSetTake   
)

Definition at line 616 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_int(), fl_value_new_map(), fl_value_new_string(), fl_value_set_take(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, and value.

616  {
617  g_autoptr(FlValue) value = fl_value_new_map();
620  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
623  EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
626  EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
627 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT void fl_value_set_take(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:532
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
Definition: fl_value.cc:693
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
Definition: fl_value.cc:685
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [80/101]

TEST ( FlValueTest  ,
MapSetString   
)

Definition at line 629 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_int(), fl_value_new_map(), fl_value_set_string(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, and value.

629  {
630  g_autoptr(FlValue) value = fl_value_new_map();
631  g_autoptr(FlValue) v = fl_value_new_int(42);
632  fl_value_set_string(value, "count", v);
634  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
637  EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
640  EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
641 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
Definition: fl_value.cc:693
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
Definition: fl_value.cc:685
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596
G_MODULE_EXPORT void fl_value_set_string(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:553
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [81/101]

TEST ( FlValueTest  ,
MapSetStringTake   
)

Definition at line 643 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_new_int(), fl_value_new_map(), fl_value_set_string_take(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_STRING, and value.

643  {
644  g_autoptr(FlValue) value = fl_value_new_map();
647  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
650  EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
653  EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
654 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
Definition: fl_value.cc:693
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
Definition: fl_value.cc:685
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:596
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631

◆ TEST() [82/101]

TEST ( FlValueTest  ,
MapLookup   
)

Definition at line 656 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_type(), fl_value_lookup(), fl_value_new_int(), fl_value_new_map(), fl_value_new_string(), fl_value_set_string_take(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_MAP, and value.

656  {
657  g_autoptr(FlValue) value = fl_value_new_map();
662  g_autoptr(FlValue) two_key = fl_value_new_string("two");
663  FlValue* v = fl_value_lookup(value, two_key);
664  ASSERT_NE(v, nullptr);
665  ASSERT_EQ(fl_value_get_type(v), FL_VALUE_TYPE_INT);
666  EXPECT_EQ(fl_value_get_int(v), 2);
667  g_autoptr(FlValue) four_key = fl_value_new_string("four");
668  v = fl_value_lookup(value, four_key);
669  ASSERT_EQ(v, nullptr);
670 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247
G_MODULE_EXPORT FlValue * fl_value_lookup(FlValue *self, FlValue *key)
Definition: fl_value.cc:701
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564

◆ TEST() [83/101]

TEST ( FlValueTest  ,
MapLookupString   
)

Definition at line 672 of file fl_value_test.cc.

References fl_value_get_int(), fl_value_get_type(), fl_value_lookup_string(), fl_value_new_int(), fl_value_new_map(), fl_value_set_string_take(), FL_VALUE_TYPE_INT, and value.

672  {
673  g_autoptr(FlValue) value = fl_value_new_map();
677  FlValue* v = fl_value_lookup_string(value, "two");
678  ASSERT_NE(v, nullptr);
679  ASSERT_EQ(fl_value_get_type(v), FL_VALUE_TYPE_INT);
680  EXPECT_EQ(fl_value_get_int(v), 2);
681  v = fl_value_lookup_string(value, "four");
682  ASSERT_EQ(v, nullptr);
683 }
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:582
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:712
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564

◆ TEST() [84/101]

TEST ( FlValueTest  ,
MapValueypes   
)

Definition at line 685 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_map_value(), fl_value_get_type(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_string(), fl_value_new_uint8_list(), fl_value_set_take(), FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_FLOAT_LIST, FL_VALUE_TYPE_INT, FL_VALUE_TYPE_INT32_LIST, FL_VALUE_TYPE_INT64_LIST, FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_NULL, FL_VALUE_TYPE_UINT8_LIST, TRUE, and value.

685  {
686  g_autoptr(FlValue) value = fl_value_new_map();
692  fl_value_new_float(M_PI));
694  fl_value_new_uint8_list(nullptr, 0));
696  fl_value_new_int32_list(nullptr, 0));
698  fl_value_new_int64_list(nullptr, 0));
700  fl_value_new_float_list(nullptr, 0));
704  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
725 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
uint8_t value
G_MODULE_EXPORT void fl_value_set_take(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:532
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
Definition: fl_value.cc:693
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247
return TRUE
Definition: fl_view.cc:107
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [85/101]

TEST ( FlValueTest  ,
MapKeyTypes   
)

Definition at line 727 of file fl_value_test.cc.

References fl_value_get_length(), fl_value_get_map_key(), fl_value_get_type(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_string(), fl_value_new_uint8_list(), fl_value_set_take(), FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_FLOAT_LIST, FL_VALUE_TYPE_INT, FL_VALUE_TYPE_INT32_LIST, FL_VALUE_TYPE_INT64_LIST, FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_NULL, FL_VALUE_TYPE_UINT8_LIST, TRUE, and value.

727  {
728  g_autoptr(FlValue) value = fl_value_new_map();
731  fl_value_new_string("bool"));
734  fl_value_new_string("float"));
736  fl_value_new_string("uint8_list"));
738  fl_value_new_string("int32_list"));
740  fl_value_new_string("int64_list"));
742  fl_value_new_string("float_list"));
746  ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
767 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:395
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
uint8_t value
G_MODULE_EXPORT void fl_value_set_take(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:532
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
Definition: fl_value.cc:685
return TRUE
Definition: fl_view.cc:107
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:631
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [86/101]

TEST ( FlValueTest  ,
MapEqual   
)

Definition at line 769 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

769  {
770  g_autoptr(FlValue) value1 = fl_value_new_map();
771  fl_value_set_string_take(value1, "one", fl_value_new_int(1));
772  fl_value_set_string_take(value1, "two", fl_value_new_int(2));
773  fl_value_set_string_take(value1, "three", fl_value_new_int(3));
774  g_autoptr(FlValue) value2 = fl_value_new_map();
775  fl_value_set_string_take(value2, "one", fl_value_new_int(1));
776  fl_value_set_string_take(value2, "two", fl_value_new_int(2));
777  fl_value_set_string_take(value2, "three", fl_value_new_int(3));
778  EXPECT_TRUE(fl_value_equal(value1, value2));
779 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564

◆ TEST() [87/101]

TEST ( FlValueTest  ,
MapEqualDifferentOrder   
)

Definition at line 781 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

781  {
782  g_autoptr(FlValue) value1 = fl_value_new_map();
783  fl_value_set_string_take(value1, "one", fl_value_new_int(1));
784  fl_value_set_string_take(value1, "two", fl_value_new_int(2));
785  fl_value_set_string_take(value1, "three", fl_value_new_int(3));
786  g_autoptr(FlValue) value2 = fl_value_new_map();
787  fl_value_set_string_take(value2, "one", fl_value_new_int(1));
788  fl_value_set_string_take(value2, "three", fl_value_new_int(3));
789  fl_value_set_string_take(value2, "two", fl_value_new_int(2));
790  EXPECT_TRUE(fl_value_equal(value1, value2));
791 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564

◆ TEST() [88/101]

TEST ( FlValueTest  ,
MapEmptyEqual   
)

Definition at line 793 of file fl_value_test.cc.

References fl_value_equal(), and fl_value_new_map().

793  {
794  g_autoptr(FlValue) value1 = fl_value_new_map();
795  g_autoptr(FlValue) value2 = fl_value_new_map();
796  EXPECT_TRUE(fl_value_equal(value1, value2));
797 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [89/101]

TEST ( FlValueTest  ,
MapNotEqualSameSizeDifferentKeys   
)

Definition at line 799 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

799  {
800  g_autoptr(FlValue) value1 = fl_value_new_map();
801  fl_value_set_string_take(value1, "one", fl_value_new_int(1));
802  fl_value_set_string_take(value1, "two", fl_value_new_int(2));
803  fl_value_set_string_take(value1, "three", fl_value_new_int(3));
804  g_autoptr(FlValue) value2 = fl_value_new_map();
805  fl_value_set_string_take(value2, "one", fl_value_new_int(1));
806  fl_value_set_string_take(value2, "two", fl_value_new_int(2));
807  fl_value_set_string_take(value2, "four", fl_value_new_int(3));
808  EXPECT_FALSE(fl_value_equal(value1, value2));
809 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564

◆ TEST() [90/101]

TEST ( FlValueTest  ,
MapNotEqualSameSizeDifferentValues   
)

Definition at line 811 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

811  {
812  g_autoptr(FlValue) value1 = fl_value_new_map();
813  fl_value_set_string_take(value1, "one", fl_value_new_int(1));
814  fl_value_set_string_take(value1, "two", fl_value_new_int(2));
815  fl_value_set_string_take(value1, "three", fl_value_new_int(3));
816  g_autoptr(FlValue) value2 = fl_value_new_map();
817  fl_value_set_string_take(value2, "one", fl_value_new_int(1));
818  fl_value_set_string_take(value2, "two", fl_value_new_int(2));
819  fl_value_set_string_take(value2, "three", fl_value_new_int(4));
820  EXPECT_FALSE(fl_value_equal(value1, value2));
821 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564

◆ TEST() [91/101]

TEST ( FlValueTest  ,
MapNotEqualDifferentSize   
)

Definition at line 823 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

823  {
824  g_autoptr(FlValue) value1 = fl_value_new_map();
825  fl_value_set_string_take(value1, "one", fl_value_new_int(1));
826  fl_value_set_string_take(value1, "two", fl_value_new_int(2));
827  fl_value_set_string_take(value1, "three", fl_value_new_int(3));
828  g_autoptr(FlValue) value2 = fl_value_new_map();
829  fl_value_set_string_take(value2, "one", fl_value_new_int(1));
830  fl_value_set_string_take(value2, "two", fl_value_new_int(2));
831  fl_value_set_string_take(value2, "three", fl_value_new_int(3));
832  fl_value_set_string_take(value2, "four", fl_value_new_int(4));
833  EXPECT_FALSE(fl_value_equal(value1, value2));
834 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564

◆ TEST() [92/101]

TEST ( FlValueTest  ,
MapEmptyNotEqual   
)

Definition at line 836 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int(), fl_value_new_map(), and fl_value_set_string_take().

836  {
837  g_autoptr(FlValue) value1 = fl_value_new_map();
838  g_autoptr(FlValue) value2 = fl_value_new_map();
839  fl_value_set_string_take(value2, "one", fl_value_new_int(1));
840  fl_value_set_string_take(value2, "two", fl_value_new_int(2));
841  fl_value_set_string_take(value2, "three", fl_value_new_int(3));
842  EXPECT_FALSE(fl_value_equal(value1, value2));
843 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:564

◆ TEST() [93/101]

TEST ( FlValueTest  ,
MapToString   
)

Definition at line 845 of file fl_value_test.cc.

References fl_value_new_bool(), fl_value_new_float(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_string(), fl_value_new_uint8_list(), fl_value_set_take(), fl_value_to_string(), TRUE, and value.

845  {
846  g_autoptr(FlValue) value = fl_value_new_map();
852  fl_value_new_float(M_PI));
854  fl_value_new_uint8_list(nullptr, 0));
856  fl_value_new_int32_list(nullptr, 0));
858  fl_value_new_int64_list(nullptr, 0));
860  fl_value_new_float_list(nullptr, 0));
865  fl_value_new_string("bool"));
868  fl_value_new_string("float"));
870  fl_value_new_string("uint8_list"));
872  fl_value_new_string("int32_list"));
874  fl_value_new_string("int64_list"));
876  fl_value_new_string("float_list"));
879  g_autofree gchar* text = fl_value_to_string(value);
880  EXPECT_STREQ(text,
881  "{null: null, bool: true, int: 42, float: 3.1415926535897931, "
882  "uint8_list: [], int32_list: [], int64_list: [], float_list: "
883  "[], list: [], map: {}, null: null, true: bool, 42: int, "
884  "3.1415926535897931: float, []: uint8_list, []: int32_list, []: "
885  "int64_list, []: float_list, []: list, {}: map}");
886 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:240
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
uint8_t value
G_MODULE_EXPORT void fl_value_set_take(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:532
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:723
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247
return TRUE
Definition: fl_view.cc:107
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [94/101]

TEST ( FlValueTest  ,
EqualSameObject   
)

Definition at line 888 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_null(), and value.

888  {
889  g_autoptr(FlValue) value = fl_value_new_null();
890  EXPECT_TRUE(fl_value_equal(value, value));
891 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
uint8_t value
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [95/101]

TEST ( FlValueTest  ,
NullIntNotEqual   
)

Definition at line 893 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int(), and fl_value_new_null().

893  {
894  g_autoptr(FlValue) value1 = fl_value_new_null();
895  g_autoptr(FlValue) value2 = fl_value_new_int(0);
896  EXPECT_FALSE(fl_value_equal(value1, value2));
897 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:222

◆ TEST() [96/101]

TEST ( FlValueTest  ,
NullBoolNotEqual   
)

Definition at line 899 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_bool(), and fl_value_new_int().

899  {
900  g_autoptr(FlValue) value1 = fl_value_new_bool(FALSE);
901  g_autoptr(FlValue) value2 = fl_value_new_int(0);
902  EXPECT_FALSE(fl_value_equal(value1, value2));
903 }
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:226
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:233

◆ TEST() [97/101]

TEST ( FlValueTest  ,
StringUint8ListNotEqual   
)

Definition at line 905 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_string(), and fl_value_new_uint8_list().

905  {
906  uint8_t data[] = {'h', 'e', 'l', 'l', 'o'};
907  g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data, 5);
908  g_autoptr(FlValue) value2 = fl_value_new_string("hello");
909  EXPECT_FALSE(fl_value_equal(value1, value2));
910 }
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:247

◆ TEST() [98/101]

TEST ( FlValueTest  ,
Uint8ListInt32ListNotEqual   
)

Definition at line 912 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int32_list(), and fl_value_new_uint8_list().

912  {
913  uint8_t data8[] = {0, 1, 2, 3, 4};
914  int32_t data32[] = {0, 1, 2, 3, 4};
915  g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data8, 5);
916  g_autoptr(FlValue) value2 = fl_value_new_int32_list(data32, 5);
917  EXPECT_FALSE(fl_value_equal(value1, value2));
918 }
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:263
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [99/101]

TEST ( FlValueTest  ,
Int32ListInt64ListNotEqual   
)

Definition at line 920 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_int32_list(), and fl_value_new_int64_list().

920  {
921  int32_t data32[] = {0, 1, 2, 3, 4};
922  int64_t data64[] = {0, 1, 2, 3, 4};
923  g_autoptr(FlValue) value1 = fl_value_new_int32_list(data32, 5);
924  g_autoptr(FlValue) value2 = fl_value_new_int64_list(data64, 5);
925  EXPECT_FALSE(fl_value_equal(value1, value2));
926 }
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:280
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400

◆ TEST() [100/101]

TEST ( FlValueTest  ,
Int64ListFloatListNotEqual   
)

Definition at line 928 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_float_list(), and fl_value_new_int64_list().

928  {
929  int64_t data64[] = {0, 1, 2, 3, 4};
930  double dataf[] = {0.0, 1.0, 2.0, 3.0, 4.0};
931  g_autoptr(FlValue) value1 = fl_value_new_int64_list(data64, 5);
932  g_autoptr(FlValue) value2 = fl_value_new_float_list(dataf, 5);
933  EXPECT_FALSE(fl_value_equal(value1, value2));
934 }
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:290
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:300

◆ TEST() [101/101]

TEST ( FlValueTest  ,
ListMapNotEqual   
)

Definition at line 936 of file fl_value_test.cc.

References fl_value_equal(), fl_value_new_list(), and fl_value_new_map().

936  {
937  g_autoptr(FlValue) value1 = fl_value_new_list();
938  g_autoptr(FlValue) value2 = fl_value_new_map();
939  EXPECT_FALSE(fl_value_equal(value1, value2));
940 }
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:310
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:327
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:400