--- /dev/null
+// Unit Test Framework Includes
+#include "atf.h"
+
+// File To Test
+#include <carl.h>
+
+//-----------------------------------------------------------------------------
+// Begin Unit Tests
+//-----------------------------------------------------------------------------
+TEST_SUITE(RuneFns) {
+ TEST(Verify runecmp returns -1 when b is less than a) {
+ CHECK(-1 == runecmp('a','b'));
+ }
+
+ TEST(Verify runecmp returns 1 when a is less than b) {
+ }
+
+ TEST(Verify runecmp returns 0 when two runes are equal) {
+ }
+}
// Begin Unit Tests
//-----------------------------------------------------------------------------
TEST_SUITE(UnicodeData) {
- TEST(Verify_runetype_functions) {
+ TEST(Verify_generated_rune_functions) {
codept_t cp;
FILE* db = fopen(database, "r");
while(read_codepoint(&cp, db)) {
isrune_fn_t* fns = lookup_codepoint(&cp);
+ /* Verify the type functions work as expected */
while(fns && *fns) {
- /* Verify the type function works as expected */
CHECK((*fns)(cp.value));
- /* Verify toupper works if necessary */
- if (cp.toupper > 0)
- CHECK( cp.toupper == toupperrune(cp.value) );
- /* Verify tolower works if necessary */
- if (cp.tolower > 0)
- CHECK( cp.tolower == tolowerrune(cp.value) );
- /* Verify toupper works if necessary */
- if (cp.totitle > 0)
- CHECK( cp.totitle == totitlerune(cp.value) );
fns++;
}
+ /* Verify toupper works if necessary */
+ if (cp.toupper > 0)
+ CHECK( cp.toupper == toupperrune(cp.value) );
+ /* Verify tolower works if necessary */
+ if (cp.tolower > 0)
+ CHECK( cp.tolower == tolowerrune(cp.value) );
+ /* Verify toupper works if necessary */
+ if (cp.totitle > 0)
+ CHECK( cp.totitle == totitlerune(cp.value) );
free_codepoint(&cp);
}
fclose(db);