[xiph-commits] r8316 - trunk/oggdsf/src/tests/testCMMLParser

illiminable at motherfish-iii.xiph.org illiminable at motherfish-iii.xiph.org
Tue Nov 30 08:05:09 PST 2004


Author: illiminable
Date: 2004-11-30 08:05:09 -0800 (Tue, 30 Nov 2004)
New Revision: 8316

Modified:
   trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp
Log:
* Added some tests for clip tags.

Modified: trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp	2004-11-30 15:53:29 UTC (rev 8315)
+++ trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp	2004-11-30 16:05:09 UTC (rev 8316)
@@ -27,6 +27,24 @@
 	return locWasOK;
 }
 
+bool testClipParse(wstring inClipString) {
+	CMMLParser locParser;
+
+	wcout << "Original"<<endl<<inClipString<<endl<<endl;
+
+	C_ClipTag locClip;
+	
+	bool locWasOK = locParser.parseClipTag(inClipString, &locClip);
+
+	if (locWasOK) {
+		wcout<<"Parsed OK"<<endl<<endl<<locClip.toString()<<endl<<endl;
+	} else {
+		wcout<<"*** PARSE FAILED ***"<<endl<<endl;
+	}
+
+	return locWasOK;
+}
+
 int __cdecl _tmain(int argc, _TCHAR* argv[])
 {
 	//Valid minimal
@@ -52,6 +70,23 @@
 	//INVALID: Missing closing xml tag on option element.
 	wstring head_6 = L"<head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><title lang=\"fr\">Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"></head>";
 	testHeadParse(head_6);
+
+
+
+	wstring clip_1 = L"<clip id=\"dolphin\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img src=\"dolphin.jpg\"/><desc>Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
+	testClipParse(clip_1);
+
+	wstring clip_2 = L"asdjhaskdljfhksladf";
+	testClipParse(clip_2);
+
+	wstring clip_3 = L"<blue><red>random stuff</red><green>But still valid XML</green></blue>";
+	testClipParse(clip_3);
+
+	wstring clip_4 = L"<clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
+	testClipParse(clip_4);
+
+	wstring clip_5 = L"<clip id=\"dolphin\" start=\"npt:3.5\" end=\"npt:5:5.9\"><a href\"http:\\linktome.com\" class=\"someClass\">Random anchor text</a><img src=\"dolphin.jpg\"/><desc>Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
+	testClipParse(clip_5);
 	return 0;
 }
 



More information about the commits mailing list