Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/compiled/String.cpp

Issue 29680720: Issue 6221 - Add native tests. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Jan. 26, 2018, 8:49 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/compiled/String.cpp
===================================================================
new file mode 100644
--- /dev/null
+++ b/test/compiled/String.cpp
@@ -0,0 +1,34 @@
+
+#include <string>
+
sergei 2018/01/26 22:13:36 Could you please remove the empty lines and add th
hub 2018/01/27 03:33:37 Done.
+#include "gtest/gtest.h"
+
+#include "compiled/String.h"
+
+TEST(TestString, DependentString)
+{
+ DependentString s;
+ EXPECT_TRUE(s.is_invalid());
+
+ DependentString s2(s);
+ EXPECT_TRUE(s2.is_invalid());
+}
+
+TEST(TestString, OwnedString)
+{
+ OwnedString s;
+ EXPECT_TRUE(s.is_invalid());
+
+ // Valid string
+ OwnedString s2(2);
+ EXPECT_FALSE(s2.is_invalid());
+
+ // Ensure we still have an invalid string.
+ OwnedString s3(s);
+ EXPECT_TRUE(s3.is_invalid());
+
+ // Empty valid string lead to valid string.
+ OwnedString s4(u""_str);
+ EXPECT_FALSE(s4.is_invalid());
+}
+

Powered by Google App Engine
This is Rietveld