+// ------------ zero termianted buffer ---------------------------------------------------------
+static int ztbf_test() {
+ int errors = 0;
+ char buf[128];
+ char* sshort = "Stand up and cheer! Cheer long and loud for old Ohio.";
+ char* slong = "Now is the time for the bobcat in the forest to make its way back to Court St for a round of pints at the Pub.";
+ int l1;
+
+ l1 = zt_buf_fill( buf, sshort, 64 );
+ errors += fail_not_equal( l1, strlen( sshort ), "zt_buf_fill of short buf returned unexpected len" );
+ errors += fail_not_equal( l1, strlen( buf ), "zt_buf_fill of short buf returned len did not match strlen" );
+
+ l1 = zt_buf_fill( buf, slong, 64 );
+ errors += fail_if_equal( l1, strlen( slong ), "zt_buf_fill of long buf returned unexpected len" );
+ errors += fail_not_equal( l1, strlen( buf ), "zt_buf_fill of long buf returned len did not match strlen" );
+
+ l1 = zt_buf_fill( buf, sshort, strlen( sshort ) ); // edge case of exact size
+ errors += fail_not_equal( l1, strlen( sshort )-1, "zt_buf_fill exact length edge case failed" );
+
+ l1 = zt_buf_fill( buf, sshort, 1 ); // unrealistic edge case
+ errors += fail_not_equal( l1, 0, "zt_buf_fill dest len == 1 test failed" );
+
+ return errors;
+}
+