Skip to content

Instantly share code, notes, and snippets.

@balazs
Created April 25, 2014 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balazs/11273657 to your computer and use it in GitHub Desktop.
Save balazs/11273657 to your computer and use it in GitHub Desktop.
diff --git a/Source/wtf/Dummy.cpp b/Source/wtf/Dummy.cpp
new file mode 100644
index 0000000..55d5f66
--- /dev/null
+++ b/Source/wtf/Dummy.cpp
@@ -0,0 +1,48 @@
+#include "config.h"
+
+#include "wtf/RefPtr.h"
+#include "wtf/HashMap.h"
+#include "wtf/text/WTFString.h"
+#include "wtf/text/StringHash.h"
+
+namespace WTF {
+
+bool dummy1()
+{
+ HashMap<int, void*> m;
+ m.add(0, 0);
+ return m.contains(1);
+}
+
+bool dummy2()
+{
+ HashMap<String, String*> m;
+ m.add(String("a"), new String("a"));
+ return m.contains(String("a"));
+}
+
+#if 0
+struct MyNonPOD {
+ virtual ~MyNonPOD();
+ int d;
+};
+
+MyNonPOD::~MyNonPOD()
+{
+ d = 0;
+}
+
+struct MyPODHash {
+ static unsigned hash(const MyPod& p) { return p.d; }
+ static bool equal(const MyPod& a, const MyPod& b) { return a.d == b.d; }
+ static const bool safeToCompareEmptyOrDeleted = false;
+};
+
+bool dummy3()
+{
+ HashMap<int, RefPtr<Dummy> > m;
+ m.add(0, adoptPtr())
+}
+#endif
+
+}
diff --git a/Source/wtf/wtf.gypi b/Source/wtf/wtf.gypi
index cdbcfdd..cdc2506 100644
--- a/Source/wtf/wtf.gypi
+++ b/Source/wtf/wtf.gypi
@@ -2,6 +2,7 @@
{
'variables': {
'wtf_files': [
+ 'Dummy.cpp',
'ASCIICType.h',
'Alignment.h',
'ArrayBuffer.cpp',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment