Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge commit '045db1657e870c721be490b411868f4181a12ced' into surf++
[simgrid.git] / testsuite / surf / surf_usage.c
index fd40b25..1fb6436 100644 (file)
@@ -1,6 +1,6 @@
 /* A few basic tests for the surf library                                   */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -63,13 +63,13 @@ void test(char *platform)
   cpuB = surf_cpu_resource_by_name("Cpu B");
 
   /* Let's check that those two processors exist */
-  XBT_DEBUG("%s : %p", surf_cpu_name(surf_cpu_resource_priv(cpuA)), cpuA);
-  XBT_DEBUG("%s : %p", surf_cpu_name(surf_cpu_resource_priv(cpuB)), cpuB);
-  surf_cpu_resource_priv(cpuA);
+  XBT_DEBUG("%s : %p", surf_resource_name(surf_cpu_resource_priv(cpuA)), cpuA);
+  XBT_DEBUG("%s : %p", surf_resource_name(surf_cpu_resource_priv(cpuB)), cpuB);
+
   /* Let's do something on it */
-  actionA = surf_cpu_execute(surf_cpu_resource_priv(cpuA), 1000.0);
-  actionB = surf_cpu_execute(surf_cpu_resource_priv(cpuB), 1000.0);
-  actionC = surf_cpu_sleep(surf_cpu_resource_priv(cpuB), 7.32);
+  actionA = surf_cpu_execute(cpuA, 1000.0);
+  actionB = surf_cpu_execute(cpuB, 1000.0);
+  actionC = surf_cpu_sleep(cpuB, 7.32);
 
   /* Use whatever calling style you want... */
   stateActionA = surf_action_get_state(actionA);     /* When you know actionA model type */