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:
Behdad Esfahbod 2014-06-20 14:09:57 -04:00
parent cabfa538ed
commit 2b051c6057
4 changed files with 27 additions and 26 deletions

View File

@ -487,12 +487,12 @@ hb_uniscribe_font_get_logfontw
<SECTION>
<FILE>hb-version</FILE>
HB_VERSION_CHECK
HB_VERSION_ATLEAST
HB_VERSION_MAJOR
HB_VERSION_MICRO
HB_VERSION_MINOR
HB_VERSION_STRING
hb_version
hb_version_check
hb_version_atleast
hb_version_string
</SECTION>

View File

@ -569,7 +569,7 @@ hb_version_string (void)
}
/**
* hb_version_check:
* hb_version_atleast:
* @major:
* @minor:
* @micro:
@ -581,9 +581,9 @@ hb_version_string (void)
* Since: 1.0
**/
hb_bool_t
hb_version_check (unsigned int major,
hb_version_atleast (unsigned int major,
unsigned int minor,
unsigned int micro)
{
return HB_VERSION_CHECK (major, minor, micro);
return HB_VERSION_ATLEAST (major, minor, micro);
}

View File

@ -42,8 +42,8 @@ HB_BEGIN_DECLS
#define HB_VERSION_STRING "@HB_VERSION@"
#define HB_VERSION_CHECK(major,minor,micro) \
((major)*10000+(minor)*100+(micro) >= \
#define HB_VERSION_ATLEAST(major,minor,micro) \
((major)*10000+(minor)*100+(micro) <= \
HB_VERSION_MAJOR*10000+HB_VERSION_MINOR*100+HB_VERSION_MICRO)
@ -56,7 +56,7 @@ const char *
hb_version_string (void);
hb_bool_t
hb_version_check (unsigned int major,
hb_version_atleast (unsigned int major,
unsigned int minor,
unsigned int micro);

View File

@ -46,27 +46,28 @@ test_version (void)
g_free (s);
g_assert (0 == strcmp (HB_VERSION_STRING, hb_version_string ()));
g_assert (HB_VERSION_CHECK (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));
g_assert (HB_VERSION_ATLEAST (major, minor, micro));
if (major)
g_assert (!HB_VERSION_CHECK (major-1, minor, micro));
g_assert (HB_VERSION_ATLEAST (major-1, minor, micro));
if (minor)
g_assert (!HB_VERSION_CHECK (major, minor-1, micro));
g_assert (HB_VERSION_ATLEAST (major, minor-1, 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_check (major+1, minor, micro));
g_assert (hb_version_check (major, minor+1, micro));
g_assert (hb_version_check (major, minor, micro+1));
g_assert (hb_version_atleast (major, minor, micro));
if (major)
g_assert (!hb_version_check (major-1, minor, micro));
g_assert (hb_version_atleast (major-1, minor, micro));
if (minor)
g_assert (!hb_version_check (major, minor-1, micro));
g_assert (hb_version_atleast (major, minor-1, 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