/* basic_types_gassert.c generated by valac, the Vala compiler * generated from basic_types_gassert.vala, do not modify */ #include #include #include #if !defined(VALA_EXTERN) #if defined(_WIN32) || defined(__CYGWIN__) #define VALA_EXTERN __declspec(dllexport) extern #elif __GNUC__ >= 4 #define VALA_EXTERN __attribute__((visibility("default"))) extern #else #define VALA_EXTERN extern #endif #endif VALA_EXTERN void test_assert_cmpstr (void); VALA_EXTERN void test_assert_cmpint (void); VALA_EXTERN void test_assert_cmpuint (void); VALA_EXTERN void test_assert_cmphex (void); VALA_EXTERN void test_assert_cmpfloat (void); static void _vala_main (void); void test_assert_cmpstr (void) { g_assert_cmpstr (NULL, ==, NULL); g_assert_cmpstr ("", >, NULL); g_assert_cmpstr (NULL, <, ""); g_assert_cmpstr (NULL, <, ""); g_assert_cmpstr (NULL, !=, "some non-null, non-empty string"); g_assert_cmpstr (NULL, <, "some non-null, non-empty string"); g_assert_cmpstr (NULL, <=, "some non-null, non-empty string"); g_assert_cmpstr ("some non-null, non-empty string", !=, NULL); g_assert_cmpstr ("some non-null, non-empty string", >, NULL); g_assert_cmpstr ("some non-null, non-empty string", >=, NULL); g_assert_cmpstr ("0", <, "1"); g_assert_cmpstr ("0", <=, "1"); g_assert_cmpstr ("1", <=, "1"); g_assert_cmpstr ("2", ==, "2"); g_assert_cmpstr ("3", >=, "3"); g_assert_cmpstr ("4", >=, "3"); g_assert_cmpstr ("4", >, "3"); g_assert_cmpstr ("4", !=, "3"); } void test_assert_cmpint (void) { g_assert_cmpint (0, <, 1); g_assert_cmpint (0, !=, 1); g_assert_cmpint (0, <=, 1); g_assert_cmpint (1, <=, 1); g_assert_cmpint (1, ==, 1); g_assert_cmpint (1, >=, 1); g_assert_cmpint (2, >=, 1); g_assert_cmpint (2, >, 1); g_assert_cmpint (-1, >, -2); g_assert_cmpint (-1, !=, -2); g_assert_cmpint (-1, >=, -2); g_assert_cmpint (-2, >=, -2); g_assert_cmpint (-2, ==, -2); g_assert_cmpint (-2, <=, -2); g_assert_cmpint (-3, <=, -2); g_assert_cmpint (-3, <, -2); g_assert_cmpint (-100, <, 101); g_assert_cmpint (-100, !=, 101); g_assert_cmpint (-100, <=, 101); g_assert_cmpint (-101, <=, 101); g_assert_cmpint (101, >=, -101); g_assert_cmpint (102, >=, -101); g_assert_cmpint (102, >, -101); } void test_assert_cmpuint (void) { g_assert_cmpuint (0U, <, 1U); g_assert_cmpuint (0U, !=, 1U); g_assert_cmpuint (0U, <=, 1U); g_assert_cmpuint (1U, <=, 1U); g_assert_cmpuint (1U, ==, 1U); g_assert_cmpuint (1U, >=, 1U); g_assert_cmpuint (2U, >=, 1U); g_assert_cmpuint (2U, >, 1U); } void test_assert_cmphex (void) { g_assert_cmphex ((guint) 0x0, <, (guint) 0x1); g_assert_cmphex ((guint) 0x0, !=, (guint) 0x1); g_assert_cmphex ((guint) 0x0, <=, (guint) 0x1); g_assert_cmphex ((guint) 0x1, <=, (guint) 0x1); g_assert_cmphex ((guint) 0x1, ==, (guint) 0x1); g_assert_cmphex ((guint) 0x1, >=, (guint) 0x1); g_assert_cmphex ((guint) 0x2, >=, (guint) 0x1); g_assert_cmphex ((guint) 0x2, >, (guint) 0x1); } void test_assert_cmpfloat (void) { g_assert_cmpfloat ((gdouble) 0.0f, <, (gdouble) 1.0f); g_assert_cmpfloat ((gdouble) 0.0f, !=, (gdouble) 1.0f); g_assert_cmpfloat ((gdouble) 0.0f, <=, (gdouble) 1.0f); g_assert_cmpfloat ((gdouble) 1.0f, <=, (gdouble) 1.0f); g_assert_cmpfloat ((gdouble) 1.0f, ==, (gdouble) 1.0f); g_assert_cmpfloat ((gdouble) 1.0f, >=, (gdouble) 1.0f); g_assert_cmpfloat ((gdouble) 2.0f, >=, (gdouble) 1.0f); g_assert_cmpfloat ((gdouble) 2.0f, >, (gdouble) 1.0f); g_assert_cmpfloat ((gdouble) (-1.0f), >, (gdouble) (-2.0f)); g_assert_cmpfloat ((gdouble) (-1.0f), !=, (gdouble) (-2.0f)); g_assert_cmpfloat ((gdouble) (-1.0f), >=, (gdouble) (-2.0f)); g_assert_cmpfloat ((gdouble) (-2.0f), >=, (gdouble) (-2.0f)); g_assert_cmpfloat ((gdouble) (-2.0f), ==, (gdouble) (-2.0f)); g_assert_cmpfloat ((gdouble) (-2.0f), <=, (gdouble) (-2.0f)); g_assert_cmpfloat ((gdouble) (-3.0f), <=, (gdouble) (-2.0f)); g_assert_cmpfloat ((gdouble) (-3.0f), <, (gdouble) (-2.0f)); g_assert_cmpfloat ((gdouble) (-100.0f), <, (gdouble) 101.0f); g_assert_cmpfloat ((gdouble) (-100.0f), !=, (gdouble) 101.0f); g_assert_cmpfloat ((gdouble) (-100.0f), <=, (gdouble) 101.0f); g_assert_cmpfloat ((gdouble) (-101.0f), <=, (gdouble) 101.0f); g_assert_cmpfloat ((gdouble) 101.0f, >=, (gdouble) (-101.0f)); g_assert_cmpfloat ((gdouble) 102.0f, >=, (gdouble) (-101.0f)); g_assert_cmpfloat ((gdouble) 102.0f, >, (gdouble) (-101.0f)); } static void _vala_main (void) { test_assert_cmpstr (); test_assert_cmpint (); test_assert_cmpuint (); test_assert_cmphex (); test_assert_cmpfloat (); } int main (int argc, char ** argv) { _vala_main (); return 0; }