Rename HB_VERSION_CHECK and hb_version_check to "atleast"
HB_VERSION_CHECK's comparison was originally written wrongly by mistake. When API tests were written, they were also written wrongly to pass given the wrong implementation... Sigh. Given the purpose of this API, there's no point in fixing it without renaming it. As such, rename. API changes: HB_VERSION_CHECK -> HB_VERSION_ATLEAST hb_version_check -> hb_version_atleast
This commit is contained in:
parent
cabfa538ed
commit
2b051c6057
|
@ -487,12 +487,12 @@ hb_uniscribe_font_get_logfontw
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>hb-version</FILE>
|
<FILE>hb-version</FILE>
|
||||||
HB_VERSION_CHECK
|
HB_VERSION_ATLEAST
|
||||||
HB_VERSION_MAJOR
|
HB_VERSION_MAJOR
|
||||||
HB_VERSION_MICRO
|
HB_VERSION_MICRO
|
||||||
HB_VERSION_MINOR
|
HB_VERSION_MINOR
|
||||||
HB_VERSION_STRING
|
HB_VERSION_STRING
|
||||||
hb_version
|
hb_version
|
||||||
hb_version_check
|
hb_version_atleast
|
||||||
hb_version_string
|
hb_version_string
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
|
@ -569,7 +569,7 @@ hb_version_string (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hb_version_check:
|
* hb_version_atleast:
|
||||||
* @major:
|
* @major:
|
||||||
* @minor:
|
* @minor:
|
||||||
* @micro:
|
* @micro:
|
||||||
|
@ -581,9 +581,9 @@ hb_version_string (void)
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
**/
|
**/
|
||||||
hb_bool_t
|
hb_bool_t
|
||||||
hb_version_check (unsigned int major,
|
hb_version_atleast (unsigned int major,
|
||||||
unsigned int minor,
|
unsigned int minor,
|
||||||
unsigned int micro)
|
unsigned int micro)
|
||||||
{
|
{
|
||||||
return HB_VERSION_CHECK (major, minor, micro);
|
return HB_VERSION_ATLEAST (major, minor, micro);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@ HB_BEGIN_DECLS
|
||||||
|
|
||||||
#define HB_VERSION_STRING "@HB_VERSION@"
|
#define HB_VERSION_STRING "@HB_VERSION@"
|
||||||
|
|
||||||
#define HB_VERSION_CHECK(major,minor,micro) \
|
#define HB_VERSION_ATLEAST(major,minor,micro) \
|
||||||
((major)*10000+(minor)*100+(micro) >= \
|
((major)*10000+(minor)*100+(micro) <= \
|
||||||
HB_VERSION_MAJOR*10000+HB_VERSION_MINOR*100+HB_VERSION_MICRO)
|
HB_VERSION_MAJOR*10000+HB_VERSION_MINOR*100+HB_VERSION_MICRO)
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,9 +56,9 @@ const char *
|
||||||
hb_version_string (void);
|
hb_version_string (void);
|
||||||
|
|
||||||
hb_bool_t
|
hb_bool_t
|
||||||
hb_version_check (unsigned int major,
|
hb_version_atleast (unsigned int major,
|
||||||
unsigned int minor,
|
unsigned int minor,
|
||||||
unsigned int micro);
|
unsigned int micro);
|
||||||
|
|
||||||
|
|
||||||
HB_END_DECLS
|
HB_END_DECLS
|
||||||
|
|
|
@ -46,27 +46,28 @@ test_version (void)
|
||||||
g_free (s);
|
g_free (s);
|
||||||
g_assert (0 == strcmp (HB_VERSION_STRING, hb_version_string ()));
|
g_assert (0 == strcmp (HB_VERSION_STRING, hb_version_string ()));
|
||||||
|
|
||||||
g_assert (HB_VERSION_CHECK (major, minor, micro));
|
g_assert (HB_VERSION_ATLEAST (major, minor, micro));
|
||||||
g_assert (HB_VERSION_CHECK (major+1, minor, micro));
|
|
||||||
g_assert (HB_VERSION_CHECK (major, minor+1, micro));
|
|
||||||
g_assert (HB_VERSION_CHECK (major, minor, micro+1));
|
|
||||||
if (major)
|
if (major)
|
||||||
g_assert (!HB_VERSION_CHECK (major-1, minor, micro));
|
g_assert (HB_VERSION_ATLEAST (major-1, minor, micro));
|
||||||
if (minor)
|
if (minor)
|
||||||
g_assert (!HB_VERSION_CHECK (major, minor-1, micro));
|
g_assert (HB_VERSION_ATLEAST (major, minor-1, micro));
|
||||||
if (micro)
|
if (micro)
|
||||||
g_assert (!HB_VERSION_CHECK (major, minor, micro-1));
|
g_assert (HB_VERSION_ATLEAST (major, minor, micro-1));
|
||||||
|
g_assert (!HB_VERSION_ATLEAST (major+1, minor, micro));
|
||||||
|
g_assert (!HB_VERSION_ATLEAST (major, minor+1, micro));
|
||||||
|
g_assert (!HB_VERSION_ATLEAST (major, minor, micro+1));
|
||||||
|
g_assert (!HB_VERSION_ATLEAST (major, minor, micro+1));
|
||||||
|
|
||||||
g_assert (hb_version_check (major, minor, micro));
|
g_assert (hb_version_atleast (major, minor, micro));
|
||||||
g_assert (hb_version_check (major+1, minor, micro));
|
|
||||||
g_assert (hb_version_check (major, minor+1, micro));
|
|
||||||
g_assert (hb_version_check (major, minor, micro+1));
|
|
||||||
if (major)
|
if (major)
|
||||||
g_assert (!hb_version_check (major-1, minor, micro));
|
g_assert (hb_version_atleast (major-1, minor, micro));
|
||||||
if (minor)
|
if (minor)
|
||||||
g_assert (!hb_version_check (major, minor-1, micro));
|
g_assert (hb_version_atleast (major, minor-1, micro));
|
||||||
if (micro)
|
if (micro)
|
||||||
g_assert (!hb_version_check (major, minor, micro-1));
|
g_assert (hb_version_atleast (major, minor, micro-1));
|
||||||
|
g_assert (!hb_version_atleast (major+1, minor, micro));
|
||||||
|
g_assert (!hb_version_atleast (major, minor+1, micro));
|
||||||
|
g_assert (!hb_version_atleast (major, minor, micro+1));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in New Issue