Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: third_party/grpc/test/core/end2end/cq_verifier.h

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/grpc/test/core/end2end/README ('k') | third_party/grpc/test/core/end2end/cq_verifier.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/test/core/end2end/cq_verifier.h
diff --git a/third_party/tcmalloc/vendor/src/base/spinlock_internal.h b/third_party/grpc/test/core/end2end/cq_verifier.h
similarity index 55%
copy from third_party/tcmalloc/vendor/src/base/spinlock_internal.h
copy to third_party/grpc/test/core/end2end/cq_verifier.h
index 44942609f40a87492a7aeed0068a5e27bf9cd157..b3e07c45a58e86f3eab30265ba9782321e24539b 100644
--- a/third_party/tcmalloc/vendor/src/base/spinlock_internal.h
+++ b/third_party/grpc/test/core/end2end/cq_verifier.h
@@ -1,4 +1,6 @@
-/* Copyright (c) 2010, Google Inc.
+/*
+ *
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,38 +29,38 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * ---
- * This file is an internal part spinlock.cc and once.cc
- * It may not be used directly by code outside of //base.
*/
-#ifndef BASE_SPINLOCK_INTERNAL_H_
-#define BASE_SPINLOCK_INTERNAL_H_
+#ifndef GRPC_TEST_CORE_END2END_CQ_VERIFIER_H
+#define GRPC_TEST_CORE_END2END_CQ_VERIFIER_H
+
+#include <grpc/grpc.h>
+#include "test/core/util/test_config.h"
+
+/* A cq_verifier can verify that expected events arrive in a timely fashion
+ on a single completion queue */
+
+typedef struct cq_verifier cq_verifier;
+
+/* construct/destroy a cq_verifier */
+cq_verifier *cq_verifier_create(grpc_completion_queue *cq);
+void cq_verifier_destroy(cq_verifier *v);
-#include <config.h>
-#include "base/basictypes.h"
-#include "base/atomicops.h"
+/* ensure all expected events (and only those events) are present on the
+ bound completion queue */
+void cq_verify(cq_verifier *v);
-namespace base {
-namespace internal {
+/* ensure that the completion queue is empty */
+void cq_verify_empty(cq_verifier *v);
-// SpinLockWait() waits until it can perform one of several transitions from
-// "from" to "to". It returns when it performs a transition where done==true.
-struct SpinLockWaitTransition {
- int32 from;
- int32 to;
- bool done;
-};
+/* Various expectation matchers
+ Any functions taking ... expect a NULL terminated list of key/value pairs
+ (each pair using two parameter slots) of metadata that MUST be present in
+ the event. */
+void cq_expect_completion(cq_verifier *v, void *tag, int success);
-// Wait until *w can transition from trans[i].from to trans[i].to for some i
-// satisfying 0<=i<n && trans[i].done, atomically make the transition,
-// then return the old value of *w. Make any other atomic tranistions
-// where !trans[i].done, but continue waiting.
-int32 SpinLockWait(volatile Atomic32 *w, int n,
- const SpinLockWaitTransition trans[]);
-void SpinLockWake(volatile Atomic32 *w, bool all);
-void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop);
+int byte_buffer_eq_string(grpc_byte_buffer *byte_buffer, const char *string);
+int contains_metadata(grpc_metadata_array *array, const char *key,
+ const char *value);
-} // namespace internal
-} // namespace base
-#endif
+#endif /* GRPC_TEST_CORE_END2END_CQ_VERIFIER_H */
« no previous file with comments | « third_party/grpc/test/core/end2end/README ('k') | third_party/grpc/test/core/end2end/cq_verifier.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698