| Flutter Linux Embedder |

Functions
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 (FlDartProjectTest, Custom)
| TEST (FlDartProjectTest, CustomNoDestroyNotify)
| TEST (FlDartProjectTest, CustomObject)
| TEST (FlDartProjectTest, CustomObjectTake)
| TEST (FlValueTest, CustomEqual)
| TEST (FlValueTest, CustomToString)
| 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/107]

TEST | ( | FlDartProjectTest | ,
|  | Custom |
| ) |  |

Definition at line 888 of file fl_value_test.cc.

888 {
889 g_autoptr(FlValue) value =
890 fl_value_new_custom(128, g_strdup("Hello World"), g_free);
891 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_CUSTOM);
892 ASSERT_EQ(fl_value_get_custom_type(value), 128);
893 ASSERT_STREQ(reinterpret_cast<const gchar*>(fl_value_get_custom_value(value)),
894 "Hello World");
895 }
value
uint8_t value
Definition: fl_standard_message_codec.cc:36
fl_value_new_custom
G_MODULE_EXPORT FlValue * fl_value_new_custom(int type, gconstpointer value, GDestroyNotify destroy_notify)
Definition: fl_value.cc:374
fl_value_get_type
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:466
fl_value_get_custom_type
G_MODULE_EXPORT int fl_value_get_custom_type(FlValue *self)
Definition: fl_value.cc:822
fl_value_get_custom_value
G_MODULE_EXPORT gconstpointer fl_value_get_custom_value(FlValue *self)
Definition: fl_value.cc:830
FlValue
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42
FL_VALUE_TYPE_CUSTOM
@ FL_VALUE_TYPE_CUSTOM
Definition: fl_value.h:76

References fl_value_get_custom_type(), fl_value_get_custom_value(), fl_value_get_type(), fl_value_new_custom(), FL_VALUE_TYPE_CUSTOM, and value.

## ◆ TEST() [2/107]

TEST | ( | FlDartProjectTest | ,
|  | CustomNoDestroyNotify |
| ) |  |

Definition at line 897 of file fl_value_test.cc.

897 {
898 g_autoptr(FlValue) value = fl_value_new_custom(128, "Hello World", nullptr);
899 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_CUSTOM);
900 ASSERT_EQ(fl_value_get_custom_type(value), 128);
901 ASSERT_STREQ(reinterpret_cast<const gchar*>(fl_value_get_custom_value(value)),
902 "Hello World");
903 }

References fl_value_get_custom_type(), fl_value_get_custom_value(), fl_value_get_type(), fl_value_new_custom(), FL_VALUE_TYPE_CUSTOM, and value.

## ◆ TEST() [3/107]

TEST | ( | FlDartProjectTest | ,
|  | CustomObject |
| ) |  |

Definition at line 905 of file fl_value_test.cc.

905 {
906 g_autoptr(GObject) v = G_OBJECT(g_object_new(G_TYPE_OBJECT, nullptr));
907 g_autoptr(FlValue) value = fl_value_new_custom_object(128, v);
908 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_CUSTOM);
909 ASSERT_EQ(fl_value_get_custom_type(value), 128);
910 ASSERT_TRUE(G_IS_OBJECT(fl_value_get_custom_value_object(value)));
911 }
fl_value_new_custom_object
G_MODULE_EXPORT FlValue * fl_value_new_custom_object(int type, GObject *object)
Definition: fl_value.cc:385
fl_value_get_custom_value_object
G_MODULE_EXPORT GObject * fl_value_get_custom_value_object(FlValue *self)
Definition: fl_value.cc:838

References fl_value_get_custom_type(), fl_value_get_custom_value_object(), fl_value_get_type(), fl_value_new_custom_object(), FL_VALUE_TYPE_CUSTOM, and value.

## ◆ TEST() [4/107]

TEST | ( | FlDartProjectTest | ,
|  | CustomObjectTake |
| ) |  |

Definition at line 913 of file fl_value_test.cc.

913 {
914 g_autoptr(FlValue) value = fl_value_new_custom_object_take(
915 128, G_OBJECT(g_object_new(G_TYPE_OBJECT, nullptr)));
916 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_CUSTOM);
917 ASSERT_EQ(fl_value_get_custom_type(value), 128);
918 ASSERT_TRUE(G_IS_OBJECT(fl_value_get_custom_value_object(value)));
919 }
fl_value_new_custom_object_take
G_MODULE_EXPORT FlValue * fl_value_new_custom_object_take(int type, GObject *object)
Definition: fl_value.cc:389

References fl_value_get_custom_type(), fl_value_get_custom_value_object(), fl_value_get_type(), fl_value_new_custom_object_take(), FL_VALUE_TYPE_CUSTOM, and value.

## ◆ TEST() [5/107]

TEST | ( | FlDartProjectTest | ,
|  | Null |
| ) |  |

Definition at line 11 of file fl_value_test.cc.

11 {
12 g_autoptr(FlValue) value = fl_value_new_null();
13 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_NULL);
14 }
fl_value_new_null
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:251
FL_VALUE_TYPE_NULL
@ FL_VALUE_TYPE_NULL
Definition: fl_value.h:64

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

## ◆ TEST() [6/107]

TEST | ( | FlValueTest | ,
|  | BoolEqual |
| ) |  |

Definition at line 40 of file fl_value_test.cc.

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 }
TRUE
return TRUE
Definition: fl_pixel_buffer_texture_test.cc:53
fl_value_new_bool
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:255
fl_value_equal
G_MODULE_EXPORT bool fl_value_equal(FlValue *a, FlValue *b)
Definition: fl_value.cc:471

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

## ◆ TEST() [7/107]

TEST | ( | FlValueTest | ,
|  | BoolFalse |
| ) |  |

Definition at line 34 of file fl_value_test.cc.

34 {
35 g_autoptr(FlValue) value = fl_value_new_bool(FALSE);
36 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_BOOL);
37 EXPECT_FALSE(fl_value_get_bool(value));
38 }
fl_value_get_bool
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
Definition: fl_value.cc:661
FL_VALUE_TYPE_BOOL
@ FL_VALUE_TYPE_BOOL
Definition: fl_value.h:65

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

## ◆ TEST() [8/107]

TEST | ( | FlValueTest | ,
|  | BoolFalseToString |
| ) |  |

Definition at line 58 of file fl_value_test.cc.

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 }
fl_value_to_string
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
Definition: fl_value.cc:846

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

## ◆ TEST() [9/107]

TEST | ( | FlValueTest | ,
|  | BoolNotEqual |
| ) |  |

Definition at line 46 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [10/107]

TEST | ( | FlValueTest | ,
|  | BoolTrue |
| ) |  |

Definition at line 28 of file fl_value_test.cc.

28 {
29 g_autoptr(FlValue) value = fl_value_new_bool(TRUE);
30 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_BOOL);
31 EXPECT_TRUE(fl_value_get_bool(value));
32 }

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

## ◆ TEST() [11/107]

TEST | ( | FlValueTest | ,
|  | BoolTrueToString |
| ) |  |

Definition at line 52 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [12/107]

TEST | ( | FlValueTest | ,
|  | CustomEqual |
| ) |  |

Definition at line 921 of file fl_value_test.cc.

921 {
922 g_autoptr(FlValue) value1 = fl_value_new_custom(128, "Hello World", nullptr);
923 g_autoptr(FlValue) value2 = fl_value_new_custom(128, "Hello World", nullptr);
924 EXPECT_FALSE(fl_value_equal(value1, value2));
925 }

References fl_value_equal(), and fl_value_new_custom().

## ◆ TEST() [13/107]

TEST | ( | FlValueTest | ,
|  | CustomToString |
| ) |  |

Definition at line 927 of file fl_value_test.cc.

927 {
928 g_autoptr(FlValue) value = fl_value_new_custom(128, nullptr, nullptr);
929 g_autofree gchar* text = fl_value_to_string(value);
930 EXPECT_STREQ(text, "(custom 128)");
931 }

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

## ◆ TEST() [14/107]

TEST | ( | FlValueTest | ,
|  | EqualSameObject |
| ) |  |

Definition at line 933 of file fl_value_test.cc.

933 {
934 g_autoptr(FlValue) value = fl_value_new_null();
935 EXPECT_TRUE(fl_value_equal(value, value));
936 }

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

## ◆ TEST() [15/107]

TEST | ( | FlValueTest | ,
|  | FloatEqual |
| ) |  |

Definition at line 136 of file fl_value_test.cc.

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 }
fl_value_new_float
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:269

References fl_value_equal(), and fl_value_new_float().

## ◆ TEST() [16/107]

TEST | ( | FlValueTest | ,
|  | FloatList |
| ) |  |

Definition at line 385 of file fl_value_test.cc.

385 {
386 double data[] = {0.0, -1.0, M_PI};
387 g_autoptr(FlValue) value = fl_value_new_float_list(data, 3);
388 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT_LIST);
389 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(3));
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 }
fl_value_get_float_list
G_MODULE_EXPORT const double * fl_value_get_float_list(FlValue *self)
Definition: fl_value.cc:717
fl_value_new_float_list
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:339
fl_value_get_length
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:724
FL_VALUE_TYPE_FLOAT_LIST
@ FL_VALUE_TYPE_FLOAT_LIST
Definition: fl_value.h:72

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.

## ◆ TEST() [17/107]

TEST | ( | FlValueTest | ,
|  | FloatListEmptyEqual |
| ) |  |

Definition at line 409 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [18/107]

TEST | ( | FlValueTest | ,
|  | FloatListEmptyNotEqual |
| ) |  |

Definition at line 431 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [19/107]

TEST | ( | FlValueTest | ,
|  | FloatListEqual |
| ) |  |

Definition at line 401 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [20/107]

TEST | ( | FlValueTest | ,
|  | FloatListNotEqualDifferentSize |
| ) |  |

Definition at line 423 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [21/107]

TEST | ( | FlValueTest | ,
|  | FloatListNotEqualSameSize |
| ) |  |

Definition at line 415 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_float_list().

## ◆ TEST() [22/107]

TEST | ( | FlValueTest | ,
|  | FloatListNullptr |
| ) |  |

Definition at line 395 of file fl_value_test.cc.

395 {
396 g_autoptr(FlValue) value = fl_value_new_float_list(nullptr, 0);
397 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT_LIST);
398 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
399 }

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

## ◆ TEST() [23/107]

TEST | ( | FlValueTest | ,
|  | FloatListToString |
| ) |  |

Definition at line 438 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [24/107]

TEST | ( | FlValueTest | ,
|  | FloatMinusOne |
| ) |  |

Definition at line 124 of file fl_value_test.cc.

124 {
125 g_autoptr(FlValue) value = fl_value_new_float(-1.0);
126 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT);
127 EXPECT_EQ(fl_value_get_float(value), -1.0);
128 }
fl_value_get_float
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:675
FL_VALUE_TYPE_FLOAT
@ FL_VALUE_TYPE_FLOAT
Definition: fl_value.h:67

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

## ◆ TEST() [25/107]

TEST | ( | FlValueTest | ,
|  | FloatNotEqual |
| ) |  |

Definition at line 142 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_float().

## ◆ TEST() [26/107]

TEST | ( | FlValueTest | ,
|  | FloatOne |
| ) |  |

Definition at line 118 of file fl_value_test.cc.

118 {
119 g_autoptr(FlValue) value = fl_value_new_float(1.0);
120 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT);
121 EXPECT_EQ(fl_value_get_float(value), 1.0);
122 }

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

## ◆ TEST() [27/107]

TEST | ( | FlValueTest | ,
|  | FloatPi |
| ) |  |

Definition at line 130 of file fl_value_test.cc.

130 {
131 g_autoptr(FlValue) value = fl_value_new_float(M_PI);
132 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT);
133 EXPECT_EQ(fl_value_get_float(value), M_PI);
134 }

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

## ◆ TEST() [28/107]

TEST | ( | FlValueTest | ,
|  | FloatToString |
| ) |  |

Definition at line 148 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [29/107]

TEST | ( | FlValueTest | ,
|  | FloatZero |
| ) |  |

Definition at line 112 of file fl_value_test.cc.

112 {
113 g_autoptr(FlValue) value = fl_value_new_float(0.0);
114 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_FLOAT);
115 EXPECT_EQ(fl_value_get_float(value), 0.0);
116 }

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

## ◆ TEST() [30/107]

TEST | ( | FlValueTest | ,
|  | Int32List |
| ) |  |

Definition at line 263 of file fl_value_test.cc.

263 {
264 int32_t data[] = {0, -1, G_MAXINT32, G_MININT32};
265 g_autoptr(FlValue) value = fl_value_new_int32_list(data, 4);
266 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT32_LIST);
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 }
fl_value_new_int32_list
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:309
fl_value_get_int32_list
G_MODULE_EXPORT const int32_t * fl_value_get_int32_list(FlValue *self)
Definition: fl_value.cc:696
FL_VALUE_TYPE_INT32_LIST
@ FL_VALUE_TYPE_INT32_LIST
Definition: fl_value.h:70

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.

## ◆ TEST() [31/107]

TEST | ( | FlValueTest | ,
|  | Int32ListEmptyEqual |
| ) |  |

Definition at line 288 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [32/107]

TEST | ( | FlValueTest | ,
|  | Int32ListEmptyNotEqual |
| ) |  |

Definition at line 310 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [33/107]

TEST | ( | FlValueTest | ,
|  | Int32ListEqual |
| ) |  |

Definition at line 280 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [34/107]

TEST | ( | FlValueTest | ,
|  | Int32ListInt64ListNotEqual |
| ) |  |

Definition at line 965 of file fl_value_test.cc.

965 {
966 int32_t data32[] = {0, 1, 2, 3, 4};
967 int64_t data64[] = {0, 1, 2, 3, 4};
968 g_autoptr(FlValue) value1 = fl_value_new_int32_list(data32, 5);
969 g_autoptr(FlValue) value2 = fl_value_new_int64_list(data64, 5);
970 EXPECT_FALSE(fl_value_equal(value1, value2));
971 }
fl_value_new_int64_list
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:319

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

## ◆ TEST() [35/107]

TEST | ( | FlValueTest | ,
|  | Int32ListNotEqualDifferentSize |
| ) |  |

Definition at line 302 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [36/107]

TEST | ( | FlValueTest | ,
|  | Int32ListNotEqualSameSize |
| ) |  |

Definition at line 294 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int32_list().

## ◆ TEST() [37/107]

TEST | ( | FlValueTest | ,
|  | Int32ListNullptr |
| ) |  |

Definition at line 274 of file fl_value_test.cc.

274 {
275 g_autoptr(FlValue) value = fl_value_new_int32_list(nullptr, 0);
276 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT32_LIST);
277 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
278 }

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

## ◆ TEST() [38/107]

TEST | ( | FlValueTest | ,
|  | Int32ListToString |
| ) |  |

Definition at line 317 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [39/107]

TEST | ( | FlValueTest | ,
|  | Int64List |
| ) |  |

Definition at line 324 of file fl_value_test.cc.

324 {
325 int64_t data[] = {0, -1, G_MAXINT64, G_MININT64};
326 g_autoptr(FlValue) value = fl_value_new_int64_list(data, 4);
327 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT64_LIST);
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 }
fl_value_get_int64_list
G_MODULE_EXPORT const int64_t * fl_value_get_int64_list(FlValue *self)
Definition: fl_value.cc:703
FL_VALUE_TYPE_INT64_LIST
@ FL_VALUE_TYPE_INT64_LIST
Definition: fl_value.h:71

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.

## ◆ TEST() [40/107]

TEST | ( | FlValueTest | ,
|  | Int64ListEmptyEqual |
| ) |  |

Definition at line 349 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [41/107]

TEST | ( | FlValueTest | ,
|  | Int64ListEmptyNotEqual |
| ) |  |

Definition at line 371 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [42/107]

TEST | ( | FlValueTest | ,
|  | Int64ListEqual |
| ) |  |

Definition at line 341 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [43/107]

TEST | ( | FlValueTest | ,
|  | Int64ListFloatListNotEqual |
| ) |  |

Definition at line 973 of file fl_value_test.cc.

973 {
974 int64_t data64[] = {0, 1, 2, 3, 4};
975 double dataf[] = {0.0, 1.0, 2.0, 3.0, 4.0};
976 g_autoptr(FlValue) value1 = fl_value_new_int64_list(data64, 5);
977 g_autoptr(FlValue) value2 = fl_value_new_float_list(dataf, 5);
978 EXPECT_FALSE(fl_value_equal(value1, value2));
979 }

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

## ◆ TEST() [44/107]

TEST | ( | FlValueTest | ,
|  | Int64ListNotEqualDifferentSize |
| ) |  |

Definition at line 363 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [45/107]

TEST | ( | FlValueTest | ,
|  | Int64ListNotEqualSameSize |
| ) |  |

Definition at line 355 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int64_list().

## ◆ TEST() [46/107]

TEST | ( | FlValueTest | ,
|  | Int64ListNullptr |
| ) |  |

Definition at line 335 of file fl_value_test.cc.

335 {
336 g_autoptr(FlValue) value = fl_value_new_int64_list(nullptr, 0);
337 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT64_LIST);
338 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
339 }

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

## ◆ TEST() [47/107]

TEST | ( | FlValueTest | ,
|  | Int64ListToString |
| ) |  |

Definition at line 378 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [48/107]

TEST | ( | FlValueTest | ,
|  | IntEqual |
| ) |  |

Definition at line 94 of file fl_value_test.cc.

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 }
fl_value_new_int
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:262

References fl_value_equal(), and fl_value_new_int().

## ◆ TEST() [49/107]

TEST | ( | FlValueTest | ,
|  | IntMax |
| ) |  |

Definition at line 88 of file fl_value_test.cc.

88 {
89 g_autoptr(FlValue) value = fl_value_new_int(G_MAXINT64);
90 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
91 EXPECT_EQ(fl_value_get_int(value), G_MAXINT64);
92 }
fl_value_get_int
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:668
FL_VALUE_TYPE_INT
@ FL_VALUE_TYPE_INT
Definition: fl_value.h:66

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

## ◆ TEST() [50/107]

TEST | ( | FlValueTest | ,
|  | IntMin |
| ) |  |

Definition at line 82 of file fl_value_test.cc.

82 {
83 g_autoptr(FlValue) value = fl_value_new_int(G_MININT64);
84 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
85 EXPECT_EQ(fl_value_get_int(value), G_MININT64);
86 }

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

## ◆ TEST() [51/107]

TEST | ( | FlValueTest | ,
|  | IntMinusOne |
| ) |  |

Definition at line 76 of file fl_value_test.cc.

76 {
77 g_autoptr(FlValue) value = fl_value_new_int(-1);
78 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
79 EXPECT_EQ(fl_value_get_int(value), -1);
80 }

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

## ◆ TEST() [52/107]

TEST | ( | FlValueTest | ,
|  | IntNotEqual |
| ) |  |

Definition at line 100 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_int().

## ◆ TEST() [53/107]

TEST | ( | FlValueTest | ,
|  | IntOne |
| ) |  |

Definition at line 70 of file fl_value_test.cc.

70 {
71 g_autoptr(FlValue) value = fl_value_new_int(1);
72 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
73 EXPECT_EQ(fl_value_get_int(value), 1);
74 }

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

## ◆ TEST() [54/107]

TEST | ( | FlValueTest | ,
|  | IntToString |
| ) |  |

Definition at line 106 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [55/107]

TEST | ( | FlValueTest | ,
|  | IntZero |
| ) |  |

Definition at line 64 of file fl_value_test.cc.

64 {
65 g_autoptr(FlValue) value = fl_value_new_int(0);
66 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_INT);
67 EXPECT_EQ(fl_value_get_int(value), 0);
68 }

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

## ◆ TEST() [56/107]

TEST | ( | FlValueTest | ,
|  | ListAdd |
| ) |  |

Definition at line 451 of file fl_value_test.cc.

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);
455 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
456 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
457 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 0)),
458 FL_VALUE_TYPE_NULL);
459 }
fl_value_get_list_value
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:776
fl_value_append
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
Definition: fl_value.cc:592
fl_value_new_list
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:349
FL_VALUE_TYPE_LIST
@ FL_VALUE_TYPE_LIST
Definition: fl_value.h:73

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.

## ◆ TEST() [57/107]

TEST | ( | FlValueTest | ,
|  | ListAddTake |
| ) |  |

Definition at line 461 of file fl_value_test.cc.

461 {
462 g_autoptr(FlValue) value = fl_value_new_list();
463 fl_value_append_take(value, fl_value_new_null());
464 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
465 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
466 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 0)),
467 FL_VALUE_TYPE_NULL);
468 }
fl_value_append_take
G_MODULE_EXPORT void fl_value_append_take(FlValue *self, FlValue *value)
Definition: fl_value.cc:600

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.

## ◆ TEST() [58/107]

TEST | ( | FlValueTest | ,
|  | ListChildTypes |
| ) |  |

Definition at line 470 of file fl_value_test.cc.

470 {
471 g_autoptr(FlValue) value = fl_value_new_list();
472 fl_value_append_take(value, fl_value_new_null());
473 fl_value_append_take(value, fl_value_new_bool(TRUE));
474 fl_value_append_take(value, fl_value_new_int(42));
475 fl_value_append_take(value, fl_value_new_float(M_PI));
476 fl_value_append_take(value, fl_value_new_uint8_list(nullptr, 0));
477 fl_value_append_take(value, fl_value_new_int32_list(nullptr, 0));
478 fl_value_append_take(value, fl_value_new_int64_list(nullptr, 0));
479 fl_value_append_take(value, fl_value_new_float_list(nullptr, 0));
480 fl_value_append_take(value, fl_value_new_list());
481 fl_value_append_take(value, fl_value_new_map());
482 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
483 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
484 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 0)),
485 FL_VALUE_TYPE_NULL);
486 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 1)),
487 FL_VALUE_TYPE_BOOL);
488 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 2)),
489 FL_VALUE_TYPE_INT);
490 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 3)),
491 FL_VALUE_TYPE_FLOAT);
492 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 4)),
493 FL_VALUE_TYPE_UINT8_LIST);
494 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 5)),
495 FL_VALUE_TYPE_INT32_LIST);
496 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 6)),
497 FL_VALUE_TYPE_INT64_LIST);
498 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 7)),
499 FL_VALUE_TYPE_FLOAT_LIST);
500 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 8)),
501 FL_VALUE_TYPE_LIST);
502 EXPECT_EQ(fl_value_get_type(fl_value_get_list_value(value, 9)),
503 FL_VALUE_TYPE_MAP);
504 }
fl_value_new_map
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:366
fl_value_new_uint8_list
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:292
FL_VALUE_TYPE_UINT8_LIST
@ FL_VALUE_TYPE_UINT8_LIST
Definition: fl_value.h:69
FL_VALUE_TYPE_MAP
@ FL_VALUE_TYPE_MAP
Definition: fl_value.h:74

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.

## ◆ TEST() [59/107]

TEST | ( | FlValueTest | ,
|  | ListEmpty |
| ) |  |

Definition at line 445 of file fl_value_test.cc.

445 {
446 g_autoptr(FlValue) value = fl_value_new_list();
447 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
448 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
449 }

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

## ◆ TEST() [60/107]

TEST | ( | FlValueTest | ,
|  | ListEmptyEqual |
| ) |  |

Definition at line 538 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_list().

## ◆ TEST() [61/107]

TEST | ( | FlValueTest | ,
|  | ListEmptyNotEqual |
| ) |  |

Definition at line 569 of file fl_value_test.cc.

569 {
570 g_autoptr(FlValue) value1 = fl_value_new_list();
571 g_autoptr(FlValue) value2 = fl_value_new_list();
572 fl_value_append_take(value2, fl_value_new_int(1));
573 fl_value_append_take(value2, fl_value_new_int(2));
574 fl_value_append_take(value2, fl_value_new_int(3));
575 EXPECT_FALSE(fl_value_equal(value1, value2));
576 }

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

## ◆ TEST() [62/107]

TEST | ( | FlValueTest | ,
|  | ListEqual |
| ) |  |

Definition at line 526 of file fl_value_test.cc.

526 {
527 g_autoptr(FlValue) value1 = fl_value_new_list();
528 fl_value_append_take(value1, fl_value_new_int(1));
529 fl_value_append_take(value1, fl_value_new_int(2));
530 fl_value_append_take(value1, fl_value_new_int(3));
531 g_autoptr(FlValue) value2 = fl_value_new_list();
532 fl_value_append_take(value2, fl_value_new_int(1));
533 fl_value_append_take(value2, fl_value_new_int(2));
534 fl_value_append_take(value2, fl_value_new_int(3));
535 EXPECT_TRUE(fl_value_equal(value1, value2));
536 }

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

## ◆ TEST() [63/107]

TEST | ( | FlValueTest | ,
|  | ListMapNotEqual |
| ) |  |

Definition at line 981 of file fl_value_test.cc.

981 {
982 g_autoptr(FlValue) value1 = fl_value_new_list();
983 g_autoptr(FlValue) value2 = fl_value_new_map();
984 EXPECT_FALSE(fl_value_equal(value1, value2));
985 }

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

## ◆ TEST() [64/107]

TEST | ( | FlValueTest | ,
|  | ListNotEqualDifferentSize |
| ) |  |

Definition at line 556 of file fl_value_test.cc.

556 {
557 g_autoptr(FlValue) value1 = fl_value_new_list();
558 fl_value_append_take(value1, fl_value_new_int(1));
559 fl_value_append_take(value1, fl_value_new_int(2));
560 fl_value_append_take(value1, fl_value_new_int(3));
561 g_autoptr(FlValue) value2 = fl_value_new_list();
562 fl_value_append_take(value2, fl_value_new_int(1));
563 fl_value_append_take(value2, fl_value_new_int(2));
564 fl_value_append_take(value2, fl_value_new_int(3));
565 fl_value_append_take(value2, fl_value_new_int(4));
566 EXPECT_FALSE(fl_value_equal(value1, value2));
567 }

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

## ◆ TEST() [65/107]

TEST | ( | FlValueTest | ,
|  | ListNotEqualSameSize |
| ) |  |

Definition at line 544 of file fl_value_test.cc.

544 {
545 g_autoptr(FlValue) value1 = fl_value_new_list();
546 fl_value_append_take(value1, fl_value_new_int(1));
547 fl_value_append_take(value1, fl_value_new_int(2));
548 fl_value_append_take(value1, fl_value_new_int(3));
549 g_autoptr(FlValue) value2 = fl_value_new_list();
550 fl_value_append_take(value2, fl_value_new_int(1));
551 fl_value_append_take(value2, fl_value_new_int(2));
552 fl_value_append_take(value2, fl_value_new_int(4));
553 EXPECT_FALSE(fl_value_equal(value1, value2));
554 }

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

## ◆ TEST() [66/107]

TEST | ( | FlValueTest | ,
|  | ListStrv |
| ) |  |

Definition at line 506 of file fl_value_test.cc.

506 {
507 g_auto(GStrv) words = g_strsplit("hello:world", ":", -1);
508 g_autoptr(FlValue) value = fl_value_new_list_from_strv(words);
509 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
510 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(2));
511 ASSERT_EQ(fl_value_get_type(fl_value_get_list_value(value, 0)),
512 FL_VALUE_TYPE_STRING);
513 EXPECT_STREQ(fl_value_get_string(fl_value_get_list_value(value, 0)), "hello");
514 ASSERT_EQ(fl_value_get_type(fl_value_get_list_value(value, 1)),
515 FL_VALUE_TYPE_STRING);
516 EXPECT_STREQ(fl_value_get_string(fl_value_get_list_value(value, 1)), "world");
517 }
fl_value_get_string
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:682
fl_value_new_list_from_strv
G_MODULE_EXPORT FlValue * fl_value_new_list_from_strv(const gchar *const *str_array)
Definition: fl_value.cc:356
FL_VALUE_TYPE_STRING
@ FL_VALUE_TYPE_STRING
Definition: fl_value.h:68

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.

## ◆ TEST() [67/107]

TEST | ( | FlValueTest | ,
|  | ListStrvEmpty |
| ) |  |

Definition at line 519 of file fl_value_test.cc.

519 {
520 g_auto(GStrv) words = g_strsplit("", ":", -1);
521 g_autoptr(FlValue) value = fl_value_new_list_from_strv(words);
522 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_LIST);
523 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
524 }

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

## ◆ TEST() [68/107]

TEST | ( | FlValueTest | ,
|  | ListToString |
| ) |  |

Definition at line 578 of file fl_value_test.cc.

578 {
579 g_autoptr(FlValue) value = fl_value_new_list();
580 fl_value_append_take(value, fl_value_new_null());
581 fl_value_append_take(value, fl_value_new_bool(TRUE));
582 fl_value_append_take(value, fl_value_new_int(42));
583 fl_value_append_take(value, fl_value_new_float(M_PI));
584 fl_value_append_take(value, fl_value_new_uint8_list(nullptr, 0));
585 fl_value_append_take(value, fl_value_new_int32_list(nullptr, 0));
586 fl_value_append_take(value, fl_value_new_int64_list(nullptr, 0));
587 fl_value_append_take(value, fl_value_new_float_list(nullptr, 0));
588 fl_value_append_take(value, fl_value_new_list());
589 fl_value_append_take(value, fl_value_new_map());
590 g_autofree gchar* text = fl_value_to_string(value);
591 EXPECT_STREQ(text,
592 "[null, true, 42, 3.1415926535897931, [], [], [], [], [], {}]");
593 }

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.

## ◆ TEST() [69/107]

TEST | ( | FlValueTest | ,
|  | MapEmpty |
| ) |  |

Definition at line 595 of file fl_value_test.cc.

595 {
596 g_autoptr(FlValue) value = fl_value_new_map();
597 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
598 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
599 }

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

## ◆ TEST() [70/107]

TEST | ( | FlValueTest | ,
|  | MapEmptyEqual |
| ) |  |

Definition at line 793 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_map().

## ◆ TEST() [71/107]

TEST | ( | FlValueTest | ,
|  | MapEmptyNotEqual |
| ) |  |

Definition at line 836 of file fl_value_test.cc.

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 }
fl_value_set_string_take
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:650

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

## ◆ TEST() [72/107]

TEST | ( | FlValueTest | ,
|  | MapEqual |
| ) |  |

Definition at line 769 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [73/107]

TEST | ( | FlValueTest | ,
|  | MapEqualDifferentOrder |
| ) |  |

Definition at line 781 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [74/107]

TEST | ( | FlValueTest | ,
|  | MapKeyTypes |
| ) |  |

Definition at line 727 of file fl_value_test.cc.

727 {
728 g_autoptr(FlValue) value = fl_value_new_map();
729 fl_value_set_take(value, fl_value_new_null(), fl_value_new_string("null"));
730 fl_value_set_take(value, fl_value_new_bool(TRUE),
731 fl_value_new_string("bool"));
732 fl_value_set_take(value, fl_value_new_int(42), fl_value_new_string("int"));
733 fl_value_set_take(value, fl_value_new_float(M_PI),
734 fl_value_new_string("float"));
735 fl_value_set_take(value, fl_value_new_uint8_list(nullptr, 0),
736 fl_value_new_string("uint8_list"));
737 fl_value_set_take(value, fl_value_new_int32_list(nullptr, 0),
738 fl_value_new_string("int32_list"));
739 fl_value_set_take(value, fl_value_new_int64_list(nullptr, 0),
740 fl_value_new_string("int64_list"));
741 fl_value_set_take(value, fl_value_new_float_list(nullptr, 0),
742 fl_value_new_string("float_list"));
743 fl_value_set_take(value, fl_value_new_list(), fl_value_new_string("list"));
744 fl_value_set_take(value, fl_value_new_map(), fl_value_new_string("map"));
745 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
746 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
747 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
748 FL_VALUE_TYPE_NULL);
749 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 1)),
750 FL_VALUE_TYPE_BOOL);
751 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 2)),
752 FL_VALUE_TYPE_INT);
753 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 3)),
754 FL_VALUE_TYPE_FLOAT);
755 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 4)),
756 FL_VALUE_TYPE_UINT8_LIST);
757 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 5)),
758 FL_VALUE_TYPE_INT32_LIST);
759 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 6)),
760 FL_VALUE_TYPE_INT64_LIST);
761 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 7)),
762 FL_VALUE_TYPE_FLOAT_LIST);
763 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 8)),
764 FL_VALUE_TYPE_LIST);
765 EXPECT_EQ(fl_value_get_type(fl_value_get_map_key(value, 9)),
766 FL_VALUE_TYPE_MAP);
767 }
fl_value_new_string
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:276
fl_value_set_take
G_MODULE_EXPORT void fl_value_set_take(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:618
fl_value_get_map_key
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
Definition: fl_value.cc:784

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.

## ◆ TEST() [75/107]

TEST | ( | FlValueTest | ,
|  | MapLookup |
| ) |  |

Definition at line 656 of file fl_value_test.cc.

656 {
657 g_autoptr(FlValue) value = fl_value_new_map();
658 fl_value_set_string_take(value, "one", fl_value_new_int(1));
659 fl_value_set_string_take(value, "two", fl_value_new_int(2));
660 fl_value_set_string_take(value, "three", fl_value_new_int(3));
661 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_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 }
fl_value_lookup
G_MODULE_EXPORT FlValue * fl_value_lookup(FlValue *self, FlValue *key)
Definition: fl_value.cc:800

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.

## ◆ TEST() [76/107]

TEST | ( | FlValueTest | ,
|  | MapLookupString |
| ) |  |

Definition at line 672 of file fl_value_test.cc.

672 {
673 g_autoptr(FlValue) value = fl_value_new_map();
674 fl_value_set_string_take(value, "one", fl_value_new_int(1));
675 fl_value_set_string_take(value, "two", fl_value_new_int(2));
676 fl_value_set_string_take(value, "three", fl_value_new_int(3));
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 }
fl_value_lookup_string
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
Definition: fl_value.cc:811

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.

## ◆ TEST() [77/107]

TEST | ( | FlValueTest | ,
|  | MapNotEqualDifferentSize |
| ) |  |

Definition at line 823 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [78/107]

TEST | ( | FlValueTest | ,
|  | MapNotEqualSameSizeDifferentKeys |
| ) |  |

Definition at line 799 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [79/107]

TEST | ( | FlValueTest | ,
|  | MapNotEqualSameSizeDifferentValues |
| ) |  |

Definition at line 811 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [80/107]

TEST | ( | FlValueTest | ,
|  | MapSet |
| ) |  |

Definition at line 601 of file fl_value_test.cc.

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);
606 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
607 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
608 ASSERT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
609 FL_VALUE_TYPE_STRING);
610 EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
611 ASSERT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
612 FL_VALUE_TYPE_INT);
613 EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
614 }
fl_value_get_map_value
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
Definition: fl_value.cc:792
fl_value_set
G_MODULE_EXPORT void fl_value_set(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:609

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.

## ◆ TEST() [81/107]

TEST | ( | FlValueTest | ,
|  | MapSetString |
| ) |  |

Definition at line 629 of file fl_value_test.cc.

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);
633 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
634 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
635 ASSERT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
636 FL_VALUE_TYPE_STRING);
637 EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
638 ASSERT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
639 FL_VALUE_TYPE_INT);
640 EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
641 }
fl_value_set_string
G_MODULE_EXPORT void fl_value_set_string(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:639

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.

## ◆ TEST() [82/107]

TEST | ( | FlValueTest | ,
|  | MapSetStringTake |
| ) |  |

Definition at line 643 of file fl_value_test.cc.

643 {
644 g_autoptr(FlValue) value = fl_value_new_map();
645 fl_value_set_string_take(value, "count", fl_value_new_int(42));
646 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
647 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
648 ASSERT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
649 FL_VALUE_TYPE_STRING);
650 EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
651 ASSERT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
652 FL_VALUE_TYPE_INT);
653 EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
654 }

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.

## ◆ TEST() [83/107]

TEST | ( | FlValueTest | ,
|  | MapSetTake |
| ) |  |

Definition at line 616 of file fl_value_test.cc.

616 {
617 g_autoptr(FlValue) value = fl_value_new_map();
618 fl_value_set_take(value, fl_value_new_string("count"), fl_value_new_int(42));
619 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
620 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(1));
621 ASSERT_EQ(fl_value_get_type(fl_value_get_map_key(value, 0)),
622 FL_VALUE_TYPE_STRING);
623 EXPECT_STREQ(fl_value_get_string(fl_value_get_map_key(value, 0)), "count");
624 ASSERT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
625 FL_VALUE_TYPE_INT);
626 EXPECT_EQ(fl_value_get_int(fl_value_get_map_value(value, 0)), 42);
627 }

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.

## ◆ TEST() [84/107]

TEST | ( | FlValueTest | ,
|  | MapToString |
| ) |  |

Definition at line 845 of file fl_value_test.cc.

845 {
846 g_autoptr(FlValue) value = fl_value_new_map();
847 fl_value_set_take(value, fl_value_new_string("null"), fl_value_new_null());
848 fl_value_set_take(value, fl_value_new_string("bool"),
849 fl_value_new_bool(TRUE));
850 fl_value_set_take(value, fl_value_new_string("int"), fl_value_new_int(42));
851 fl_value_set_take(value, fl_value_new_string("float"),
852 fl_value_new_float(M_PI));
853 fl_value_set_take(value, fl_value_new_string("uint8_list"),
854 fl_value_new_uint8_list(nullptr, 0));
855 fl_value_set_take(value, fl_value_new_string("int32_list"),
856 fl_value_new_int32_list(nullptr, 0));
857 fl_value_set_take(value, fl_value_new_string("int64_list"),
858 fl_value_new_int64_list(nullptr, 0));
859 fl_value_set_take(value, fl_value_new_string("float_list"),
860 fl_value_new_float_list(nullptr, 0));
861 fl_value_set_take(value, fl_value_new_string("list"), fl_value_new_list());
862 fl_value_set_take(value, fl_value_new_string("map"), fl_value_new_map());
863 fl_value_set_take(value, fl_value_new_null(), fl_value_new_string("null"));
864 fl_value_set_take(value, fl_value_new_bool(TRUE),
865 fl_value_new_string("bool"));
866 fl_value_set_take(value, fl_value_new_int(42), fl_value_new_string("int"));
867 fl_value_set_take(value, fl_value_new_float(M_PI),
868 fl_value_new_string("float"));
869 fl_value_set_take(value, fl_value_new_uint8_list(nullptr, 0),
870 fl_value_new_string("uint8_list"));
871 fl_value_set_take(value, fl_value_new_int32_list(nullptr, 0),
872 fl_value_new_string("int32_list"));
873 fl_value_set_take(value, fl_value_new_int64_list(nullptr, 0),
874 fl_value_new_string("int64_list"));
875 fl_value_set_take(value, fl_value_new_float_list(nullptr, 0),
876 fl_value_new_string("float_list"));
877 fl_value_set_take(value, fl_value_new_list(), fl_value_new_string("list"));
878 fl_value_set_take(value, fl_value_new_map(), fl_value_new_string("map"));
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 }

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.

## ◆ TEST() [85/107]

TEST | ( | FlValueTest | ,
|  | MapValueypes |
| ) |  |

Definition at line 685 of file fl_value_test.cc.

685 {
686 g_autoptr(FlValue) value = fl_value_new_map();
687 fl_value_set_take(value, fl_value_new_string("null"), fl_value_new_null());
688 fl_value_set_take(value, fl_value_new_string("bool"),
689 fl_value_new_bool(TRUE));
690 fl_value_set_take(value, fl_value_new_string("int"), fl_value_new_int(42));
691 fl_value_set_take(value, fl_value_new_string("float"),
692 fl_value_new_float(M_PI));
693 fl_value_set_take(value, fl_value_new_string("uint8_list"),
694 fl_value_new_uint8_list(nullptr, 0));
695 fl_value_set_take(value, fl_value_new_string("int32_list"),
696 fl_value_new_int32_list(nullptr, 0));
697 fl_value_set_take(value, fl_value_new_string("int64_list"),
698 fl_value_new_int64_list(nullptr, 0));
699 fl_value_set_take(value, fl_value_new_string("float_list"),
700 fl_value_new_float_list(nullptr, 0));
701 fl_value_set_take(value, fl_value_new_string("list"), fl_value_new_list());
702 fl_value_set_take(value, fl_value_new_string("map"), fl_value_new_map());
703 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_MAP);
704 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(10));
705 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 0)),
706 FL_VALUE_TYPE_NULL);
707 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 1)),
708 FL_VALUE_TYPE_BOOL);
709 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 2)),
710 FL_VALUE_TYPE_INT);
711 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 3)),
712 FL_VALUE_TYPE_FLOAT);
713 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 4)),
714 FL_VALUE_TYPE_UINT8_LIST);
715 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 5)),
716 FL_VALUE_TYPE_INT32_LIST);
717 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 6)),
718 FL_VALUE_TYPE_INT64_LIST);
719 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 7)),
720 FL_VALUE_TYPE_FLOAT_LIST);
721 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 8)),
722 FL_VALUE_TYPE_LIST);
723 EXPECT_EQ(fl_value_get_type(fl_value_get_map_value(value, 9)),
724 FL_VALUE_TYPE_MAP);
725 }

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.

## ◆ TEST() [86/107]

TEST | ( | FlValueTest | ,
|  | NullBoolNotEqual |
| ) |  |

Definition at line 944 of file fl_value_test.cc.

944 {
945 g_autoptr(FlValue) value1 = fl_value_new_bool(FALSE);
946 g_autoptr(FlValue) value2 = fl_value_new_int(0);
947 EXPECT_FALSE(fl_value_equal(value1, value2));
948 }

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

## ◆ TEST() [87/107]

TEST | ( | FlValueTest | ,
|  | NullEqual |
| ) |  |

Definition at line 16 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_null().

## ◆ TEST() [88/107]

TEST | ( | FlValueTest | ,
|  | NullIntNotEqual |
| ) |  |

Definition at line 938 of file fl_value_test.cc.

938 {
939 g_autoptr(FlValue) value1 = fl_value_new_null();
940 g_autoptr(FlValue) value2 = fl_value_new_int(0);
941 EXPECT_FALSE(fl_value_equal(value1, value2));
942 }

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

## ◆ TEST() [89/107]

TEST | ( | FlValueTest | ,
|  | NullToString |
| ) |  |

Definition at line 22 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [90/107]

TEST | ( | FlValueTest | ,
|  | String |
| ) |  |

Definition at line 154 of file fl_value_test.cc.

154 {
155 g_autoptr(FlValue) value = fl_value_new_string("hello");
156 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
157 EXPECT_STREQ(fl_value_get_string(value), "hello");
158 }

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

## ◆ TEST() [91/107]

TEST | ( | FlValueTest | ,
|  | StringEmpty |
| ) |  |

Definition at line 160 of file fl_value_test.cc.

160 {
161 g_autoptr(FlValue) value = fl_value_new_string("");
162 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
163 EXPECT_STREQ(fl_value_get_string(value), "");
164 }

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

## ◆ TEST() [92/107]

TEST | ( | FlValueTest | ,
|  | StringEqual |
| ) |  |

Definition at line 184 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_string().

## ◆ TEST() [93/107]

TEST | ( | FlValueTest | ,
|  | StringNotEqual |
| ) |  |

Definition at line 190 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_string().

## ◆ TEST() [94/107]

TEST | ( | FlValueTest | ,
|  | StringSized |
| ) |  |

Definition at line 166 of file fl_value_test.cc.

166 {
167 g_autoptr(FlValue) value = fl_value_new_string_sized("hello", 2);
168 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
169 EXPECT_STREQ(fl_value_get_string(value), "he");
170 }
fl_value_new_string_sized
G_MODULE_EXPORT FlValue * fl_value_new_string_sized(const gchar *value, size_t value_length)
Definition: fl_value.cc:283

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

## ◆ TEST() [95/107]

TEST | ( | FlValueTest | ,
|  | StringSizedNullptr |
| ) |  |

Definition at line 172 of file fl_value_test.cc.

172 {
173 g_autoptr(FlValue) value = fl_value_new_string_sized(nullptr, 0);
174 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
175 EXPECT_STREQ(fl_value_get_string(value), "");
176 }

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

## ◆ TEST() [96/107]

TEST | ( | FlValueTest | ,
|  | StringSizedZeroLength |
| ) |  |

Definition at line 178 of file fl_value_test.cc.

178 {
179 g_autoptr(FlValue) value = fl_value_new_string_sized("hello", 0);
180 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_STRING);
181 EXPECT_STREQ(fl_value_get_string(value), "");
182 }

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

## ◆ TEST() [97/107]

TEST | ( | FlValueTest | ,
|  | StringToString |
| ) |  |

Definition at line 196 of file fl_value_test.cc.

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 }

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

## ◆ TEST() [98/107]

TEST | ( | FlValueTest | ,
|  | StringUint8ListNotEqual |
| ) |  |

Definition at line 950 of file fl_value_test.cc.

950 {
951 uint8_t data[] = {'h', 'e', 'l', 'l', 'o'};
952 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data, 5);
953 g_autoptr(FlValue) value2 = fl_value_new_string("hello");
954 EXPECT_FALSE(fl_value_equal(value1, value2));
955 }

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

## ◆ TEST() [99/107]

TEST | ( | FlValueTest | ,
|  | Uint8List |
| ) |  |

Definition at line 202 of file fl_value_test.cc.

202 {
203 uint8_t data[] = {0x00, 0x01, 0xFE, 0xFF};
204 g_autoptr(FlValue) value = fl_value_new_uint8_list(data, 4);
205 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_UINT8_LIST);
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 }
fl_value_get_uint8_list
G_MODULE_EXPORT const uint8_t * fl_value_get_uint8_list(FlValue *self)
Definition: fl_value.cc:689

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.

## ◆ TEST() [100/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListEmptyEqual |
| ) |  |

Definition at line 227 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [101/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListEmptyNotEqual |
| ) |  |

Definition at line 249 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [102/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListEqual |
| ) |  |

Definition at line 219 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [103/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListInt32ListNotEqual |
| ) |  |

Definition at line 957 of file fl_value_test.cc.

957 {
958 uint8_t data8[] = {0, 1, 2, 3, 4};
959 int32_t data32[] = {0, 1, 2, 3, 4};
960 g_autoptr(FlValue) value1 = fl_value_new_uint8_list(data8, 5);
961 g_autoptr(FlValue) value2 = fl_value_new_int32_list(data32, 5);
962 EXPECT_FALSE(fl_value_equal(value1, value2));
963 }

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

## ◆ TEST() [104/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListNotEqualDifferentSize |
| ) |  |

Definition at line 241 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [105/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListNotEqualSameSize |
| ) |  |

Definition at line 233 of file fl_value_test.cc.

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 }

References fl_value_equal(), and fl_value_new_uint8_list().

## ◆ TEST() [106/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListNullptr |
| ) |  |

Definition at line 213 of file fl_value_test.cc.

213 {
214 g_autoptr(FlValue) value = fl_value_new_uint8_list(nullptr, 0);
215 ASSERT_EQ(fl_value_get_type(value), FL_VALUE_TYPE_UINT8_LIST);
216 ASSERT_EQ(fl_value_get_length(value), static_cast<size_t>(0));
217 }

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

## ◆ TEST() [107/107]

TEST | ( | FlValueTest | ,
|  | Uint8ListToString |
| ) |  |

Definition at line 256 of file fl_value_test.cc.

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 }

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