X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=inline;f=tests%2Fversion.c;h=2b0faff3496d36183b9ad218611f11f90d9e3c89;hb=b6c6daa1bcb9a3a065229a21d77175a8d658a61e;hp=ba91ddee4684e51bcbf8ad07b23cf6570f76538b;hpb=3cc2028382637283884d03af7893003d85c9818a;p=libsigrok.git
diff --git a/tests/version.c b/tests/version.c
index ba91ddee..2b0faff3 100644
--- a/tests/version.c
+++ b/tests/version.c
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#include
@@ -71,27 +70,31 @@ END_TEST
*
* The upper limit assumes:
* - The major, minor, and micro parts won't contain more than two
- * digits each (this is an arbitrary choice).
+ * digits each (this is an arbitrary choice). The three numbers
+ * are separated by a period character.
* - An optional "-git-" suffix might follow. While git(1)
* defaults to 7 hex digits for abbreviated hashes, projects of
* larger scale might recommend to use more digits to avoid
* potential ambiguity (e.g. Linux recommends core.abbrev=12).
* Again, this is an arbitrary choice.
+ * - An optional "-dirty" suffix might follow.
*/
START_TEST(test_version_strings)
{
const char *str;
const size_t len_min = 5;
- const size_t len_max = 2 + 1 + 2 + 1 + 2 + 5 + 12;
+ const size_t len_max = 2 + 1 + 2 + 1 + 2 + 5 + 12 + 6;
str = sr_package_version_string_get();
fail_unless(str != NULL);
fail_unless(strlen(str) >= len_min);
- fail_unless(strlen(str) <= len_max);
+ fail_unless(strlen(str) <= len_max,
+ "Max len exceeded, max %zu, text %s", len_max, str);
str = sr_lib_version_string_get();
fail_unless(str != NULL);
fail_unless(strlen(str) >= len_min);
- fail_unless(strlen(str) <= len_max);
+ fail_unless(strlen(str) <= len_max,
+ "Max len exceeded, max %zu, text %s", len_max, str);
}
END_TEST