LCOV - code coverage report
Current view: directory - src/trusted/interval_multiset - nacl_interval_multiset_factory.c (source / functions) Found Hit Coverage
Test: coverage.lcov Lines: 6 5 83.3 %
Date: 2014-09-25 Functions: 0 0 -

       1                 : /*
       2                 :  * Copyright (c) 2012 The Native Client Authors. All rights reserved.
       3                 :  * Use of this source code is governed by a BSD-style license that can be
       4                 :  * found in the LICENSE file.
       5                 :  */
       6                 : 
       7                 : #include <string.h>
       8                 : 
       9                 : #include "native_client/src/trusted/interval_multiset/nacl_interval_list.h"
      10                 : #include "native_client/src/trusted/interval_multiset/nacl_interval_list_intern.h"
      11                 : #include "native_client/src/trusted/interval_multiset/nacl_interval_multiset.h"
      12                 : #include "native_client/src/trusted/interval_multiset/nacl_interval_range_tree.h"
      13                 : #include "native_client/src/trusted/interval_multiset/nacl_interval_range_tree_intern.h"
      14                 : 
      15               1 : struct NaClIntervalMultiset *NaClIntervalMultisetFactory(char const *kind) {
      16               1 :   struct NaClIntervalMultiset *widget = NULL;
      17                 : 
      18                 : #define MAKE(tag) do {                                             \
      19                 :     if (0 == strcmp(#tag, kind)) {                                 \
      20                 :       widget = (struct NaClIntervalMultiset *) malloc(             \
      21                 :           sizeof(struct tag));                                     \
      22                 :       if (NULL != widget && !tag ## Ctor((struct tag *) widget)) { \
      23                 :         free(widget);                                              \
      24                 :         widget = NULL;                                             \
      25                 :       }                                                            \
      26                 :       return widget;                                               \
      27                 :     }                                                              \
      28                 :   } while (0)
      29                 : 
      30               1 :   MAKE(NaClIntervalListMultiset);
      31               1 :   MAKE(NaClIntervalRangeTree);
      32                 : 
      33               0 :   return NULL;
      34               1 : }

Generated by: LCOV version 1.7